openvibe-sdk/node

Generated at from openvibe-contracts v0.114.0 and openvibe-sdk v0.35.1.

From types/node.d.ts (server only). Declarations are shown verbatim.

type NodeCpu

platform.node-capabilities@1: node hardware, placement regions, tags and operating costs. Validated by openvibe-contracts (required lazily by validateNodeCapabilities). nodeOffers() maps a descriptor to a platform.resource-offer@1 (kind "node") and a platform.runtime-offer@1.

export type NodeCpu = { cores: number; threads?: number };

type NodeGpu

export type NodeGpu = { model: string; count: number; vram_mb?: number };

type NodeStorage

export type NodeStorage = { capacity_gb: number; available_gb?: number; kind?: string };

type NodeNetwork

export type NodeNetwork = { ingress_mbps: number; egress_mbps: number };

type NodeCosts

export type NodeCosts = { per_hour_usd: number; egress_per_gb_usd?: number };

type NodeCapabilities

export type NodeCapabilities = { node_id: string; cpu: NodeCpu; arch: string; memory_mb: number; gpu?: NodeGpu;
    storage: NodeStorage; network: NodeNetwork; regions: string[]; tags: string[]; costs: NodeCosts;
    capabilities?: string[]; agent_version?: string; updated_at?: string };

type NodeOffersOptions

export type NodeOffersOptions = { trust?: string };

type ValidationError

export type ValidationError = { path: string; message: string };

function nodeCapabilities

Null/undefined fields are stripped.

export declare function nodeCapabilities(fields: Partial<NodeCapabilities>): NodeCapabilities;

function nodeOffers

Map a Node descriptor to { resource: resource-offer@1, runtime: runtime-offer@1 }. trust defaults to "first-party"; it is "user-owned" only when opts.trust says so.

export declare function nodeOffers(descriptor: NodeCapabilities, opts?: NodeOffersOptions): {
    resource: Record<string, unknown>; runtime: Record<string, unknown> };

function validateNodeCapabilities

export declare function validateNodeCapabilities(record: unknown): { ok: boolean; errors: ValidationError[] };