@dxos/plugin-client 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0

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 (131) hide show
  1. package/dist/lib/browser/{app-graph-builder-WAS4YZNA.mjs → app-graph-builder-ROTCC3C4.mjs} +35 -31
  2. package/dist/lib/browser/app-graph-builder-ROTCC3C4.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-XNV35HZK.mjs → chunk-7OW22D2O.mjs} +17 -13
  4. package/dist/lib/browser/chunk-7OW22D2O.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-XPHDZ277.mjs +105 -0
  6. package/dist/lib/browser/chunk-XPHDZ277.mjs.map +7 -0
  7. package/dist/lib/browser/{client-LV67Q3R7.mjs → client-ICXXK55V.mjs} +1 -1
  8. package/dist/lib/browser/client-ICXXK55V.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +8 -8
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/{intent-resolver-Y5GTS7CW.mjs → intent-resolver-L4STUWGK.mjs} +10 -10
  12. package/dist/lib/browser/intent-resolver-L4STUWGK.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/migrations-DYDZ7DVP.mjs +23 -0
  15. package/dist/lib/browser/migrations-DYDZ7DVP.mjs.map +7 -0
  16. package/dist/lib/browser/{react-surface-AUZGNKC5.mjs → react-surface-VXFG7BEM.mjs} +3 -3
  17. package/dist/lib/browser/schema-defs-QVXP2JGN.mjs +25 -0
  18. package/dist/lib/browser/schema-defs-QVXP2JGN.mjs.map +7 -0
  19. package/dist/lib/browser/types.mjs +1 -1
  20. package/dist/lib/node/{app-graph-builder-PXOJZJO5.cjs → app-graph-builder-DOHFMHXU.cjs} +44 -40
  21. package/dist/lib/node/app-graph-builder-DOHFMHXU.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-QNZIRU35.cjs → chunk-FABH7MJ3.cjs} +20 -16
  23. package/dist/lib/node/chunk-FABH7MJ3.cjs.map +7 -0
  24. package/dist/lib/node/{chunk-FROKBEVH.cjs → chunk-J5SQ5Q22.cjs} +47 -47
  25. package/dist/lib/node/chunk-J5SQ5Q22.cjs.map +7 -0
  26. package/dist/lib/node/{client-BKTGRBYM.cjs → client-OUBG63HJ.cjs} +4 -4
  27. package/dist/lib/node/client-OUBG63HJ.cjs.map +7 -0
  28. package/dist/lib/node/index.cjs +8 -8
  29. package/dist/lib/node/index.cjs.map +3 -3
  30. package/dist/lib/node/{intent-resolver-ZFYETGJI.cjs → intent-resolver-IDLAVEHS.cjs} +29 -29
  31. package/dist/lib/node/intent-resolver-IDLAVEHS.cjs.map +7 -0
  32. package/dist/lib/node/meta.json +1 -1
  33. package/dist/lib/node/{migrations-TGNI4FVL.cjs → migrations-ZI52SX4M.cjs} +11 -9
  34. package/dist/lib/node/migrations-ZI52SX4M.cjs.map +7 -0
  35. package/dist/lib/node/{react-surface-GBPBVXLE.cjs → react-surface-UGXE6OAD.cjs} +24 -24
  36. package/dist/lib/node/{schema-INQ72F54.cjs → schema-defs-BYGBDKOU.cjs} +13 -11
  37. package/dist/lib/node/schema-defs-BYGBDKOU.cjs.map +7 -0
  38. package/dist/lib/node/types.cjs +3 -3
  39. package/dist/lib/node/types.cjs.map +1 -1
  40. package/dist/lib/node-esm/{app-graph-builder-KIN6NWFI.mjs → app-graph-builder-XMXJG5YT.mjs} +35 -31
  41. package/dist/lib/node-esm/app-graph-builder-XMXJG5YT.mjs.map +7 -0
  42. package/dist/lib/node-esm/{chunk-6G43BNMU.mjs → chunk-34X2AMVA.mjs} +17 -13
  43. package/dist/lib/node-esm/chunk-34X2AMVA.mjs.map +7 -0
  44. package/dist/lib/node-esm/chunk-V6SJNSKG.mjs +106 -0
  45. package/dist/lib/node-esm/chunk-V6SJNSKG.mjs.map +7 -0
  46. package/dist/lib/node-esm/{client-QQD6WFOB.mjs → client-YJNEHNUV.mjs} +1 -1
  47. package/dist/lib/node-esm/client-YJNEHNUV.mjs.map +7 -0
  48. package/dist/lib/node-esm/index.mjs +8 -8
  49. package/dist/lib/node-esm/index.mjs.map +3 -3
  50. package/dist/lib/node-esm/{intent-resolver-OVG4QCHK.mjs → intent-resolver-73FZIXX5.mjs} +10 -10
  51. package/dist/lib/node-esm/intent-resolver-73FZIXX5.mjs.map +7 -0
  52. package/dist/lib/node-esm/meta.json +1 -1
  53. package/dist/lib/node-esm/{migrations-IVGATGZR.mjs → migrations-GHO52HKW.mjs} +8 -6
  54. package/dist/lib/node-esm/migrations-GHO52HKW.mjs.map +7 -0
  55. package/dist/lib/node-esm/{react-surface-SMPVSOTA.mjs → react-surface-R65DYUV6.mjs} +3 -3
  56. package/dist/lib/node-esm/schema-defs-O4OHIIBN.mjs +26 -0
  57. package/dist/lib/node-esm/schema-defs-O4OHIIBN.mjs.map +7 -0
  58. package/dist/lib/node-esm/types.mjs +1 -1
  59. package/dist/types/src/ClientPlugin.d.ts.map +1 -1
  60. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
  61. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  62. package/dist/types/src/capabilities/client.d.ts +2 -2
  63. package/dist/types/src/capabilities/client.d.ts.map +1 -1
  64. package/dist/types/src/capabilities/index.d.ts +5 -181
  65. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  66. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
  67. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/migrations.d.ts +2 -2
  69. package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
  70. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  71. package/dist/types/src/capabilities/schema-defs.d.ts +4 -0
  72. package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
  73. package/dist/types/src/components/DevicesContainer.d.ts +4 -3
  74. package/dist/types/src/components/DevicesContainer.d.ts.map +1 -1
  75. package/dist/types/src/components/DevicesContainer.stories.d.ts.map +1 -1
  76. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  77. package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
  78. package/dist/types/src/components/ResetDialog.d.ts.map +1 -1
  79. package/dist/types/src/components/ResetDialog.stories.d.ts.map +1 -1
  80. package/dist/types/src/types.d.ts +53 -53
  81. package/dist/types/src/types.d.ts.map +1 -1
  82. package/dist/types/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +31 -25
  84. package/src/ClientPlugin.ts +2 -2
  85. package/src/capabilities/app-graph-builder.ts +94 -76
  86. package/src/capabilities/client.ts +2 -2
  87. package/src/capabilities/index.ts +1 -1
  88. package/src/capabilities/intent-resolver.ts +9 -9
  89. package/src/capabilities/migrations.ts +14 -11
  90. package/src/capabilities/schema-defs.ts +29 -0
  91. package/src/components/DevicesContainer.stories.tsx +7 -3
  92. package/src/components/DevicesContainer.tsx +19 -12
  93. package/src/components/ProfileContainer.stories.tsx +1 -1
  94. package/src/components/ProfileContainer.tsx +7 -7
  95. package/src/components/RecoveryCodeDialog.stories.tsx +1 -1
  96. package/src/components/RecoveryCredentialsContainer.stories.tsx +2 -2
  97. package/src/components/ResetDialog.stories.tsx +7 -1
  98. package/src/translations.ts +1 -1
  99. package/src/types.ts +50 -46
  100. package/dist/lib/browser/app-graph-builder-WAS4YZNA.mjs.map +0 -7
  101. package/dist/lib/browser/chunk-AN7FJKIJ.mjs +0 -105
  102. package/dist/lib/browser/chunk-AN7FJKIJ.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-XNV35HZK.mjs.map +0 -7
  104. package/dist/lib/browser/client-LV67Q3R7.mjs.map +0 -7
  105. package/dist/lib/browser/intent-resolver-Y5GTS7CW.mjs.map +0 -7
  106. package/dist/lib/browser/migrations-3DWFOL5Q.mjs +0 -21
  107. package/dist/lib/browser/migrations-3DWFOL5Q.mjs.map +0 -7
  108. package/dist/lib/browser/schema-JQAT6Q7S.mjs +0 -23
  109. package/dist/lib/browser/schema-JQAT6Q7S.mjs.map +0 -7
  110. package/dist/lib/node/app-graph-builder-PXOJZJO5.cjs.map +0 -7
  111. package/dist/lib/node/chunk-FROKBEVH.cjs.map +0 -7
  112. package/dist/lib/node/chunk-QNZIRU35.cjs.map +0 -7
  113. package/dist/lib/node/client-BKTGRBYM.cjs.map +0 -7
  114. package/dist/lib/node/intent-resolver-ZFYETGJI.cjs.map +0 -7
  115. package/dist/lib/node/migrations-TGNI4FVL.cjs.map +0 -7
  116. package/dist/lib/node/schema-INQ72F54.cjs.map +0 -7
  117. package/dist/lib/node-esm/app-graph-builder-KIN6NWFI.mjs.map +0 -7
  118. package/dist/lib/node-esm/chunk-6G43BNMU.mjs.map +0 -7
  119. package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs +0 -106
  120. package/dist/lib/node-esm/chunk-AD5W5QCQ.mjs.map +0 -7
  121. package/dist/lib/node-esm/client-QQD6WFOB.mjs.map +0 -7
  122. package/dist/lib/node-esm/intent-resolver-OVG4QCHK.mjs.map +0 -7
  123. package/dist/lib/node-esm/migrations-IVGATGZR.mjs.map +0 -7
  124. package/dist/lib/node-esm/schema-OK7HY3JJ.mjs +0 -24
  125. package/dist/lib/node-esm/schema-OK7HY3JJ.mjs.map +0 -7
  126. package/dist/types/src/capabilities/schema.d.ts +0 -4
  127. package/dist/types/src/capabilities/schema.d.ts.map +0 -1
  128. package/src/capabilities/schema.ts +0 -26
  129. /package/dist/lib/browser/{react-surface-AUZGNKC5.mjs.map → react-surface-VXFG7BEM.mjs.map} +0 -0
  130. /package/dist/lib/node/{react-surface-GBPBVXLE.cjs.map → react-surface-UGXE6OAD.cjs.map} +0 -0
  131. /package/dist/lib/node-esm/{react-surface-SMPVSOTA.mjs.map → react-surface-R65DYUV6.mjs.map} +0 -0
@@ -1,106 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- CLIENT_PLUGIN
4
- } from "./chunk-HM7VB4ZV.mjs";
5
-
6
- // packages/plugins/plugin-client/src/types.ts
7
- import { S } from "@dxos/echo-schema";
8
- import { PublicKey } from "@dxos/react-client";
9
- var IdentitySchema = S.Struct({
10
- identityKey: S.instanceOf(PublicKey),
11
- spaceKey: S.optional(S.instanceOf(PublicKey)),
12
- profile: S.optional(S.Struct({
13
- displayName: S.optional(S.String),
14
- avatarCid: S.optional(S.String),
15
- data: S.optional(S.Record({
16
- key: S.String,
17
- value: S.Any
18
- }))
19
- }))
20
- });
21
- var CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;
22
- var ClientAction;
23
- (function(ClientAction2) {
24
- class CreateIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/create-identity`, {
25
- input: S.Struct({
26
- displayName: S.optional(S.String)
27
- }),
28
- output: IdentitySchema
29
- }) {
30
- }
31
- ClientAction2.CreateIdentity = CreateIdentity;
32
- class JoinIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/join-identity`, {
33
- input: S.Struct({
34
- invitationCode: S.optional(S.String)
35
- }),
36
- output: S.Void
37
- }) {
38
- }
39
- ClientAction2.JoinIdentity = JoinIdentity;
40
- class ShareIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/share-identity`, {
41
- input: S.Void,
42
- output: S.Void
43
- }) {
44
- }
45
- ClientAction2.ShareIdentity = ShareIdentity;
46
- class RecoverIdentity extends S.TaggedClass()(`${CLIENT_ACTION}/recover-identity`, {
47
- input: S.Void,
48
- output: S.Void
49
- }) {
50
- }
51
- ClientAction2.RecoverIdentity = RecoverIdentity;
52
- class ResetStorage extends S.TaggedClass()(`${CLIENT_ACTION}/reset-storage`, {
53
- input: S.Struct({
54
- mode: S.optional(S.String)
55
- }),
56
- output: S.Void
57
- }) {
58
- }
59
- ClientAction2.ResetStorage = ResetStorage;
60
- class CreateAgent extends S.TaggedClass()(`${CLIENT_ACTION}/create-agent`, {
61
- input: S.Void,
62
- output: S.Void
63
- }) {
64
- }
65
- ClientAction2.CreateAgent = CreateAgent;
66
- class CreateRecoveryCode extends S.TaggedClass()(`${CLIENT_ACTION}/create-recovery-code`, {
67
- input: S.Void,
68
- output: S.Void
69
- }) {
70
- }
71
- ClientAction2.CreateRecoveryCode = CreateRecoveryCode;
72
- class CreatePasskey extends S.TaggedClass()(`${CLIENT_ACTION}/create-passkey`, {
73
- input: S.Void,
74
- output: S.Void
75
- }) {
76
- }
77
- ClientAction2.CreatePasskey = CreatePasskey;
78
- class RedeemPasskey extends S.TaggedClass()(`${CLIENT_ACTION}/redeem-passkey`, {
79
- input: S.Void,
80
- output: S.Void
81
- }) {
82
- }
83
- ClientAction2.RedeemPasskey = RedeemPasskey;
84
- class RedeemToken extends S.TaggedClass()(`${CLIENT_ACTION}/redeem-token`, {
85
- input: S.Struct({
86
- token: S.String
87
- }),
88
- output: S.Void
89
- }) {
90
- }
91
- ClientAction2.RedeemToken = RedeemToken;
92
- })(ClientAction || (ClientAction = {}));
93
- var Account;
94
- (function(Account2) {
95
- const _id = "dxos.org.plugin.client.account";
96
- Account2.id = `!${_id}`;
97
- Account2.Profile = `${_id}.profile`;
98
- Account2.Devices = `${_id}.devices`;
99
- Account2.Security = `${_id}.security`;
100
- })(Account || (Account = {}));
101
-
102
- export {
103
- ClientAction,
104
- Account
105
- };
106
- //# sourceMappingURL=chunk-AD5W5QCQ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type PluginsContext } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type Client, PublicKey, type ClientOptions } from '@dxos/react-client';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { CLIENT_PLUGIN } from './meta';\n\n// TODO(wittjosiah): Factor out. Generate?\nconst IdentitySchema = S.Struct({\n identityKey: S.instanceOf(PublicKey),\n spaceKey: S.optional(S.instanceOf(PublicKey)),\n profile: S.optional(\n S.Struct({\n displayName: S.optional(S.String),\n avatarCid: S.optional(S.String),\n data: S.optional(S.Record({ key: S.String, value: S.Any })),\n }),\n ),\n});\n\nconst CLIENT_ACTION = `${CLIENT_PLUGIN}/action`;\nexport namespace ClientAction {\n export class CreateIdentity extends S.TaggedClass<CreateIdentity>()(`${CLIENT_ACTION}/create-identity`, {\n input: S.Struct({\n displayName: S.optional(S.String),\n }),\n output: IdentitySchema,\n }) {}\n\n export class JoinIdentity extends S.TaggedClass<JoinIdentity>()(`${CLIENT_ACTION}/join-identity`, {\n input: S.Struct({\n invitationCode: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class ShareIdentity extends S.TaggedClass<ShareIdentity>()(`${CLIENT_ACTION}/share-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RecoverIdentity extends S.TaggedClass<RecoverIdentity>()(`${CLIENT_ACTION}/recover-identity`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class ResetStorage extends S.TaggedClass<ResetStorage>()(`${CLIENT_ACTION}/reset-storage`, {\n input: S.Struct({\n mode: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class CreateAgent extends S.TaggedClass<CreateAgent>()(`${CLIENT_ACTION}/create-agent`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreateRecoveryCode extends S.TaggedClass<CreateRecoveryCode>()(`${CLIENT_ACTION}/create-recovery-code`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class CreatePasskey extends S.TaggedClass<CreatePasskey>()(`${CLIENT_ACTION}/create-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RedeemPasskey extends S.TaggedClass<RedeemPasskey>()(`${CLIENT_ACTION}/redeem-passkey`, {\n input: S.Void,\n output: S.Void,\n }) {}\n\n export class RedeemToken extends S.TaggedClass<RedeemToken>()(`${CLIENT_ACTION}/redeem-token`, {\n input: S.Struct({\n token: S.String,\n }),\n output: S.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?: (context: PluginsContext, 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": ";;;;;;AAKA,SAASA,SAAS;AAClB,SAAsBC,iBAAqC;AAM3D,IAAMC,iBAAiBC,EAAEC,OAAO;EAC9BC,aAAaF,EAAEG,WAAWC,SAAAA;EAC1BC,UAAUL,EAAEM,SAASN,EAAEG,WAAWC,SAAAA,CAAAA;EAClCG,SAASP,EAAEM,SACTN,EAAEC,OAAO;IACPO,aAAaR,EAAEM,SAASN,EAAES,MAAM;IAChCC,WAAWV,EAAEM,SAASN,EAAES,MAAM;IAC9BE,MAAMX,EAAEM,SAASN,EAAEY,OAAO;MAAEC,KAAKb,EAAES;MAAQK,OAAOd,EAAEe;IAAI,CAAA,CAAA;EAC1D,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAMC,gBAAgB,GAAGC,aAAAA;;UACRC,eAAAA;EACR,MAAMC,uBAAuBnB,EAAEoB,YAAW,EAAmB,GAAGJ,aAAAA,oBAAiC;IACtGK,OAAOrB,EAAEC,OAAO;MACdO,aAAaR,EAAEM,SAASN,EAAES,MAAM;IAClC,CAAA;IACAa,QAAQvB;EACV,CAAA,EAAA;EAAI;gBALSoB,iBAAAA;EAON,MAAMI,qBAAqBvB,EAAEoB,YAAW,EAAiB,GAAGJ,aAAAA,kBAA+B;IAChGK,OAAOrB,EAAEC,OAA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;EACZ,CAAA,EAAA;EAAI;gBAHSQ,gBAAAA;EAKN,MAAMC,oBAAoBlC,EAAEoB,YAAW,EAAgB,GAAGJ,aAAAA,iBAA8B;IAC7FK,OAAOrB,EAAEC,OAAO;MACdkC,OAAOnC,EAAES;IACX,CAAA;IACAa,QAAQtB,EAAEyB;EACZ,CAAA,EAAA;EAAI;gBALSS,cAAAA;AAMf,GA1DiBhB,iBAAAA,eAAAA,CAAAA,EAAAA;;UAkFAkB,UAAAA;AAEf,QAAMC,MAAM;WAGCC,KAAK,IAAID,GAAAA;WAETE,UAAU,GAAGF,GAAAA;WACbG,UAAU,GAAGH,GAAAA;WACbI,WAAW,GAAGJ,GAAAA;AAC7B,GAViBD,YAAAA,UAAAA,CAAAA,EAAAA;",
6
- "names": ["S", "PublicKey", "IdentitySchema", "S", "Struct", "identityKey", "instanceOf", "PublicKey", "spaceKey", "optional", "profile", "displayName", "String", "avatarCid", "data", "Record", "key", "value", "Any", "CLIENT_ACTION", "CLIENT_PLUGIN", "ClientAction", "CreateIdentity", "TaggedClass", "input", "output", "JoinIdentity", "invitationCode", "Void", "ShareIdentity", "RecoverIdentity", "ResetStorage", "mode", "CreateAgent", "CreateRecoveryCode", "CreatePasskey", "RedeemPasskey", "RedeemToken", "token", "Account", "_id", "id", "Profile", "Devices", "Security"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/client.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { Client } from '@dxos/react-client';\n\nimport { ClientCapabilities } from './capabilities';\nimport { ClientEvents } from '../events';\nimport { type ClientPluginOptions } from '../types';\n\ntype ClientCapabilityOptions = Omit<ClientPluginOptions, 'appKey' | 'invitationUrl' | 'invitationParam' | 'onReset'> & {\n context: PluginsContext;\n};\n\nexport default async ({ context, onClientInitialized, ...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 const subscription = client.spaces.isReady.subscribe(async (ready) => {\n if (ready) {\n await context.activatePromise(ClientEvents.SpacesReady);\n }\n });\n\n return contributes(ClientCapabilities.Client, client, async () => {\n subscription.unsubscribe();\n await client.destroy();\n });\n};\n"],
5
- "mappings": ";;;;;;;;;;AAIA,SAASA,mBAAwC;AACjD,SAASC,cAAc;AAUvB,IAAA,iBAAe,OAAO,EAAEC,SAASC,qBAAqB,GAAGC,QAAAA,MAAkC;AACzF,QAAMC,SAAS,IAAIC,OAAOF,OAAAA;AAC1B,QAAMC,OAAOE,WAAU;AACvB,QAAMJ,sBAAsBD,SAASG,MAAAA;AAGrCA,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;AAEA,QAAMC,eAAeZ,OAAOa,OAAOC,QAAQP,UAAU,OAAOQ,UAAAA;AAC1D,QAAIA,OAAO;AACT,YAAMlB,QAAQmB,gBAAgBC,aAAaC,WAAW;IACxD;EACF,CAAA;AAEA,SAAOC,YAAYC,mBAAmBnB,QAAQD,QAAQ,YAAA;AACpDY,iBAAaS,YAAW;AACxB,UAAMrB,OAAOsB,QAAO;EACtB,CAAA;AACF;",
6
- "names": ["contributes", "Client", "context", "onClientInitialized", "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,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 PluginsContext,\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: PluginsContext;\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 () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const client = context.requestCapability(ClientCapabilities.Client);\n const data = await client.halo.createIdentity();\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.requestCapability(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.requestCapability(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.requestCapability(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.requestCapability(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.requestCapability(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_IDENTIT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9D,OAAOwC,SAASA,SAASK,gBAAgByC,yBAAwB;AACzE,YAAM7B,aAAa,MAAMC,UAAUC,YAAYN,IAAI;QACjDQ,WAAW;UACTC,WAAWyB,OAAOT,KAAKhB,WAAW,QAAA;UAClC0B,MAAMvB,SAASC;UACfuB,kBAAkB;QACpB;MACF,CAAA;AACA,YAAMnC,YAAYC,UAAUuB,KAAK,IAAIf,WAAYN,WAAmBsB,SAASW,UAAU,CAAA;AACvF,YAAM1F,OAAOwC,SAASA,SAASK,gBAAgB8C,gBAC7C;QACEC,UAAU;UACRtC;UACA8B;UACAC;UACAQ,WAAWN,OAAOT,KAAMrB,WAAmBsB,SAASc,SAAS;UAC7DC,gBAAgBP,OAAOT,KAAMrB,WAAmBsB,SAASgB,cAAc;UACvEC,mBAAmBT,OAAOT,KAAMrB,WAAmBsB,SAASiB,iBAAiB;QAC/E;MACF,GACA;QAAErD,SAASzD;MAA6B,CAAA;IAE5C;EACF,CAAA;EACAM,eAAe;IACbC,QAAQC,aAAauG;IACrBrG,SAAS,OAAOO,SAAAA;AACd,YAAMH,SAASb,QAAQW,kBAAkBG,mBAAmBC,MAAM;AAElEqC,gBAAUvC,OAAOwC,SAASA,SAASK,iBAAiB,iCAAA;;;;;;;;;AACpD,YAAM7C,OAAOwC,SAASA,SAASK,gBAAgB8C,gBAC7C;QAAEO,OAAO/F,KAAK+F;MAAM,GACpB;QAAEvD,SAASzD;MAA6B,CAAA;IAE5C;EACF,CAAA;CACD;",
6
- "names": ["pipe", "Capabilities", "chain", "contributes", "createIntent", "createResolver", "LayoutAction", "invariant", "ObservabilityAction", "PublicKey", "RECOVER_IDENTITY_RPC_TIMEOUT", "context", "appName", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ClientAction", "CreateIdentity", "resolve", "manager", "requestCapability", "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", "profile", "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
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/migrations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n\n // NOTE: Migrations are currently unidirectional and idempotent.\n const unsubscribe = effect(() => {\n const migrations = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Migration).flat()));\n const spaces = client.spaces.get();\n void Promise.all(spaces.map((space) => space.db.runMigrations(migrations)));\n });\n\n return contributes(Capabilities.Null, null, () => unsubscribe());\n};\n"],
5
- "mappings": ";;;;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,cAAcC,mBAAwC;AAI/D,IAAA,qBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,mBAAmBC,MAAM;AAGlE,QAAMC,cAAcC,OAAO,MAAA;AACzB,UAAMC,aAAaC,MAAMC,KAAK,IAAIC,IAAIV,QAAQW,oBAAoBR,mBAAmBS,SAAS,EAAEC,KAAI,CAAA,CAAA;AACpG,UAAMC,SAASb,OAAOa,OAAOC,IAAG;AAChC,SAAKC,QAAQC,IAAIH,OAAOI,IAAI,CAACC,UAAUA,MAAMC,GAAGC,cAAcd,UAAAA,CAAAA,CAAAA;EAChE,CAAA;AAEA,SAAOe,YAAYC,aAAaC,MAAM,MAAM,MAAMnB,YAAAA,CAAAA;AACpD;",
6
- "names": ["effect", "Capabilities", "contributes", "context", "client", "requestCapability", "ClientCapabilities", "Client", "unsubscribe", "effect", "migrations", "Array", "from", "Set", "requestCapabilities", "Migration", "flat", "spaces", "get", "Promise", "all", "map", "space", "db", "runMigrations", "contributes", "Capabilities", "Null"]
7
- }
@@ -1,24 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- ClientCapabilities
4
- } from "./chunk-K3KGGSJZ.mjs";
5
- import "./chunk-HM7VB4ZV.mjs";
6
-
7
- // packages/plugins/plugin-client/src/capabilities/schema.ts
8
- import { effect } from "@preact/signals-core";
9
- import { Capabilities, contributes } from "@dxos/app-framework";
10
- var schema_default = (context) => {
11
- const client = context.requestCapability(ClientCapabilities.Client);
12
- let previous = [];
13
- const unsubscribe = effect(() => {
14
- const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));
15
- const newSchemas = schemas.filter((schema) => !previous.includes(schema));
16
- previous = schemas;
17
- client.addTypes(newSchemas);
18
- });
19
- return contributes(Capabilities.Null, null, () => unsubscribe());
20
- };
21
- export {
22
- schema_default as default
23
- };
24
- //# sourceMappingURL=schema-OK7HY3JJ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/schema.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type TypedObject } from '@dxos/echo-schema';\n\nimport { ClientCapabilities } from './capabilities';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n\n // TODO(wittjosiah): Unregister schemas when they are disabled.\n let previous: TypedObject[] = [];\n const unsubscribe = effect(() => {\n const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));\n // TODO(wittjosiah): Filter out schemas which the client has already registered.\n const newSchemas = schemas.filter((schema) => !previous.includes(schema));\n previous = schemas;\n client.addTypes(newSchemas);\n });\n\n return contributes(Capabilities.Null, null, () => unsubscribe());\n};\n"],
5
- "mappings": ";;;;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,cAAcC,mBAAwC;AAK/D,IAAA,iBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,mBAAmBC,MAAM;AAGlE,MAAIC,WAA0B,CAAA;AAC9B,QAAMC,cAAcC,OAAO,MAAA;AACzB,UAAMC,UAAUC,MAAMC,KAAK,IAAIC,IAAIX,QAAQY,oBAAoBT,mBAAmBU,MAAM,EAAEC,KAAI,CAAA,CAAA;AAE9F,UAAMC,aAAaP,QAAQQ,OAAO,CAACC,WAAW,CAACZ,SAASa,SAASD,MAAAA,CAAAA;AACjEZ,eAAWG;AACXP,WAAOkB,SAASJ,UAAAA;EAClB,CAAA;AAEA,SAAOK,YAAYC,aAAaC,MAAM,MAAM,MAAMhB,YAAAA,CAAAA;AACpD;",
6
- "names": ["effect", "Capabilities", "contributes", "context", "client", "requestCapability", "ClientCapabilities", "Client", "previous", "unsubscribe", "effect", "schemas", "Array", "from", "Set", "requestCapabilities", "Schema", "flat", "newSchemas", "filter", "schema", "includes", "addTypes", "contributes", "Capabilities", "Null"]
7
- }
@@ -1,4 +0,0 @@
1
- import { type PluginsContext } from '@dxos/app-framework';
2
- declare const _default: (context: PluginsContext) => import("@dxos/app-framework").Capability<null>;
3
- export default _default;
4
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/schema.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;kCAK5D,cAAc;AAAvC,wBAcE"}
@@ -1,26 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { effect } from '@preact/signals-core';
6
-
7
- import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
8
- import { type TypedObject } from '@dxos/echo-schema';
9
-
10
- import { ClientCapabilities } from './capabilities';
11
-
12
- export default (context: PluginsContext) => {
13
- const client = context.requestCapability(ClientCapabilities.Client);
14
-
15
- // TODO(wittjosiah): Unregister schemas when they are disabled.
16
- let previous: TypedObject[] = [];
17
- const unsubscribe = effect(() => {
18
- const schemas = Array.from(new Set(context.requestCapabilities(ClientCapabilities.Schema).flat()));
19
- // TODO(wittjosiah): Filter out schemas which the client has already registered.
20
- const newSchemas = schemas.filter((schema) => !previous.includes(schema));
21
- previous = schemas;
22
- client.addTypes(newSchemas);
23
- });
24
-
25
- return contributes(Capabilities.Null, null, () => unsubscribe());
26
- };