import crypto from 'node:crypto'; import { buildRefreshProofMessage } from '@xopcai/gateway-contract'; import type { GatewayScope } from '../../gateway/security/gateway-scopes.js'; export type DevicePlatform = import('@xopcai/gateway-contract').DevicePlatform; export type DevicePublicKeyJwk = crypto.webcrypto.JsonWebKey; export type DeviceRecord = { id: string; displayName: string; platform: DevicePlatform; extensionId?: string; publicKeyJwk: DevicePublicKeyJwk; requestProofVersion: number; scopes: GatewayScope[]; createdAt: number; lastSeenAt?: number; revokedAt?: number; }; export type DeviceAccessIdentity = { deviceId: string; accessSessionId: string; scopes: GatewayScope[]; }; export type DeviceTokenPair = { accessToken: string; accessTokenExpiresAt: number; refreshToken: string; refreshTokenExpiresAt: number; }; export declare function createDevice(input: { id?: string; displayName: string; platform: DevicePlatform; publicKeyJwk: DevicePublicKeyJwk; extensionId?: string; scopes: readonly GatewayScope[]; now?: number; }): DeviceRecord; export declare function getDevice(deviceId: string): DeviceRecord | undefined; export declare function listDevices(): DeviceRecord[]; export declare function issueDeviceTokenPair(deviceId: string, now?: number): DeviceTokenPair; /** Registers a phone-generated bootstrap credential without persisting its secret. */ export declare function registerInitialDeviceRefreshToken(deviceId: string, token: string, now?: number): number; export declare function authenticateDeviceAccessToken(token: string, now?: number): DeviceAccessIdentity | undefined; export { buildRefreshProofMessage }; export declare class DeviceRefreshRateLimitError extends Error { readonly retryAfterMs: number; constructor(retryAfterMs: number); } export declare function rotateDeviceRefreshToken(input: { refreshToken: string; timestamp: number; nonce: string; requestId: string; nextRefreshToken: string; signature: string; requestProofVersion: 1; now?: number; }): DeviceTokenPair; export declare function revokeDevice(deviceId: string, now?: number): boolean; /** Checks a live transport without retaining its bearer token. */ export declare function isDeviceAccessSessionActive(deviceId: string, sessionId: string, now?: number): boolean; export declare function getDesktopStateObservation(deviceId: string): { deviceId: string; stateEnabled: boolean; revision: number; } | undefined; export declare function getDesktopScreenObservation(deviceId: string): { deviceId: string; screenEnabled: boolean; revision: number; } | undefined; export declare function setDesktopStateObservation(deviceId: string, enabled: boolean, expectedRevision?: number): ReturnType; export declare function setDesktopScreenObservation(deviceId: string, enabled: boolean, expectedRevision?: number): ReturnType;