@thescaffold/chat-core
v0.2.0
Published
Framework-agnostic chat engine, wire protocol, and adapter interfaces for X Chat
Readme
@thescaffold/chat-core
The framework-agnostic heart of X Chat. Ships:
protocol/— the versionedchat.v1wire protocol: envelope, opcodes, client/server frames, and Zod schemas that validate every frame at the boundary.ids/— Snowflake-style 64-bit IDs (Crockford base32) and opaque pagination cursors.content/— theContentPartunion (text, markdown, image, video, audio, file) and per-type guards.adapters/— the interfaces the server is built against (AuthAdapter,MessageStore,RoomStore,UserStore,PresenceAdapter,PubSubAdapter,StorageAdapter). No implementations live here — those are in@thescaffold/chat-addons.registry/— theContentRegistryextension point for custom content parts.client/— the browser/NodeChatClient: connection + reconnect, optimistic outbox, ordered inbox with gap repair.errors/— the typedChatErrorsurface.
No DOM dependency in the protocol/contract layers. zod is the only runtime
dependency; ws is an optional peer for Node clients.
