@ts-pf/stream
v0.1.3
Published
Opt-in StreamCodec and stream() for root AsyncIterable (JSONL)
Downloads
1,025
Maintainers
Readme
@ts-pf/stream
Opt-in StreamCodec for root AsyncIterable input and output. JSON calls stay JSON. Streams are application/jsonl — one existing RPC envelope per line.
Agent skill: skills/ts-pf-stream/. Sync with npx skills experimental_sync -y.
import { stream, StreamCodec } from '@ts-pf/stream'
import { FetchHandler } from '@ts-pf/server-http'
import { FetchLink } from '@ts-pf/client-http'
const codec = new StreamCodec()
new FetchHandler(app, { codec })
new FetchLink({ url: '/rpc', codec })
procedure.output(stream(z.object({ token: z.string() })))Wire spec: packages/protocol/PROTOCOL.md (Message streams). SSE output framing of the same envelopes is @ts-pf/sse (SseCodec); stream() is not re-exported there.
