@dexterai/connect 0.29.0 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -194,6 +194,23 @@ WebAuthn challenge and verification calls use `https://api.dexter.cash`. The
194
194
  default `transport: 'auto'` selects inline or popup transport. Integrators can
195
195
  force `popup` or `inline` when their environment requires it.
196
196
 
197
+ The first-party page uses the guarded hosted entry instead of importing raw
198
+ login or Wallet-store functions:
199
+
200
+ ```ts
201
+ import { runHostedCeremony } from '@dexterai/connect/hosted';
202
+
203
+ const result = await runHostedCeremony({
204
+ operation: 'continue',
205
+ walletStore: 'provisional',
206
+ });
207
+ ```
208
+
209
+ This entry runs only on `https://dexter.cash`. It pins the inline transport and
210
+ Dexter API while preserving provisional Wallet results for the opener. The root
211
+ package continues to expose the complete identity transition rather than its
212
+ private login and browser-roster steps.
213
+
197
214
  ## Server verification
198
215
 
199
216
  ```ts
@@ -0,0 +1,618 @@
1
+ import {
2
+ ConnectError,
3
+ accountBindingCandidate,
4
+ activateConnectVault,
5
+ createWalletAccountBindingClient,
6
+ disconnectActiveWallet,
7
+ getActiveWallet,
8
+ passkeyLogin,
9
+ setActiveWallet,
10
+ subscribe,
11
+ walletBindingCandidate,
12
+ walletProofSessionStore
13
+ } from "./chunk-CZL7NGVV.js";
14
+
15
+ // src/relationController.ts
16
+ function provisionalRelation(walletPresent, accountPresent) {
17
+ if (walletPresent) return "wallet_only";
18
+ if (accountPresent) return "account_only";
19
+ return "none";
20
+ }
21
+ function frozenRuntime(runtime) {
22
+ return Object.freeze({ ...runtime });
23
+ }
24
+ function frozenSnapshot(relation, runtime, walletPresent, accountPresent, verifiedAt, revision) {
25
+ const readyAndBound = relation === "bound" && runtime.phase === "ready";
26
+ return Object.freeze({
27
+ relation,
28
+ runtime: frozenRuntime(runtime),
29
+ walletPresent,
30
+ accountPresent,
31
+ privateAccountAccess: readyAndBound,
32
+ quarantined: relation === "conflict",
33
+ verifiedAt: readyAndBound || relation === "conflict" ? verifiedAt : null,
34
+ revision
35
+ });
36
+ }
37
+ function isVerifiedResult(value) {
38
+ if (!value || typeof value !== "object") return false;
39
+ const result = value;
40
+ if (result.ok !== true) return false;
41
+ if (result.relation !== "bound" && result.relation !== "conflict") return false;
42
+ return result.verifiedAt === void 0 || Number.isFinite(result.verifiedAt);
43
+ }
44
+ function isFailureResult(value) {
45
+ if (!value || typeof value !== "object") return false;
46
+ const result = value;
47
+ if (result.ok !== false) return false;
48
+ if (result.reason === "offline") return true;
49
+ if (result.reason === "expired") {
50
+ return result.subject === "wallet" || result.subject === "account" || result.subject === "both";
51
+ }
52
+ return result.reason === "error" && typeof result.code === "string" && result.code.length > 0;
53
+ }
54
+ var WalletAccountRelationController = class {
55
+ wallet = null;
56
+ account = null;
57
+ revision = 0;
58
+ activeCheck = null;
59
+ listeners = /* @__PURE__ */ new Set();
60
+ verify;
61
+ now;
62
+ snapshot;
63
+ constructor(options) {
64
+ this.verify = options.verify;
65
+ this.now = options.now ?? Date.now;
66
+ this.snapshot = frozenSnapshot("none", { phase: "hydrating" }, false, false, null, 0);
67
+ }
68
+ getSnapshot() {
69
+ return this.snapshot;
70
+ }
71
+ subscribe(listener) {
72
+ this.listeners.add(listener);
73
+ return () => this.listeners.delete(listener);
74
+ }
75
+ /** Restore cached candidates, then verify the exact pair before unlocking account access. */
76
+ restore(candidates) {
77
+ this.replaceCandidates(candidates.wallet, candidates.account, { phase: "hydrating" });
78
+ return this.settle("restore");
79
+ }
80
+ /** Lock account-owned data while the host restores its account session. */
81
+ beginRestore() {
82
+ this.invalidate({ phase: "hydrating" });
83
+ }
84
+ /** An explicit Wallet event always invalidates prior binding, even for the same object. */
85
+ setWallet(wallet) {
86
+ this.replaceCandidates(wallet, this.account, this.runtimeAfterChange("wallet_change", wallet, this.account));
87
+ return this.settle("wallet_change");
88
+ }
89
+ /** An explicit account event always invalidates prior binding, even for the same object. */
90
+ setAccount(account) {
91
+ this.replaceCandidates(this.wallet, account, this.runtimeAfterChange("account_change", this.wallet, account));
92
+ return this.settle("account_change");
93
+ }
94
+ retry() {
95
+ this.invalidate(this.runtimeAfterChange("retry", this.wallet, this.account));
96
+ return this.settle("retry");
97
+ }
98
+ dispose() {
99
+ this.activeCheck?.abort();
100
+ this.activeCheck = null;
101
+ this.listeners.clear();
102
+ }
103
+ runtimeAfterChange(reason, wallet, account) {
104
+ return wallet !== null && account !== null ? { phase: "checking", reason } : { phase: "ready" };
105
+ }
106
+ replaceCandidates(wallet, account, runtime) {
107
+ this.wallet = wallet;
108
+ this.account = account;
109
+ this.invalidate(runtime);
110
+ }
111
+ invalidate(runtime) {
112
+ this.activeCheck?.abort();
113
+ this.activeCheck = null;
114
+ this.revision += 1;
115
+ const walletPresent = this.wallet !== null;
116
+ const accountPresent = this.account !== null;
117
+ this.publish(
118
+ provisionalRelation(walletPresent, accountPresent),
119
+ runtime,
120
+ walletPresent,
121
+ accountPresent,
122
+ null,
123
+ this.revision
124
+ );
125
+ }
126
+ settle(reason) {
127
+ if (this.wallet !== null && this.account !== null) return this.runCheck(reason);
128
+ if (this.snapshot.runtime.phase !== "ready") {
129
+ this.publish(
130
+ provisionalRelation(this.wallet !== null, this.account !== null),
131
+ { phase: "ready" },
132
+ this.wallet !== null,
133
+ this.account !== null,
134
+ null,
135
+ this.revision
136
+ );
137
+ }
138
+ return Promise.resolve(this.snapshot);
139
+ }
140
+ async runCheck(reason) {
141
+ const wallet = this.wallet;
142
+ const account = this.account;
143
+ if (wallet === null || account === null) return this.settle(reason);
144
+ const revision = this.revision;
145
+ const check = new AbortController();
146
+ this.activeCheck?.abort();
147
+ this.activeCheck = check;
148
+ if (this.snapshot.runtime.phase !== "checking" || this.snapshot.runtime.reason !== reason) {
149
+ this.publish(
150
+ provisionalRelation(true, true),
151
+ { phase: "checking", reason },
152
+ true,
153
+ true,
154
+ null,
155
+ revision
156
+ );
157
+ }
158
+ try {
159
+ const result = await this.verify({ wallet, account, reason, signal: check.signal });
160
+ if (!this.isCurrentCheck(check, revision)) return this.snapshot;
161
+ this.activeCheck = null;
162
+ if (isVerifiedResult(result)) {
163
+ this.publish(result.relation, { phase: "ready" }, true, true, result.verifiedAt ?? this.now(), revision);
164
+ return this.snapshot;
165
+ }
166
+ if (isFailureResult(result)) {
167
+ const runtime = result.reason === "offline" ? { phase: "offline" } : result.reason === "expired" ? { phase: "expired", subject: result.subject } : { phase: "error", code: result.code };
168
+ this.publish("wallet_only", runtime, true, true, null, revision);
169
+ return this.snapshot;
170
+ }
171
+ this.publish("wallet_only", { phase: "error", code: "invalid_verification_result" }, true, true, null, revision);
172
+ } catch (error) {
173
+ if (!this.isCurrentCheck(check, revision)) return this.snapshot;
174
+ this.activeCheck = null;
175
+ const code = error && typeof error === "object" && "code" in error && typeof error.code === "string" ? error.code : "verification_failed";
176
+ this.publish("wallet_only", { phase: "error", code }, true, true, null, revision);
177
+ }
178
+ return this.snapshot;
179
+ }
180
+ isCurrentCheck(check, revision) {
181
+ return this.activeCheck === check && this.revision === revision && !check.signal.aborted;
182
+ }
183
+ publish(relation, runtime, walletPresent, accountPresent, verifiedAt, revision) {
184
+ this.snapshot = frozenSnapshot(
185
+ relation,
186
+ runtime,
187
+ walletPresent,
188
+ accountPresent,
189
+ verifiedAt,
190
+ revision
191
+ );
192
+ for (const listener of this.listeners) {
193
+ try {
194
+ listener(this.snapshot);
195
+ } catch {
196
+ }
197
+ }
198
+ }
199
+ };
200
+
201
+ // src/identityCoordinator.ts
202
+ import { decodeJwt } from "jose";
203
+ var CANONICAL_ACCOUNT_SUBJECT = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
204
+ function walletCandidate(wallet, proofStore) {
205
+ if (!wallet) return null;
206
+ let proof = null;
207
+ try {
208
+ proof = wallet.vaultPda ? proofStore.bindingCandidate(wallet.handle, {
209
+ userHandle: wallet.handle,
210
+ vaultPda: wallet.vaultPda
211
+ }) : null;
212
+ } catch {
213
+ proof = null;
214
+ }
215
+ return Object.freeze({ handle: wallet.handle, wallet, proof });
216
+ }
217
+ function accountCandidate(accessToken) {
218
+ return accessToken ? accountBindingCandidate(accessToken) : null;
219
+ }
220
+ function canonicalAccountSubject(accessToken) {
221
+ try {
222
+ const subject = decodeJwt(accessToken).sub;
223
+ return typeof subject === "string" && CANONICAL_ACCOUNT_SUBJECT.test(subject) ? subject : null;
224
+ } catch {
225
+ return null;
226
+ }
227
+ }
228
+ function createDexterIdentityCoordinator(options = {}) {
229
+ const proofStore = options.proofSessionStore ?? walletProofSessionStore;
230
+ const bindingClient = options.bindingClient ?? createWalletAccountBindingClient({
231
+ ...options.apiBase ? { apiBase: options.apiBase } : {},
232
+ ...options.fetch ? { fetch: options.fetch } : {}
233
+ });
234
+ const controller = new WalletAccountRelationController({
235
+ verify: async ({ wallet, account, reason, signal }) => {
236
+ if (!wallet.proof) {
237
+ return {
238
+ ok: false,
239
+ reason: "expired",
240
+ subject: "wallet"
241
+ };
242
+ }
243
+ return bindingClient.verify({
244
+ wallet: wallet.proof,
245
+ account,
246
+ reason,
247
+ signal
248
+ });
249
+ }
250
+ });
251
+ let currentAccount = null;
252
+ let currentAccountAccessToken = null;
253
+ let currentAccountSubject = null;
254
+ let invalidatedAccountSubject = null;
255
+ let allowedAccountAccessToken = null;
256
+ let pendingAccountSettlement = null;
257
+ let accountLoading = false;
258
+ let disposed = false;
259
+ let started = false;
260
+ let unsubscribeWallet = null;
261
+ let unsubscribeProof = null;
262
+ let proofExpiryTimer = null;
263
+ const currentWallet = () => walletCandidate(getActiveWallet(), proofStore);
264
+ const clearCurrentAccount = () => {
265
+ currentAccount = null;
266
+ currentAccountAccessToken = null;
267
+ currentAccountSubject = null;
268
+ pendingAccountSettlement = null;
269
+ };
270
+ const setCurrentAccount = (accountAccessToken) => {
271
+ currentAccount = accountCandidate(accountAccessToken);
272
+ currentAccountAccessToken = accountAccessToken;
273
+ currentAccountSubject = canonicalAccountSubject(accountAccessToken);
274
+ };
275
+ const keepAccountLoadingLocked = (wallet) => {
276
+ clearCurrentAccount();
277
+ void controller.restore({ wallet, account: null });
278
+ controller.beginRestore();
279
+ };
280
+ const clearProofExpiryTimer = () => {
281
+ if (proofExpiryTimer !== null) clearTimeout(proofExpiryTimer);
282
+ proofExpiryTimer = null;
283
+ };
284
+ const scheduleProofExpiry = () => {
285
+ clearProofExpiryTimer();
286
+ const active = getActiveWallet();
287
+ if (!active) return;
288
+ const session = proofStore.load(active.handle);
289
+ if (!session) return;
290
+ const remainingMs = Math.max(0, session.expiresAt * 1e3 - Date.now());
291
+ const delayMs = Math.min(remainingMs, 2147e6);
292
+ proofExpiryTimer = setTimeout(() => {
293
+ proofExpiryTimer = null;
294
+ if (Date.now() < session.expiresAt * 1e3) {
295
+ scheduleProofExpiry();
296
+ return;
297
+ }
298
+ void controller.setWallet(currentWallet());
299
+ scheduleProofExpiry();
300
+ }, delayMs);
301
+ };
302
+ const start = () => {
303
+ if (started || disposed) return;
304
+ started = true;
305
+ unsubscribeWallet = subscribe((event) => {
306
+ if (disposed || !event.invalidatesAccountBinding) return;
307
+ scheduleProofExpiry();
308
+ const wallet = currentWallet();
309
+ if (accountLoading) {
310
+ keepAccountLoadingLocked(wallet);
311
+ return;
312
+ }
313
+ invalidatedAccountSubject = currentAccountSubject ?? invalidatedAccountSubject;
314
+ clearCurrentAccount();
315
+ void controller.restore({ wallet, account: null });
316
+ });
317
+ unsubscribeProof = proofStore.subscribe((event) => {
318
+ if (disposed) return;
319
+ const active = getActiveWallet();
320
+ if (!active) return;
321
+ if (event.handle !== null && event.handle !== active.handle) return;
322
+ scheduleProofExpiry();
323
+ const wallet = walletCandidate(active, proofStore);
324
+ if (accountLoading) {
325
+ keepAccountLoadingLocked(wallet);
326
+ return;
327
+ }
328
+ void controller.setWallet(wallet);
329
+ });
330
+ scheduleProofExpiry();
331
+ };
332
+ const restore = (accountAccessToken) => {
333
+ start();
334
+ accountLoading = false;
335
+ invalidatedAccountSubject = null;
336
+ allowedAccountAccessToken = null;
337
+ if (accountAccessToken) setCurrentAccount(accountAccessToken);
338
+ else clearCurrentAccount();
339
+ return controller.restore({
340
+ wallet: currentWallet(),
341
+ account: currentAccount
342
+ });
343
+ };
344
+ const setAccountSession = (accountAccessToken) => {
345
+ start();
346
+ const wasAccountLoading = accountLoading;
347
+ accountLoading = false;
348
+ if (accountAccessToken) {
349
+ if (accountAccessToken === currentAccountAccessToken && !wasAccountLoading) {
350
+ return pendingAccountSettlement?.accessToken === accountAccessToken ? pendingAccountSettlement.promise : Promise.resolve(controller.getSnapshot());
351
+ }
352
+ const nextSubject = canonicalAccountSubject(accountAccessToken);
353
+ const allowed = accountAccessToken === allowedAccountAccessToken;
354
+ if (nextSubject === null || !allowed && invalidatedAccountSubject !== null && nextSubject === invalidatedAccountSubject) {
355
+ clearCurrentAccount();
356
+ return controller.setAccount(null);
357
+ }
358
+ allowedAccountAccessToken = null;
359
+ invalidatedAccountSubject = null;
360
+ setCurrentAccount(accountAccessToken);
361
+ } else {
362
+ allowedAccountAccessToken = null;
363
+ clearCurrentAccount();
364
+ }
365
+ const settlement = controller.setAccount(currentAccount);
366
+ if (accountAccessToken) {
367
+ const tracked = { accessToken: accountAccessToken, promise: settlement };
368
+ pendingAccountSettlement = tracked;
369
+ const clearTrackedSettlement = () => {
370
+ if (pendingAccountSettlement === tracked) {
371
+ pendingAccountSettlement = null;
372
+ }
373
+ };
374
+ void settlement.then(clearTrackedSettlement, clearTrackedSettlement);
375
+ } else {
376
+ pendingAccountSettlement = null;
377
+ }
378
+ return settlement;
379
+ };
380
+ return Object.freeze({
381
+ getSnapshot: () => controller.getSnapshot(),
382
+ subscribe: (listener) => controller.subscribe(listener),
383
+ restore,
384
+ setAccountSession,
385
+ setAccountLoading: () => {
386
+ start();
387
+ accountLoading = true;
388
+ controller.beginRestore();
389
+ },
390
+ allowAccountSession: (accountAccessToken) => {
391
+ if (canonicalAccountSubject(accountAccessToken) === null) {
392
+ throw new ConnectError("invalid_account_access_token");
393
+ }
394
+ allowedAccountAccessToken = accountAccessToken;
395
+ },
396
+ retry: () => {
397
+ start();
398
+ return controller.retry();
399
+ },
400
+ dispose: () => {
401
+ if (disposed) return;
402
+ disposed = true;
403
+ clearProofExpiryTimer();
404
+ unsubscribeWallet?.();
405
+ unsubscribeProof?.();
406
+ controller.dispose();
407
+ }
408
+ });
409
+ }
410
+
411
+ // src/identityTransition.ts
412
+ function restoreWallet(previousWallet) {
413
+ if (previousWallet) {
414
+ return setActiveWallet(previousWallet);
415
+ }
416
+ return getActiveWallet() === null || disconnectActiveWallet();
417
+ }
418
+ async function connectDexterIdentity(config, onPhase) {
419
+ const {
420
+ installAccountSession,
421
+ bindingFetch,
422
+ ...passkeyConfig
423
+ } = config;
424
+ const previousWallet = getActiveWallet();
425
+ const result = await passkeyLogin(
426
+ { ...passkeyConfig, walletStore: "provisional" },
427
+ onPhase
428
+ );
429
+ const bindingClient = createWalletAccountBindingClient({
430
+ ...passkeyConfig.apiBase ? { apiBase: passkeyConfig.apiBase } : {},
431
+ ...bindingFetch ? { fetch: bindingFetch } : {}
432
+ });
433
+ const resolution = await bindingClient.resolve({
434
+ wallet: walletBindingCandidate(result.walletIdentityProof.token, {
435
+ userHandle: result.vault.userHandle,
436
+ vaultPda: result.vault.vaultPda
437
+ }),
438
+ account: accountBindingCandidate(result.session.accessToken)
439
+ });
440
+ if (!resolution.ok) {
441
+ throw new ConnectError(
442
+ resolution.reason === "expired" ? `identity_${resolution.subject}_expired` : resolution.reason === "offline" ? "identity_binding_offline" : resolution.code
443
+ );
444
+ }
445
+ if (resolution.relation !== "bound") {
446
+ throw new ConnectError("identity_binding_conflict");
447
+ }
448
+ if (!activateConnectVault(result.vault, result.walletIdentityProof)) {
449
+ throw new ConnectError("wallet_activation_failed");
450
+ }
451
+ try {
452
+ await installAccountSession(result.session);
453
+ } catch (cause) {
454
+ if (!restoreWallet(previousWallet)) {
455
+ throw new ConnectError(
456
+ "identity_rollback_failed",
457
+ "The previous Wallet could not be restored after account installation failed."
458
+ );
459
+ }
460
+ if (cause instanceof ConnectError) throw cause;
461
+ throw new ConnectError(
462
+ "account_session_install_failed",
463
+ cause instanceof Error ? cause.message : String(cause)
464
+ );
465
+ }
466
+ return result;
467
+ }
468
+ async function disconnectDexterIdentity(config) {
469
+ const previousWallet = getActiveWallet();
470
+ if (previousWallet && !disconnectActiveWallet()) {
471
+ throw new ConnectError("identity_wallet_disconnect_failed");
472
+ }
473
+ try {
474
+ await config.clearAccountSession();
475
+ } catch (cause) {
476
+ if (!restoreWallet(previousWallet)) {
477
+ throw new ConnectError(
478
+ "identity_rollback_failed",
479
+ "The previous Wallet could not be restored after account sign-out failed."
480
+ );
481
+ }
482
+ throw new ConnectError(
483
+ "account_session_clear_failed",
484
+ cause instanceof Error ? cause.message : String(cause)
485
+ );
486
+ }
487
+ return true;
488
+ }
489
+
490
+ // src/connectionContract.ts
491
+ var CAPABILITIES = Object.freeze({
492
+ identity: Object.freeze(["identity"]),
493
+ wallet: Object.freeze(["identity", "wallet.read", "wallet.use"]),
494
+ agent: Object.freeze(["identity", "wallet.read", "agent.authority"])
495
+ });
496
+ function stageFor(relation, intent) {
497
+ if (relation.runtime.phase === "hydrating" || relation.runtime.phase === "checking") {
498
+ return "checking";
499
+ }
500
+ if (relation.runtime.phase === "offline") return "offline";
501
+ if (relation.runtime.phase === "error") return "error";
502
+ if (relation.runtime.phase === "expired" || relation.relation === "conflict") {
503
+ return "repair";
504
+ }
505
+ if (relation.relation === "none") return "connect";
506
+ if (relation.relation === "bound") return "ready";
507
+ if (relation.relation === "wallet_only" && intent === "wallet") return "ready";
508
+ return "repair";
509
+ }
510
+ function primaryActionFor(stage) {
511
+ if (stage === "connect") return "connect";
512
+ if (stage === "ready") return "use_another_wallet";
513
+ if (stage === "repair") return "repair";
514
+ return "retry";
515
+ }
516
+ function createDexterControlModel(intent, relation) {
517
+ const stage = stageFor(relation, intent);
518
+ const ready = relation.runtime.phase === "ready";
519
+ const bound = ready && relation.relation === "bound" && relation.privateAccountAccess;
520
+ const ownerWalletReady = intent === "wallet" && ready && relation.walletPresent && (relation.relation === "wallet_only" || bound);
521
+ return Object.freeze({
522
+ intent,
523
+ stage,
524
+ primaryAction: primaryActionFor(stage),
525
+ permissions: Object.freeze({
526
+ capabilities: CAPABILITIES[intent],
527
+ walletIdentityVisible: ready && relation.walletPresent && relation.relation !== "conflict",
528
+ walletDataVisible: ownerWalletReady || bound && intent === "agent",
529
+ ownerWalletUseEnabled: ownerWalletReady,
530
+ accountContentVisible: bound,
531
+ agentAuthorityVisible: bound && intent === "agent"
532
+ })
533
+ });
534
+ }
535
+
536
+ // src/phase.ts
537
+ var PHASE_LABEL = {
538
+ challenge: "Preparing\u2026",
539
+ passkey: "Waiting for your passkey\u2026",
540
+ verifying: "Verifying\u2026",
541
+ finalizing: "Finishing\u2026"
542
+ };
543
+ function ceremonyPhaseLabel(phase) {
544
+ return PHASE_LABEL[phase];
545
+ }
546
+
547
+ // src/signals.ts
548
+ function pkc() {
549
+ if (typeof window === "undefined") return null;
550
+ const g = globalThis.PublicKeyCredential;
551
+ return g ?? null;
552
+ }
553
+ function defaultRpId() {
554
+ return typeof window !== "undefined" ? window.location.hostname : "";
555
+ }
556
+ function passkeySignalSupport() {
557
+ const p = pkc();
558
+ return {
559
+ rename: typeof p?.signalCurrentUserDetails === "function",
560
+ prune: typeof p?.signalUnknownCredential === "function",
561
+ syncAccepted: typeof p?.signalAllAcceptedCredentials === "function"
562
+ };
563
+ }
564
+ async function renamePasskey(args) {
565
+ const p = pkc();
566
+ if (typeof p?.signalCurrentUserDetails !== "function") return false;
567
+ try {
568
+ await p.signalCurrentUserDetails({
569
+ rpId: args.rpId ?? defaultRpId(),
570
+ userId: args.userId,
571
+ name: args.name,
572
+ displayName: args.displayName ?? args.name
573
+ });
574
+ return true;
575
+ } catch {
576
+ return false;
577
+ }
578
+ }
579
+ async function prunePasskey(args) {
580
+ const p = pkc();
581
+ if (typeof p?.signalUnknownCredential !== "function") return false;
582
+ try {
583
+ await p.signalUnknownCredential({
584
+ rpId: args.rpId ?? defaultRpId(),
585
+ credentialId: args.credentialId
586
+ });
587
+ return true;
588
+ } catch {
589
+ return false;
590
+ }
591
+ }
592
+ async function syncAcceptedPasskeys(args) {
593
+ const p = pkc();
594
+ if (typeof p?.signalAllAcceptedCredentials !== "function") return false;
595
+ try {
596
+ await p.signalAllAcceptedCredentials({
597
+ rpId: args.rpId ?? defaultRpId(),
598
+ userId: args.userId,
599
+ allAcceptedCredentialIds: args.acceptedCredentialIds
600
+ });
601
+ return true;
602
+ } catch {
603
+ return false;
604
+ }
605
+ }
606
+
607
+ export {
608
+ WalletAccountRelationController,
609
+ createDexterIdentityCoordinator,
610
+ connectDexterIdentity,
611
+ disconnectDexterIdentity,
612
+ createDexterControlModel,
613
+ ceremonyPhaseLabel,
614
+ passkeySignalSupport,
615
+ renamePasskey,
616
+ prunePasskey,
617
+ syncAcceptedPasskeys
618
+ };