@ekkos/synk-wire
v0.1.0
Published
Shared message wire types and Zod schemas for ekkOS Synk clients and services
Readme
@ekkos/synk-wire
Shared message wire types and Zod schemas for ekkOS Synk clients and services.
This package defines the canonical wire format used between the Synk mobile/desktop app, the CLI, and the remote server. Both legacy (user/agent role) and modern session-protocol envelopes are supported.
Install
npm install @ekkos/synk-wire
# or
yarn add @ekkos/synk-wireUsage
import {
MessageContentSchema,
SessionMessageSchema,
CoreUpdateContainerSchema,
createEnvelope,
} from '@ekkos/synk-wire';
// Parse a wire update
const result = CoreUpdateContainerSchema.safeParse(payload);
// Create a session envelope
const envelope = createEnvelope('agent', { t: 'text', text: 'Hello' });Exports
Session Protocol (sessionProtocol.ts)
| Export | Description |
|--------|-------------|
| sessionEnvelopeSchema | Full envelope with role, turn, subagent, event |
| sessionEventSchema | Discriminated union of all event types |
| createEnvelope() | Helper to create validated envelopes |
| Event schemas | sessionTextEventSchema, sessionToolCallStartEventSchema, etc. |
Messages (messages.ts)
| Export | Description |
|--------|-------------|
| SessionMessageSchema | Encrypted message on the wire |
| CoreUpdateContainerSchema | Container for all update types |
| MessageContentSchema | Union of user, agent, and session messages |
| UpdateNewMessageBodySchema | New message update |
| UpdateSessionBodySchema | Session state update |
| UpdateMachineBodySchema | Machine state update |
Legacy Protocol (legacyProtocol.ts)
| Export | Description |
|--------|-------------|
| UserMessageSchema | Legacy user message format |
| AgentMessageSchema | Legacy agent message format |
| LegacyMessageContentSchema | Union of legacy message types |
Development
# Type check
yarn typecheck
# Build
yarn build
# Test
yarn testLicense
MIT
