pulse-shared-types
Shared types, Zod schemas, and constants for the Pulse control plane.
Install
npm install pulse-shared-types
What's included
- Protocol schemas — Zod-validated message types for WebSocket communication (upstream/downstream)
- State schemas —
ServiceState, MasterStatus, AgentStatus, TaskSummary, GitStatus
- Config schemas —
ServiceConfig, GatewayConfig, CloudConfig
- RBAC — Role definitions (
owner, admin, developer, viewer) with permission checking
- Constants — Default ports, intervals, WebSocket close codes, status enums
- Errors —
PulseError class with typed error codes
Usage
import {
ServiceStateSchema,
type ServiceState,
AGENT_STATUS,
hasPermission,
} from 'pulse-shared-types'
const state = ServiceStateSchema.parse(rawData)
if (hasPermission('developer', 'directive:send')) {
}
ESM only
This package is ESM-only ("type": "module"). Requires Node.js 18+.
License
MIT