journal-gateway-protocol
v0.8.1
Published
Shared TypeScript types and Zod schemas for the Journal Gateway protocol
Maintainers
Readme
journal-gateway-protocol
Shared TypeScript types and Zod schemas for the Journal Gateway WebSocket protocol.
Most applications should install journal-gateway or
journal-gateway-client instead. Install this package directly when you
need to validate protocol messages, share gateway types across packages, or
build custom tooling around the protocol.
Install
npm install journal-gateway-protocolExports
- WebSocket message schemas for gateway-to-service and service-to-gateway messages.
- Integration types:
Integration,ToolDefinition,ToolResult, and content blocks. - Skill types for markdown skills published by gateways.
- Typed gateway errors and error codes.
- Provider interfaces used by gateway implementations.
The package has one runtime dependency: zod.
Usage
import {
GatewayMessageSchema,
ServiceMessageSchema,
type GatewayMessage,
type ToolResult,
} from "journal-gateway-protocol";
export function parseGatewayMessage(raw: string): GatewayMessage {
return GatewayMessageSchema.parse(JSON.parse(raw));
}
export function readText(result: ToolResult): string[] {
return result.content
.filter((block) => block.type === "text")
.map((block) => block.text);
}
ServiceMessageSchema.parse({
type: "ping",
});Version Compatibility
Journal Gateway packages release in lockstep. Use matching versions of:
- npm
journal-gateway - npm
journal-gateway-clientfor TypeScript services - npm
journal-gateway-protocol - PyPI
journal-gateway-clientfor Python services
More Documentation
License
MIT
