UNPKG

@receiz/mcp-server

Version:

MCP server for agents building and verifying Receiz proof-native applications through the canonical Receiz SDK rails.

25 lines • 1.08 kB
import { readReceizIdentityPublicBinding } from "@receiz/sdk"; import { createReceizIdentityDeviceRelaySigner } from "@receiz/sdk/offline/node"; const owners = new WeakMap(); const signers = new WeakMap(); export async function bindDeviceRuntimeOwner(runtime, admission, passphrase = "") { const identity = await readReceizIdentityPublicBinding(admission); if (!identity.signatureVerified || !identity.identityOwnerReceizId) throw Error("RECEIZ_DEVICE_OWNER_REQUIRED"); const signer = await createReceizIdentityDeviceRelaySigner(admission, passphrase); signers.set(runtime, signer); owners.set(runtime, identity.identityOwnerReceizId); } export function deviceRuntimeRelaySigner(runtime) { const signer = signers.get(runtime); if (!signer) throw Error("RECEIZ_DEVICE_ADMITTED_RUNTIME_REQUIRED"); return signer; } export function deviceRuntimeOwner(runtime) { const owner = owners.get(runtime); if (!owner) throw Error("RECEIZ_DEVICE_ADMITTED_RUNTIME_REQUIRED"); return owner; } //# sourceMappingURL=deviceOwner.js.map