@ceralive/cerastream 2026.6.0-rc.1 → 2026.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,41 +1,30 @@
1
- # @ceralive/cerastream (TypeScript bindings)
1
+ # @ceralive/cerastream
2
2
 
3
- Type-safe control-IPC **schema + client surface** for the cerastream Rust
4
- streaming engine. This package is the **public contract** (ADR-0002 Decision 13):
5
- a CI-published npm package — **not** a sibling `link:` dep — consumable by Bun with
6
- zero native dependencies.
3
+ Type-safe control-IPC **schema + client** for the cerastream streaming engine.
4
+ A zero-native-dependency package — the published contract for driving the
5
+ engine's JSON-RPC 2.0 / NDJSON control plane over a Unix domain socket.
7
6
 
8
7
  - JSON-RPC 2.0 envelope + `hello` handshake schemas
9
- - The eight v1 control methods (params + result Zod schemas + inferred types)
8
+ - The eight v1 control methods (Zod params + result schemas + inferred types)
10
9
  - The seven server-push event payloads (discriminated union)
11
- - Two-tier error codes (Tier 1 RPC + Tier 2 runtime, 1:1 with CeraUI)
10
+ - Two-tier error codes (RPC + runtime)
12
11
  - A unified engine config schema (= `start` params)
13
- - A `CerastreamClient` interface + `connect()` factory (Bun-native UDS transport)
12
+ - A `CerastreamClient` interface + `connect()` factory (UDS transport)
14
13
 
15
- > **Schema + client.** The Zod schemas, types, and constants are the **frozen**
16
- > wire contract; `connect()` drives that contract over a Bun-native NDJSON/UDS
17
- > transport (no native deps). The schema shape is unchanged from the v0.1.0-stub
18
- > freeze — this release adds the runtime client behind it (plan Task 31).
14
+ The Zod schemas, types, and constants are the frozen wire contract; `connect()`
15
+ drives that contract over an NDJSON/UDS transport with no native dependencies.
19
16
 
20
- See [`API.md`](./API.md) for the full exported surface, ADR-0002
21
- ([`../../docs/adr/ADR-0002-control-ipc.md`](../../docs/adr/ADR-0002-control-ipc.md))
22
- for the protocol decision, and `schema.md`
23
- ([`../../docs/adr/schema.md`](../../docs/adr/schema.md)) for the v1 message
24
- inventory.
25
-
26
- ## Install / develop
17
+ ## Install
27
18
 
28
19
  ```bash
29
- bun install
30
- bun run typecheck # tsc --noEmit
31
- bun test # schema round-trip + stub-honesty + count + skew guards
32
- bun run build # emit dist/
20
+ npm i @ceralive/cerastream
21
+ # or
22
+ bun add @ceralive/cerastream
33
23
  ```
34
24
 
35
- ## Usage (schema today, client after Task 31)
25
+ ## Usage
36
26
 
37
- The schemas are usable now — validate any control message on either side of the
38
- wire:
27
+ The schemas validate any control message on either side of the wire:
39
28
 
40
29
  ```ts
41
30
  import { startParamsSchema, eventParamsSchema } from "@ceralive/cerastream";
@@ -71,18 +60,21 @@ await client.switchInput({ input_id: "video0" });
71
60
  await client.stop();
72
61
 
73
62
  sub.close();
74
- await client.close(); // closes the connection; never respawns the engine (ADR-0005)
63
+ await client.close(); // closes the connection; never spawns the engine
75
64
  ```
76
65
 
77
- `connect()` honors `socketPath` (default: the resolved `/run/cerastream/control.sock`),
78
- `requestTimeoutMs`, and `autoReconnect` (capped backoff + re-handshake + re-subscribe).
79
- The engine is a systemd-owned service — the client connects, it never spawns it.
66
+ `connect()` honours `socketPath`, `requestTimeoutMs`, and `autoReconnect`
67
+ (capped backoff + re-handshake + re-subscribe). The engine runs as a
68
+ systemd-owned service — the client connects to it and never spawns it.
69
+
70
+ ## Versioning
71
+
72
+ Two independent version axes. The **wire-schema version** (`PROTOCOL_VERSION` +
73
+ `SCHEMA_VERSION`) is pinned cross-language with the engine and is additive-only
74
+ within `cerastream-ipc/1`. The **npm package version** is CalVer
75
+ (`YYYY.MINOR.PATCH`) with SemVer intent applied to the exported TypeScript
76
+ surface; release candidates use `-rc.N` (npm `next` dist-tag).
80
77
 
81
- ## Versioning — SemVer on top of CalVer
78
+ ## License
82
79
 
83
- Two version axes, kept separate: the **wire-schema version** (`PROTOCOL_VERSION` +
84
- `SCHEMA_VERSION`) is pinned cross-language with the Rust engine and is additive-only
85
- within `cerastream-ipc/1`; the **npm package version** (`package.json`) is CalVer
86
- (`YYYY.MINOR.PATCH`) for the library release line, with SemVer intent applied to the
87
- exported TypeScript surface. Release candidates use `-rc.N` (npm `next` dist-tag).
88
- Full policy + the tag-driven publish pipeline: [`CHANGELOG.md`](./CHANGELOG.md).
80
+ GPL-3.0
package/dist/events.d.ts CHANGED
@@ -42,6 +42,7 @@ export declare const deviceEventSchema: z.ZodObject<{
42
42
  width: z.ZodOptional<z.ZodNumber>;
43
43
  height: z.ZodOptional<z.ZodNumber>;
44
44
  framerate: z.ZodOptional<z.ZodString>;
45
+ media_type: z.ZodOptional<z.ZodString>;
45
46
  }, z.core.$strip>>>;
46
47
  }, z.core.$strip>;
47
48
  }, z.core.$strip>;
@@ -127,6 +128,7 @@ export declare const eventParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
127
128
  width: z.ZodOptional<z.ZodNumber>;
128
129
  height: z.ZodOptional<z.ZodNumber>;
129
130
  framerate: z.ZodOptional<z.ZodString>;
131
+ media_type: z.ZodOptional<z.ZodString>;
130
132
  }, z.core.$strip>>>;
131
133
  }, z.core.$strip>;
132
134
  }, z.core.$strip>, z.ZodObject<{
@@ -207,6 +209,7 @@ export declare const cerastreamEventSchema: z.ZodObject<{
207
209
  width: z.ZodOptional<z.ZodNumber>;
208
210
  height: z.ZodOptional<z.ZodNumber>;
209
211
  framerate: z.ZodOptional<z.ZodString>;
212
+ media_type: z.ZodOptional<z.ZodString>;
210
213
  }, z.core.$strip>>>;
211
214
  }, z.core.$strip>;
212
215
  }, z.core.$strip>, z.ZodObject<{
@@ -291,6 +294,7 @@ export declare const eventSchemas: {
291
294
  width: z.ZodOptional<z.ZodNumber>;
292
295
  height: z.ZodOptional<z.ZodNumber>;
293
296
  framerate: z.ZodOptional<z.ZodString>;
297
+ media_type: z.ZodOptional<z.ZodString>;
294
298
  }, z.core.$strip>>>;
295
299
  }, z.core.$strip>;
296
300
  }, z.core.$strip>;
@@ -121,6 +121,7 @@ export declare const listDevicesResultSchema: z.ZodObject<{
121
121
  width: z.ZodOptional<z.ZodNumber>;
122
122
  height: z.ZodOptional<z.ZodNumber>;
123
123
  framerate: z.ZodOptional<z.ZodString>;
124
+ media_type: z.ZodOptional<z.ZodString>;
124
125
  }, z.core.$strip>>>;
125
126
  }, z.core.$strip>>;
126
127
  }, z.core.$strip>;
@@ -190,6 +191,60 @@ export declare const previewSessionResultSchema: z.ZodObject<{
190
191
  }, z.core.$strip>], "kind">;
191
192
  }, z.core.$strip>;
192
193
  export type PreviewSessionResult = z.infer<typeof previewSessionResultSchema>;
194
+ export declare const videoSourceCapSchema: z.ZodObject<{
195
+ id: z.ZodString;
196
+ supports_audio: z.ZodBoolean;
197
+ supports_resolution_override: z.ZodBoolean;
198
+ supports_framerate_override: z.ZodBoolean;
199
+ default_resolution: z.ZodString;
200
+ default_framerate: z.ZodNumber;
201
+ }, z.core.$strip>;
202
+ export type VideoSourceCap = z.infer<typeof videoSourceCapSchema>;
203
+ export declare const bitrateRangeCapsSchema: z.ZodObject<{
204
+ min: z.ZodNumber;
205
+ max: z.ZodNumber;
206
+ unit: z.ZodString;
207
+ }, z.core.$strip>;
208
+ export type BitrateRangeCaps = z.infer<typeof bitrateRangeCapsSchema>;
209
+ export declare const encoderCapsSchema: z.ZodObject<{
210
+ codecs: z.ZodArray<z.ZodString>;
211
+ bitrate_range: z.ZodObject<{
212
+ min: z.ZodNumber;
213
+ max: z.ZodNumber;
214
+ unit: z.ZodString;
215
+ }, z.core.$strip>;
216
+ }, z.core.$strip>;
217
+ export type EncoderCaps = z.infer<typeof encoderCapsSchema>;
218
+ export declare const platformCapsSchema: z.ZodObject<{
219
+ supports_h265: z.ZodBoolean;
220
+ hardware_accelerated: z.ZodBoolean;
221
+ max_resolution: z.ZodString;
222
+ }, z.core.$strip>;
223
+ export type PlatformCaps = z.infer<typeof platformCapsSchema>;
224
+ export declare const getCapabilitiesResultSchema: z.ZodObject<{
225
+ platform: z.ZodObject<{
226
+ supports_h265: z.ZodBoolean;
227
+ hardware_accelerated: z.ZodBoolean;
228
+ max_resolution: z.ZodString;
229
+ }, z.core.$strip>;
230
+ encoder: z.ZodObject<{
231
+ codecs: z.ZodArray<z.ZodString>;
232
+ bitrate_range: z.ZodObject<{
233
+ min: z.ZodNumber;
234
+ max: z.ZodNumber;
235
+ unit: z.ZodString;
236
+ }, z.core.$strip>;
237
+ }, z.core.$strip>;
238
+ sources: z.ZodArray<z.ZodObject<{
239
+ id: z.ZodString;
240
+ supports_audio: z.ZodBoolean;
241
+ supports_resolution_override: z.ZodBoolean;
242
+ supports_framerate_override: z.ZodBoolean;
243
+ default_resolution: z.ZodString;
244
+ default_framerate: z.ZodNumber;
245
+ }, z.core.$strip>>;
246
+ }, z.core.$strip>;
247
+ export type GetCapabilitiesResult = z.infer<typeof getCapabilitiesResultSchema>;
193
248
  /** The eight v1 control methods (the literal JSON-RPC `method` strings). */
194
249
  export declare const V1_METHODS: readonly ["start", "stop", "reload-config", "set-bitrate", "switch-input", "list-devices", "subscribe-events", "preview-session"];
195
250
  export type V1Method = (typeof V1_METHODS)[number];
@@ -332,6 +387,7 @@ export declare const requestSchemas: {
332
387
  width: z.ZodOptional<z.ZodNumber>;
333
388
  height: z.ZodOptional<z.ZodNumber>;
334
389
  framerate: z.ZodOptional<z.ZodString>;
390
+ media_type: z.ZodOptional<z.ZodString>;
335
391
  }, z.core.$strip>>>;
336
392
  }, z.core.$strip>>;
337
393
  }, z.core.$strip>;
package/dist/messages.js CHANGED
@@ -104,6 +104,36 @@ export const previewSessionResultSchema = z.object({
104
104
  z.object({ kind: z.literal("webrtc"), sdp: z.string().optional() }),
105
105
  ]),
106
106
  });
107
+ // ---- 9. get-capabilities ----
108
+ // Deliberately absent from V1_METHODS / requestSchemas: it is an additive
109
+ // standalone schema, so the frozen eight-method contract-count stays eight.
110
+ export const videoSourceCapSchema = z.object({
111
+ id: z.string(),
112
+ supports_audio: z.boolean(),
113
+ supports_resolution_override: z.boolean(),
114
+ supports_framerate_override: z.boolean(),
115
+ default_resolution: z.string(),
116
+ default_framerate: z.number().int(),
117
+ });
118
+ export const bitrateRangeCapsSchema = z.object({
119
+ min: z.number().int(),
120
+ max: z.number().int(),
121
+ unit: z.string(), // "bps" or "kbps"
122
+ });
123
+ export const encoderCapsSchema = z.object({
124
+ codecs: z.array(z.string()),
125
+ bitrate_range: bitrateRangeCapsSchema,
126
+ });
127
+ export const platformCapsSchema = z.object({
128
+ supports_h265: z.boolean(),
129
+ hardware_accelerated: z.boolean(),
130
+ max_resolution: z.string(),
131
+ });
132
+ export const getCapabilitiesResultSchema = z.object({
133
+ platform: platformCapsSchema,
134
+ encoder: encoderCapsSchema,
135
+ sources: z.array(videoSourceCapSchema),
136
+ });
107
137
  // ---- method registry (count-assertion source of truth) ----
108
138
  /** The eight v1 control methods (the literal JSON-RPC `method` strings). */
109
139
  export const V1_METHODS = [
package/dist/types.d.ts CHANGED
@@ -85,6 +85,7 @@ export declare const captureCapSchema: z.ZodObject<{
85
85
  width: z.ZodOptional<z.ZodNumber>;
86
86
  height: z.ZodOptional<z.ZodNumber>;
87
87
  framerate: z.ZodOptional<z.ZodString>;
88
+ media_type: z.ZodOptional<z.ZodString>;
88
89
  }, z.core.$strip>;
89
90
  export type CaptureCap = z.infer<typeof captureCapSchema>;
90
91
  export declare const captureDeviceSchema: z.ZodObject<{
@@ -99,6 +100,7 @@ export declare const captureDeviceSchema: z.ZodObject<{
99
100
  width: z.ZodOptional<z.ZodNumber>;
100
101
  height: z.ZodOptional<z.ZodNumber>;
101
102
  framerate: z.ZodOptional<z.ZodString>;
103
+ media_type: z.ZodOptional<z.ZodString>;
102
104
  }, z.core.$strip>>>;
103
105
  }, z.core.$strip>;
104
106
  export type CaptureDevice = z.infer<typeof captureDeviceSchema>;
package/dist/types.js CHANGED
@@ -53,6 +53,7 @@ export const captureCapSchema = z.object({
53
53
  width: z.number().int().optional(),
54
54
  height: z.number().int().optional(),
55
55
  framerate: z.string().optional(), // e.g. "30/1"
56
+ media_type: z.string().optional(), // e.g. "video/x-h265"; additive, absent on legacy producers
56
57
  });
57
58
  export const captureDeviceSchema = z.object({
58
59
  input_id: z.string(), // stable id used by switch-input
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ceralive/cerastream",
3
- "version": "2026.6.0-rc.1",
4
- "description": "Type-safe TypeScript bindings + IPC client for the cerastream Rust streaming engine (JSON-RPC 2.0 / NDJSON over UDS). See ADR-0002.",
3
+ "version": "2026.6.1",
4
+ "description": "Type-safe TypeScript schema + IPC client for the cerastream streaming engine (JSON-RPC 2.0 / NDJSON over a Unix domain socket).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",