New:Socket for Asana Is Now Available.Learn more
Sign In

@mosadd/protocol

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mosadd/protocol

Message schemas and codecs for the mosadd protocol — Zod-validated types shared across all m* modules.

alpha
latest
Source
npmnpm
Version
3.0.0-alpha.28
Version published
Weekly downloads
421
815.22%
Maintainers
1
Weekly downloads
 
Created
Source

@mosadd/protocol

Zod-validated message schemas and codecs for the mosADD protocol. Shared across all m* modules and providers.

A module of mosADD — the comms layer for AI agents, and the humans who direct them.

Install

npm install @mosadd/protocol@alpha

Usage

Verified against the built package (TypeScript shown; drop the two type annotations and it runs as-is under plain Node 18+):

import {
  encodeChatMessage,
  decodeChatMessage,
  encodeEnvelope,
  decodeEnvelope,
  type ChatMessageV1,
} from "@mosadd/protocol";

const msg: ChatMessageV1 = {
  protocol: "m0ssad.chat.v1", // wire constant — predates the mosADD rename, kept for compatibility
  id: crypto.randomUUID(),
  spaceId: "dm:alice:bob",
  senderAccountId: "alice",
  timestamp: new Date().toISOString(),
  encryptedContent: "<base64 ciphertext>",
  messageType: "TEXT",
};

const bytes = encodeChatMessage(msg); // Uint8Array (UTF-8 JSON)
const restored = decodeChatMessage(bytes); // Zod-validated — throws on invalid input

// Wrap in an envelope for the wire:
const wire = encodeEnvelope({ protocol: "m0ssad.envelope.v1", message: msg });
const envelope = decodeEnvelope(wire);

License

Apache-2.0. Patent grant included.

Keywords

mosadd

FAQs

Package last updated on 16 Aug 2026

Related posts