From 951290d47f349df72b40e9f31ca85def0553c379 Mon Sep 17 00:00:00 2001 From: QQ Date: Sat, 14 Nov 2026 14:58:12 +0800 Subject: [PATCH] Import packages/plugin/src/types.ts --- packages/plugin/src/types.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/plugin/src/types.ts diff --git a/packages/plugin/src/types.ts b/packages/plugin/src/types.ts new file mode 100644 index 0000000..8cb80fd --- /dev/null +++ b/packages/plugin/src/types.ts @@ -0,0 +1,20 @@ +import type { RemoteMessage } from '@dsh-remote/protocol' + +export interface AuthenticatedPeerChannel { + /** + * Attestation supplied by the Noise/control-plane integration. Implementors + * must expose this channel only after both the Noise IK transcript and the + * Server membership for this exact connection have been verified. + */ + readonly security: { + protocol: 'Noise_IK_25519_ChaChaPoly_SHA256' + connectionId: string + membershipId: string + } + readonly peerDeviceId: string + readonly peerIdentityKey: string + readonly mode?: 'LAN' | 'P2P' | 'TURN' | 'Relay' + send(message: RemoteMessage): Promise + onMessage(handler: (message: RemoteMessage) => void): () => void + close(code?: string): Promise +}