/** * routes/pairing-handoff.ts * * The `pairing.handoff.*` verbs: one pairing exchange carries an OFFER SET * (notifications, relay, passkey step-up) so a freshly-paired surface can * complete several set-up steps in a single pass, each independently declinable. * * - pairing.handoff.create mints a per-device token and returns the offer set * that is actually available on this daemon (notifications carry the VAPID * public key; relay/passkey are advertised only when the daemon supports * them), plus the `#pair=` deep-link fragment (and a full deep link * when a web origin is configured). The token secret is returned ONCE. * - pairing.handoff.complete applies the surface's per-offer decisions in one * pass: an accepted notifications offer registers the browser push * subscription, an accepted passkey offer registers the WebAuthn credential, * an accepted relay offer is acknowledged; each returns an honest per-offer * result, and a declined/omitted offer is reported as declined, never * silently half-applied. */ import type { GatewayMethodCatalog } from '../method-catalog.js'; import type { PairingTokenManager } from '../../pairing/pairing-token-store.js'; import type { StepUpGatewayService } from './stepup.js'; import type { PushGatewayService } from './push.js'; /** What the hand-off verbs need from the surrounding composition. */ export interface PairingHandoffDeps { readonly tokens: Pick; /** The push service, VAPID key for the notifications offer + subscription registration. */ readonly push: Pick; /** WebAuthn step-up; present ⇒ the passkey offer is available. */ readonly stepUp?: StepUpGatewayService | undefined; /** Whether the rendezvous relay is available ⇒ the relay offer is available. */ readonly relayAvailable: () => boolean; /** The configured web-app origin the QR points at; absent ⇒ only a fragment is returned. */ readonly webOrigin?: (() => string | undefined) | undefined; } /** * Attach the `pairing.handoff.*` handlers to their cataloged descriptors. A * missing descriptor is a silent no-op (construction must never fail because one * verb failed to register; the operator-contract gates catch a real drift). */ export declare function registerPairingHandoffGatewayMethods(catalog: GatewayMethodCatalog, deps: PairingHandoffDeps): void; //# sourceMappingURL=pairing-handoff.d.ts.map