@ceralive/cerastream 2026.9.3 → 2026.9.4

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
@@ -16,6 +16,8 @@ engine's JSON-RPC 2.0 / NDJSON control plane over a Unix domain socket.
16
16
  - A `CerastreamClient` interface + `connect()` factory (UDS transport)
17
17
  - Additive `client.getCapabilities()` discovery for platform, source, encoder, and
18
18
  local preview availability
19
+ - Per-codec encoder capability entries with format, resolution/framerate, and
20
+ explicit 4K60 qualification-gate truth
19
21
  - Additive `client.changeConfig()` — reconfigure the live session (resolution,
20
22
  framerate, codec, pipeline, source) as one transaction with typed rollback;
21
23
  composition-only changes use live layout/alpha writes and secondary rebind
package/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type HelloResult } from './envelope.js';
2
2
  import { type EventParams } from './events.js';
3
- import { type ChangeConfigParams, type ChangeConfigResult, type GetCapabilitiesResult, type ListDevicesParams, type ListDevicesResult, type PreviewSessionParams, type PreviewSessionResult, type ReloadConfigParams, type ReloadConfigResult, type SetBitrateParams, type SetBitrateResult, type StartParams, type StartResult, type StopParams, type StopResult, type SubscribeEventsParams, type SubscribeEventsResult, type SwitchInputParams, type SwitchInputResult } from './messages.js';
3
+ import { type ChangeConfigParams, type ChangeConfigResult, type GetCapabilitiesResult, type ListDevicesParams, type ListDevicesResult, type PreviewSessionParams, type PreviewSessionResult, type ReloadConfigParams, type ReloadConfigResult, type RequestKeyframeResult, type SetBitrateParams, type SetBitrateResult, type StartParams, type StartResult, type StopParams, type StopResult, type SubscribeEventsParams, type SubscribeEventsResult, type SwitchInputParams, type SwitchInputResult } from './messages.js';
4
4
  /** Options for {@link connect}. All optional — `connect({})` is valid. */
5
5
  export interface ConnectOptions {
6
6
  /** Control socket path override. Defaults to the resolved /run/cerastream/control.sock. */
@@ -64,6 +64,7 @@ export interface CerastreamClient {
64
64
  * @throws {CerastreamRpcError} when the value is out of the configured range.
65
65
  */
66
66
  setBitrate(params: SetBitrateParams): Promise<SetBitrateResult>;
67
+ requestKeyframe(): Promise<RequestKeyframeResult>;
67
68
  /**
68
69
  * Switch the active capture source (manual) or hand selection to failover (auto).
69
70
  * @param params The target input id and switch mode.
package/dist/client.js CHANGED
@@ -3,7 +3,7 @@ import { CONTROL_SOCKET_PATH, PROTOCOL_VERSION } from './constants.js';
3
3
  import { helloResultSchema, rpcErrorSchema, rpcResponseSchema, } from './envelope.js';
4
4
  import { CerastreamConnectionError, CerastreamRpcError, CerastreamTimeoutError, } from './errors.js';
5
5
  import { eventParamsSchema } from './events.js';
6
- import { changeConfigParamsSchema, changeConfigResultSchema, getCapabilitiesResultSchema, requestSchemas, } from './messages.js';
6
+ import { changeConfigParamsSchema, changeConfigResultSchema, getCapabilitiesResultSchema, requestKeyframeResultSchema, requestSchemas, } from './messages.js';
7
7
  import { controlSocketPath } from './paths.js';
8
8
  import { LineSocket } from './transport.js';
9
9
  const DEFAULTS = {
@@ -70,6 +70,9 @@ class ClientImpl {
70
70
  setBitrate(params) {
71
71
  return this.call('set-bitrate', params);
72
72
  }
73
+ async requestKeyframe() {
74
+ return requestKeyframeResultSchema.parse(await this.rawRequest('request-keyframe', {}));
75
+ }
73
76
  switchInput(params) {
74
77
  return this.call('switch-input', params);
75
78
  }
@@ -8,7 +8,7 @@ export declare const PROTOCOL_VERSION: 'cerastream-ipc/1';
8
8
  * additive-only within protocol major `cerastream-ipc/1` (ADR-0002 §4); this value
9
9
  * only moves when the wire schema itself does, in lockstep across both languages.
10
10
  */
11
- export declare const SCHEMA_VERSION: '0.14.0';
11
+ export declare const SCHEMA_VERSION: '0.16.0';
12
12
  /** Runtime dir holding both control + preview sockets. systemd `RuntimeDirectory=cerastream`. */
13
13
  export declare const DEFAULT_IPC_DIR: '/run/cerastream';
14
14
  /** Env override for the IPC dir (tests/dev). Defaults to {@link DEFAULT_IPC_DIR}. */
package/dist/constants.js CHANGED
@@ -11,7 +11,7 @@ export const PROTOCOL_VERSION = 'cerastream-ipc/1';
11
11
  * additive-only within protocol major `cerastream-ipc/1` (ADR-0002 §4); this value
12
12
  * only moves when the wire schema itself does, in lockstep across both languages.
13
13
  */
14
- export const SCHEMA_VERSION = '0.14.0';
14
+ export const SCHEMA_VERSION = '0.16.0';
15
15
  /** Runtime dir holding both control + preview sockets. systemd `RuntimeDirectory=cerastream`. */
16
16
  export const DEFAULT_IPC_DIR = '/run/cerastream';
17
17
  /** Env override for the IPC dir (tests/dev). Defaults to {@link DEFAULT_IPC_DIR}. */
package/dist/errors.d.ts CHANGED
@@ -97,22 +97,26 @@ export declare const processErrorCodeSchema: z.ZodEnum<{
97
97
  export type ProcessErrorCode = z.infer<typeof processErrorCodeSchema>;
98
98
  export declare const captureCauseSchema: z.ZodEnum<{
99
99
  "composition-unsupported": "composition-unsupported";
100
+ "decoder-unavailable": "decoder-unavailable";
100
101
  device_busy: "device_busy";
101
102
  negotiation_failed: "negotiation_failed";
102
103
  no_signal: "no_signal";
103
104
  no_silicon_converter: "no_silicon_converter";
104
105
  "secondary-unavailable": "secondary-unavailable";
106
+ "software-pixel-path-rejected": "software-pixel-path-rejected";
105
107
  }>;
106
108
  export type CaptureCause = z.infer<typeof captureCauseSchema>;
107
109
  export declare const captureCauseEntrySchema: z.ZodObject<{
108
110
  device: z.ZodString;
109
111
  cause: z.ZodEnum<{
110
112
  "composition-unsupported": "composition-unsupported";
113
+ "decoder-unavailable": "decoder-unavailable";
111
114
  device_busy: "device_busy";
112
115
  negotiation_failed: "negotiation_failed";
113
116
  no_signal: "no_signal";
114
117
  no_silicon_converter: "no_silicon_converter";
115
118
  "secondary-unavailable": "secondary-unavailable";
119
+ "software-pixel-path-rejected": "software-pixel-path-rejected";
116
120
  }>;
117
121
  }, z.core.$strip>;
118
122
  export type CaptureCauseEntry = z.infer<typeof captureCauseEntrySchema>;
package/dist/errors.js CHANGED
@@ -143,6 +143,8 @@ export const captureCauseSchema = z.enum([
143
143
  'no_signal',
144
144
  'device_busy',
145
145
  'no_silicon_converter',
146
+ 'decoder-unavailable',
147
+ 'software-pixel-path-rejected',
146
148
  'composition-unsupported',
147
149
  'secondary-unavailable',
148
150
  ]);
package/dist/events.d.ts CHANGED
@@ -241,11 +241,13 @@ export declare const runtimeErrorEventSchema: z.ZodObject<{
241
241
  selected: z.ZodOptional<z.ZodBoolean>;
242
242
  capture_cause: z.ZodOptional<z.ZodEnum<{
243
243
  "composition-unsupported": "composition-unsupported";
244
+ "decoder-unavailable": "decoder-unavailable";
244
245
  device_busy: "device_busy";
245
246
  negotiation_failed: "negotiation_failed";
246
247
  no_signal: "no_signal";
247
248
  no_silicon_converter: "no_silicon_converter";
248
249
  "secondary-unavailable": "secondary-unavailable";
250
+ "software-pixel-path-rejected": "software-pixel-path-rejected";
249
251
  }>>;
250
252
  }, z.core.$strip>;
251
253
  /** Payload of a {@link runtimeErrorEventSchema} event. */
@@ -467,11 +469,13 @@ export declare const eventParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
467
469
  selected: z.ZodOptional<z.ZodBoolean>;
468
470
  capture_cause: z.ZodOptional<z.ZodEnum<{
469
471
  "composition-unsupported": "composition-unsupported";
472
+ "decoder-unavailable": "decoder-unavailable";
470
473
  device_busy: "device_busy";
471
474
  negotiation_failed: "negotiation_failed";
472
475
  no_signal: "no_signal";
473
476
  no_silicon_converter: "no_silicon_converter";
474
477
  "secondary-unavailable": "secondary-unavailable";
478
+ "software-pixel-path-rejected": "software-pixel-path-rejected";
475
479
  }>>;
476
480
  }, z.core.$strip>, z.ZodObject<{
477
481
  type: z.ZodLiteral<"preview">;
@@ -667,11 +671,13 @@ export declare const cerastreamEventSchema: z.ZodObject<{
667
671
  selected: z.ZodOptional<z.ZodBoolean>;
668
672
  capture_cause: z.ZodOptional<z.ZodEnum<{
669
673
  "composition-unsupported": "composition-unsupported";
674
+ "decoder-unavailable": "decoder-unavailable";
670
675
  device_busy: "device_busy";
671
676
  negotiation_failed: "negotiation_failed";
672
677
  no_signal: "no_signal";
673
678
  no_silicon_converter: "no_silicon_converter";
674
679
  "secondary-unavailable": "secondary-unavailable";
680
+ "software-pixel-path-rejected": "software-pixel-path-rejected";
675
681
  }>>;
676
682
  }, z.core.$strip>, z.ZodObject<{
677
683
  type: z.ZodLiteral<"preview">;
@@ -876,11 +882,13 @@ export declare const eventSchemas: {
876
882
  selected: z.ZodOptional<z.ZodBoolean>;
877
883
  capture_cause: z.ZodOptional<z.ZodEnum<{
878
884
  "composition-unsupported": "composition-unsupported";
885
+ "decoder-unavailable": "decoder-unavailable";
879
886
  device_busy: "device_busy";
880
887
  negotiation_failed: "negotiation_failed";
881
888
  no_signal: "no_signal";
882
889
  no_silicon_converter: "no_silicon_converter";
883
890
  "secondary-unavailable": "secondary-unavailable";
891
+ "software-pixel-path-rejected": "software-pixel-path-rejected";
884
892
  }>>;
885
893
  }, z.core.$strip>;
886
894
  readonly preview: z.ZodObject<{
@@ -22,6 +22,7 @@ export declare const startParamsSchema: z.ZodObject<{
22
22
  }, z.core.$strip>;
23
23
  input_id: z.ZodOptional<z.ZodString>;
24
24
  codec: z.ZodOptional<z.ZodEnum<{
25
+ av1: "av1";
25
26
  h264: "h264";
26
27
  h265: "h265";
27
28
  }>>;
@@ -172,6 +173,12 @@ export declare const setBitrateResultSchema: z.ZodObject<{
172
173
  reason: z.ZodOptional<z.ZodString>;
173
174
  }, z.core.$strip>;
174
175
  export type SetBitrateResult = z.infer<typeof setBitrateResultSchema>;
176
+ export declare const requestKeyframeParamsSchema: z.ZodObject<{}, z.core.$strip>;
177
+ export type RequestKeyframeParams = z.infer<typeof requestKeyframeParamsSchema>;
178
+ export declare const requestKeyframeResultSchema: z.ZodObject<{
179
+ applied: z.ZodLiteral<true>;
180
+ }, z.core.$strip>;
181
+ export type RequestKeyframeResult = z.infer<typeof requestKeyframeResultSchema>;
175
182
  export declare const switchInputParamsSchema: z.ZodObject<{
176
183
  input_id: z.ZodString;
177
184
  mode: z.ZodDefault<z.ZodEnum<{
@@ -371,6 +378,27 @@ export declare const encoderCapsSchema: z.ZodObject<{
371
378
  }, z.core.$strip>;
372
379
  }, z.core.$strip>;
373
380
  export type EncoderCaps = z.infer<typeof encoderCapsSchema>;
381
+ export declare const encoderGateStatusSchema: z.ZodEnum<{
382
+ kept: "kept";
383
+ measured: "measured";
384
+ untested: "untested";
385
+ }>;
386
+ export type EncoderGateStatus = z.infer<typeof encoderGateStatusSchema>;
387
+ export declare const encoderCapabilitySchema: z.ZodObject<{
388
+ codec: z.ZodString;
389
+ max_resolution: z.ZodString;
390
+ max_framerate: z.ZodNumber;
391
+ formats: z.ZodArray<z.ZodString>;
392
+ gates: z.ZodObject<{
393
+ '4k60': z.ZodEnum<{
394
+ kept: "kept";
395
+ measured: "measured";
396
+ untested: "untested";
397
+ }>;
398
+ reason: z.ZodOptional<z.ZodString>;
399
+ }, z.core.$strip>;
400
+ }, z.core.$strip>;
401
+ export type EncoderCapability = z.infer<typeof encoderCapabilitySchema>;
374
402
  export declare const platformConverterSchema: z.ZodEnum<{
375
403
  librga: "librga";
376
404
  none: "none";
@@ -434,6 +462,20 @@ export declare const getCapabilitiesResultSchema: z.ZodObject<{
434
462
  unit: z.ZodString;
435
463
  }, z.core.$strip>;
436
464
  }, z.core.$strip>;
465
+ encoders: z.ZodOptional<z.ZodArray<z.ZodObject<{
466
+ codec: z.ZodString;
467
+ max_resolution: z.ZodString;
468
+ max_framerate: z.ZodNumber;
469
+ formats: z.ZodArray<z.ZodString>;
470
+ gates: z.ZodObject<{
471
+ '4k60': z.ZodEnum<{
472
+ kept: "kept";
473
+ measured: "measured";
474
+ untested: "untested";
475
+ }>;
476
+ reason: z.ZodOptional<z.ZodString>;
477
+ }, z.core.$strip>;
478
+ }, z.core.$strip>>>;
437
479
  sources: z.ZodArray<z.ZodObject<{
438
480
  id: z.ZodString;
439
481
  supports_audio: z.ZodBoolean;
@@ -469,6 +511,7 @@ export declare const getCapabilitiesResultSchema: z.ZodObject<{
469
511
  }, z.core.$strip>>;
470
512
  network_embedded_audio: z.ZodOptional<z.ZodBoolean>;
471
513
  features: z.ZodOptional<z.ZodArray<z.ZodString>>;
514
+ pixel_paths: z.ZodOptional<z.ZodLiteral<"silicon-only">>;
472
515
  }, z.core.$strip>;
473
516
  export type GetCapabilitiesResult = z.infer<typeof getCapabilitiesResultSchema>;
474
517
  export declare const changeConfigParamsSchema: z.ZodObject<{
@@ -476,6 +519,7 @@ export declare const changeConfigParamsSchema: z.ZodObject<{
476
519
  resolution: z.ZodOptional<z.ZodString>;
477
520
  framerate: z.ZodOptional<z.ZodNumber>;
478
521
  codec: z.ZodOptional<z.ZodEnum<{
522
+ av1: "av1";
479
523
  h264: "h264";
480
524
  h265: "h265";
481
525
  }>>;
@@ -573,6 +617,7 @@ export declare const requestSchemas: {
573
617
  }, z.core.$strip>;
574
618
  input_id: z.ZodOptional<z.ZodString>;
575
619
  codec: z.ZodOptional<z.ZodEnum<{
620
+ av1: "av1";
576
621
  h264: "h264";
577
622
  h265: "h265";
578
623
  }>>;
package/dist/messages.js CHANGED
@@ -72,6 +72,8 @@ export const setBitrateResultSchema = z.object({
72
72
  bitrate_control: bitrateControlSchema.optional(),
73
73
  reason: z.string().optional(),
74
74
  });
75
+ export const requestKeyframeParamsSchema = z.object({});
76
+ export const requestKeyframeResultSchema = z.object({ applied: z.literal(true) });
75
77
  // ---- 5. switch-input ----
76
78
  export const switchInputParamsSchema = z.object({
77
79
  input_id: z.string(), // device/input identifier from list-devices
@@ -172,6 +174,17 @@ export const encoderCapsSchema = z.object({
172
174
  codecs: z.array(z.string()),
173
175
  bitrate_range: bitrateRangeCapsSchema,
174
176
  });
177
+ export const encoderGateStatusSchema = z.enum(['measured', 'kept', 'untested']);
178
+ export const encoderCapabilitySchema = z.object({
179
+ codec: z.string(),
180
+ max_resolution: z.string(),
181
+ max_framerate: z.number().int().positive(),
182
+ formats: z.array(z.string()),
183
+ gates: z.object({
184
+ '4k60': encoderGateStatusSchema,
185
+ reason: z.string().optional(),
186
+ }),
187
+ });
175
188
  export const platformConverterSchema = z.enum(['librga', 'v4l2-rga2', 'none']);
176
189
  export const platformCapsSchema = z.object({
177
190
  supports_h265: z.boolean(),
@@ -202,6 +215,7 @@ export const previewAvailabilitySchema = z.object({
202
215
  export const getCapabilitiesResultSchema = z.object({
203
216
  platform: platformCapsSchema,
204
217
  encoder: encoderCapsSchema,
218
+ encoders: z.array(encoderCapabilitySchema).optional(),
205
219
  sources: z.array(videoSourceCapSchema),
206
220
  audio_live_switch: z.boolean().optional(),
207
221
  audio_backends: z
@@ -217,6 +231,7 @@ export const getCapabilitiesResultSchema = z.object({
217
231
  preview: previewAvailabilitySchema.optional(), // preview-server availability (unbound vs down)
218
232
  network_embedded_audio: z.boolean().optional(), // engine routes network-ingest embedded audio to the mux
219
233
  features: z.array(z.string()).optional(), // named engine features (e.g. "video-passthrough") for fail-closed negotiation
234
+ pixel_paths: z.literal('silicon-only').optional(),
220
235
  });
221
236
  // ---- 10. change-config (0.10.0, additive) ----
222
237
  // Deliberately absent from V1_METHODS / requestSchemas, like get-capabilities and
package/dist/types.d.ts CHANGED
@@ -40,6 +40,7 @@ export declare const previewEncodeFallbackSchema: z.ZodDiscriminatedUnion<[z.Zod
40
40
  }, z.core.$strip>], "code">;
41
41
  export type PreviewEncodeFallback = z.infer<typeof previewEncodeFallbackSchema>;
42
42
  export declare const videoCodecSchema: z.ZodEnum<{
43
+ av1: "av1";
43
44
  h264: "h264";
44
45
  h265: "h265";
45
46
  }>;
@@ -189,6 +190,7 @@ export declare const cerastreamConfigSchema: z.ZodObject<{
189
190
  }, z.core.$strip>;
190
191
  input_id: z.ZodOptional<z.ZodString>;
191
192
  codec: z.ZodOptional<z.ZodEnum<{
193
+ av1: "av1";
192
194
  h264: "h264";
193
195
  h265: "h265";
194
196
  }>>;
package/dist/types.js CHANGED
@@ -28,7 +28,7 @@ export const previewEncodeFallbackSchema = z.discriminatedUnion('code', [
28
28
  // Requested egress video codec (0.4.0, additive). Absent ⇒ the engine picks its
29
29
  // platform default. Wire values are the codec id strings the encoder caps also
30
30
  // advertise ("h264"/"h265") — never an encoder element name.
31
- export const videoCodecSchema = z.enum(['h264', 'h265']);
31
+ export const videoCodecSchema = z.enum(['h264', 'h265', 'av1']);
32
32
  // Same-codec passthrough policy (0.5.0, additive). Absent ⇒ "auto". "auto" =
33
33
  // passthrough only when adaptive bitrate is inactive and eligibility holds;
34
34
  // "force" = passthrough whenever eligible (typed start failure otherwise);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ceralive/cerastream",
3
- "version": "2026.9.3",
3
+ "version": "2026.9.4",
4
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",