@ceralive/cerastream 2026.9.0 → 2026.9.2
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 +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +6 -1
- package/dist/events.d.ts +4 -0
- package/dist/messages.d.ts +52 -0
- package/dist/messages.js +11 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ engine's JSON-RPC 2.0 / NDJSON control plane over a Unix domain socket.
|
|
|
9
9
|
- The nine server-push event payloads (discriminated union)
|
|
10
10
|
- Two-tier error codes (RPC + runtime)
|
|
11
11
|
- Typed capture-probe causes retained on runtime events and rejected-start exceptions
|
|
12
|
+
- Typed platform capture-converter reporting (`librga`, `v4l2-rga2`, or `none`)
|
|
12
13
|
- A unified engine config schema (= `start` params)
|
|
13
14
|
- A `CerastreamClient` interface + `connect()` factory (UDS transport)
|
|
14
15
|
- Additive `client.getCapabilities()` discovery for platform, source, encoder, and
|
package/dist/constants.d.ts
CHANGED
|
@@ -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.
|
|
11
|
+
export declare const SCHEMA_VERSION: '0.13.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
|
+
export const SCHEMA_VERSION = '0.13.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
|
@@ -99,6 +99,7 @@ export declare const captureCauseSchema: z.ZodEnum<{
|
|
|
99
99
|
device_busy: "device_busy";
|
|
100
100
|
negotiation_failed: "negotiation_failed";
|
|
101
101
|
no_signal: "no_signal";
|
|
102
|
+
no_silicon_converter: "no_silicon_converter";
|
|
102
103
|
}>;
|
|
103
104
|
export type CaptureCause = z.infer<typeof captureCauseSchema>;
|
|
104
105
|
export declare const captureCauseEntrySchema: z.ZodObject<{
|
|
@@ -107,6 +108,7 @@ export declare const captureCauseEntrySchema: z.ZodObject<{
|
|
|
107
108
|
device_busy: "device_busy";
|
|
108
109
|
negotiation_failed: "negotiation_failed";
|
|
109
110
|
no_signal: "no_signal";
|
|
111
|
+
no_silicon_converter: "no_silicon_converter";
|
|
110
112
|
}>;
|
|
111
113
|
}, z.core.$strip>;
|
|
112
114
|
export type CaptureCauseEntry = z.infer<typeof captureCauseEntrySchema>;
|
package/dist/errors.js
CHANGED
|
@@ -138,7 +138,12 @@ export const processErrorCodeSchema = z.enum([
|
|
|
138
138
|
// would be lying. Always carries a captureUnrecoverableReasonSchema `reason`.
|
|
139
139
|
'capture_unrecoverable',
|
|
140
140
|
]);
|
|
141
|
-
export const captureCauseSchema = z.enum([
|
|
141
|
+
export const captureCauseSchema = z.enum([
|
|
142
|
+
'negotiation_failed',
|
|
143
|
+
'no_signal',
|
|
144
|
+
'device_busy',
|
|
145
|
+
'no_silicon_converter',
|
|
146
|
+
]);
|
|
142
147
|
export const captureCauseEntrySchema = z.object({
|
|
143
148
|
device: z.string(),
|
|
144
149
|
cause: captureCauseSchema,
|
package/dist/events.d.ts
CHANGED
|
@@ -243,6 +243,7 @@ export declare const runtimeErrorEventSchema: z.ZodObject<{
|
|
|
243
243
|
device_busy: "device_busy";
|
|
244
244
|
negotiation_failed: "negotiation_failed";
|
|
245
245
|
no_signal: "no_signal";
|
|
246
|
+
no_silicon_converter: "no_silicon_converter";
|
|
246
247
|
}>>;
|
|
247
248
|
}, z.core.$strip>;
|
|
248
249
|
/** Payload of a {@link runtimeErrorEventSchema} event. */
|
|
@@ -466,6 +467,7 @@ export declare const eventParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
466
467
|
device_busy: "device_busy";
|
|
467
468
|
negotiation_failed: "negotiation_failed";
|
|
468
469
|
no_signal: "no_signal";
|
|
470
|
+
no_silicon_converter: "no_silicon_converter";
|
|
469
471
|
}>>;
|
|
470
472
|
}, z.core.$strip>, z.ZodObject<{
|
|
471
473
|
type: z.ZodLiteral<"preview">;
|
|
@@ -663,6 +665,7 @@ export declare const cerastreamEventSchema: z.ZodObject<{
|
|
|
663
665
|
device_busy: "device_busy";
|
|
664
666
|
negotiation_failed: "negotiation_failed";
|
|
665
667
|
no_signal: "no_signal";
|
|
668
|
+
no_silicon_converter: "no_silicon_converter";
|
|
666
669
|
}>>;
|
|
667
670
|
}, z.core.$strip>, z.ZodObject<{
|
|
668
671
|
type: z.ZodLiteral<"preview">;
|
|
@@ -869,6 +872,7 @@ export declare const eventSchemas: {
|
|
|
869
872
|
device_busy: "device_busy";
|
|
870
873
|
negotiation_failed: "negotiation_failed";
|
|
871
874
|
no_signal: "no_signal";
|
|
875
|
+
no_silicon_converter: "no_silicon_converter";
|
|
872
876
|
}>>;
|
|
873
877
|
}, z.core.$strip>;
|
|
874
878
|
readonly preview: z.ZodObject<{
|
package/dist/messages.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export declare const startParamsSchema: z.ZodObject<{
|
|
|
28
28
|
resolution: z.ZodOptional<z.ZodString>;
|
|
29
29
|
framerate: z.ZodOptional<z.ZodNumber>;
|
|
30
30
|
audio: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
alsa: "alsa";
|
|
33
|
+
pipewire: "pipewire";
|
|
34
|
+
}>>;
|
|
31
35
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
32
36
|
default: "default";
|
|
33
37
|
device: "device";
|
|
@@ -91,6 +95,10 @@ export declare const reloadConfigParamsSchema: z.ZodObject<{
|
|
|
91
95
|
latency_ms: z.ZodOptional<z.ZodNumber>;
|
|
92
96
|
}, z.core.$strip>>;
|
|
93
97
|
audio: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
99
|
+
alsa: "alsa";
|
|
100
|
+
pipewire: "pipewire";
|
|
101
|
+
}>>;
|
|
94
102
|
delay_ms: z.ZodOptional<z.ZodNumber>;
|
|
95
103
|
delay_ms_signed: z.ZodOptional<z.ZodNumber>;
|
|
96
104
|
meter_device: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -116,6 +124,10 @@ export declare const reloadConfigResultSchema: z.ZodObject<{
|
|
|
116
124
|
latency_ms: z.ZodOptional<z.ZodNumber>;
|
|
117
125
|
}, z.core.$strip>>;
|
|
118
126
|
audio: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
alsa: "alsa";
|
|
129
|
+
pipewire: "pipewire";
|
|
130
|
+
}>>;
|
|
119
131
|
delay_ms: z.ZodOptional<z.ZodNumber>;
|
|
120
132
|
delay_ms_signed: z.ZodOptional<z.ZodNumber>;
|
|
121
133
|
meter_device: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -130,6 +142,7 @@ export declare const reloadConfigResultSchema: z.ZodObject<{
|
|
|
130
142
|
"source-fixed": "source-fixed";
|
|
131
143
|
}>>;
|
|
132
144
|
reason: z.ZodOptional<z.ZodString>;
|
|
145
|
+
applies: z.ZodOptional<z.ZodLiteral<"next-session">>;
|
|
133
146
|
}, z.core.$strip>;
|
|
134
147
|
export type ReloadConfigResult = z.infer<typeof reloadConfigResultSchema>;
|
|
135
148
|
export declare const setBitrateParamsSchema: z.ZodObject<{
|
|
@@ -346,6 +359,12 @@ export declare const encoderCapsSchema: z.ZodObject<{
|
|
|
346
359
|
}, z.core.$strip>;
|
|
347
360
|
}, z.core.$strip>;
|
|
348
361
|
export type EncoderCaps = z.infer<typeof encoderCapsSchema>;
|
|
362
|
+
export declare const platformConverterSchema: z.ZodEnum<{
|
|
363
|
+
librga: "librga";
|
|
364
|
+
none: "none";
|
|
365
|
+
"v4l2-rga2": "v4l2-rga2";
|
|
366
|
+
}>;
|
|
367
|
+
export type PlatformConverter = z.infer<typeof platformConverterSchema>;
|
|
349
368
|
export declare const platformCapsSchema: z.ZodObject<{
|
|
350
369
|
supports_h265: z.ZodBoolean;
|
|
351
370
|
hardware_accelerated: z.ZodBoolean;
|
|
@@ -360,6 +379,11 @@ export declare const platformCapsSchema: z.ZodObject<{
|
|
|
360
379
|
detected: "detected";
|
|
361
380
|
override: "override";
|
|
362
381
|
}>>;
|
|
382
|
+
converter: z.ZodOptional<z.ZodEnum<{
|
|
383
|
+
librga: "librga";
|
|
384
|
+
none: "none";
|
|
385
|
+
"v4l2-rga2": "v4l2-rga2";
|
|
386
|
+
}>>;
|
|
363
387
|
}, z.core.$strip>;
|
|
364
388
|
export type PlatformCaps = z.infer<typeof platformCapsSchema>;
|
|
365
389
|
export declare const previewAvailabilitySchema: z.ZodObject<{
|
|
@@ -384,6 +408,11 @@ export declare const getCapabilitiesResultSchema: z.ZodObject<{
|
|
|
384
408
|
detected: "detected";
|
|
385
409
|
override: "override";
|
|
386
410
|
}>>;
|
|
411
|
+
converter: z.ZodOptional<z.ZodEnum<{
|
|
412
|
+
librga: "librga";
|
|
413
|
+
none: "none";
|
|
414
|
+
"v4l2-rga2": "v4l2-rga2";
|
|
415
|
+
}>>;
|
|
387
416
|
}, z.core.$strip>;
|
|
388
417
|
encoder: z.ZodObject<{
|
|
389
418
|
codecs: z.ZodArray<z.ZodString>;
|
|
@@ -402,6 +431,16 @@ export declare const getCapabilitiesResultSchema: z.ZodObject<{
|
|
|
402
431
|
default_framerate: z.ZodNumber;
|
|
403
432
|
}, z.core.$strip>>;
|
|
404
433
|
audio_live_switch: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
+
audio_backends: z.ZodOptional<z.ZodObject<{
|
|
435
|
+
supported: z.ZodArray<z.ZodEnum<{
|
|
436
|
+
alsa: "alsa";
|
|
437
|
+
pipewire: "pipewire";
|
|
438
|
+
}>>;
|
|
439
|
+
active: z.ZodEnum<{
|
|
440
|
+
alsa: "alsa";
|
|
441
|
+
pipewire: "pipewire";
|
|
442
|
+
}>;
|
|
443
|
+
}, z.core.$strip>>;
|
|
405
444
|
latency_range: z.ZodOptional<z.ZodObject<{
|
|
406
445
|
min: z.ZodNumber;
|
|
407
446
|
default: z.ZodNumber;
|
|
@@ -516,6 +555,10 @@ export declare const requestSchemas: {
|
|
|
516
555
|
resolution: z.ZodOptional<z.ZodString>;
|
|
517
556
|
framerate: z.ZodOptional<z.ZodNumber>;
|
|
518
557
|
audio: z.ZodOptional<z.ZodObject<{
|
|
558
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
559
|
+
alsa: "alsa";
|
|
560
|
+
pipewire: "pipewire";
|
|
561
|
+
}>>;
|
|
519
562
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
520
563
|
default: "default";
|
|
521
564
|
device: "device";
|
|
@@ -579,6 +622,10 @@ export declare const requestSchemas: {
|
|
|
579
622
|
latency_ms: z.ZodOptional<z.ZodNumber>;
|
|
580
623
|
}, z.core.$strip>>;
|
|
581
624
|
audio: z.ZodOptional<z.ZodObject<{
|
|
625
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
626
|
+
alsa: "alsa";
|
|
627
|
+
pipewire: "pipewire";
|
|
628
|
+
}>>;
|
|
582
629
|
delay_ms: z.ZodOptional<z.ZodNumber>;
|
|
583
630
|
delay_ms_signed: z.ZodOptional<z.ZodNumber>;
|
|
584
631
|
meter_device: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -603,6 +650,10 @@ export declare const requestSchemas: {
|
|
|
603
650
|
latency_ms: z.ZodOptional<z.ZodNumber>;
|
|
604
651
|
}, z.core.$strip>>;
|
|
605
652
|
audio: z.ZodOptional<z.ZodObject<{
|
|
653
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
654
|
+
alsa: "alsa";
|
|
655
|
+
pipewire: "pipewire";
|
|
656
|
+
}>>;
|
|
606
657
|
delay_ms: z.ZodOptional<z.ZodNumber>;
|
|
607
658
|
delay_ms_signed: z.ZodOptional<z.ZodNumber>;
|
|
608
659
|
meter_device: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -617,6 +668,7 @@ export declare const requestSchemas: {
|
|
|
617
668
|
"source-fixed": "source-fixed";
|
|
618
669
|
}>>;
|
|
619
670
|
reason: z.ZodOptional<z.ZodString>;
|
|
671
|
+
applies: z.ZodOptional<z.ZodLiteral<"next-session">>;
|
|
620
672
|
}, z.core.$strip>;
|
|
621
673
|
};
|
|
622
674
|
readonly 'set-bitrate': {
|
package/dist/messages.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AUDIO_DELAY_MAX_MS } from './constants.js';
|
|
3
3
|
import { helloParamsSchema, helloResultSchema } from './envelope.js';
|
|
4
|
-
import { balancerAlgorithmSchema, bitrateControlSchema, captureDeviceKindSchema, captureDeviceSchema, cerastreamConfigSchema, configChangePhaseSchema, inputModeSchema, mediaClassSchema, previewEncodeModeSchema, previewTierSchema, streamStateSchema, videoCodecSchema, } from './types.js';
|
|
4
|
+
import { audioBackendSchema, balancerAlgorithmSchema, bitrateControlSchema, captureDeviceKindSchema, captureDeviceSchema, cerastreamConfigSchema, configChangePhaseSchema, inputModeSchema, mediaClassSchema, previewEncodeModeSchema, previewTierSchema, streamStateSchema, videoCodecSchema, } from './types.js';
|
|
5
5
|
// The eight v1 control methods (schema.md "v1 messages"). Each is matched
|
|
6
6
|
// byte-for-byte to schema.md: the JSON shape on the wire is the contract.
|
|
7
7
|
// ---- 1. start ----
|
|
@@ -37,6 +37,7 @@ export const reloadConfigParamsSchema = z.object({
|
|
|
37
37
|
.optional(),
|
|
38
38
|
audio: z
|
|
39
39
|
.object({
|
|
40
|
+
backend: audioBackendSchema.optional(),
|
|
40
41
|
delay_ms: z.number().int().min(0).max(AUDIO_DELAY_MAX_MS).optional(), // legacy unsigned; kept for 0.3.0 callers
|
|
41
42
|
delay_ms_signed: z.number().int().optional(), // signed sibling; clamped at apply, so unbounded
|
|
42
43
|
// additive (0.9.0): idle-meter card preference — absent leaves it unchanged,
|
|
@@ -58,6 +59,7 @@ export const reloadConfigResultSchema = z.object({
|
|
|
58
59
|
// "source-fixed" + reason "passthrough" report that. Absent on a transcode reload.
|
|
59
60
|
bitrate_control: bitrateControlSchema.optional(),
|
|
60
61
|
reason: z.string().optional(),
|
|
62
|
+
applies: z.literal('next-session').optional(),
|
|
61
63
|
});
|
|
62
64
|
// ---- 4. set-bitrate ----
|
|
63
65
|
export const setBitrateParamsSchema = z.object({
|
|
@@ -170,6 +172,7 @@ export const encoderCapsSchema = z.object({
|
|
|
170
172
|
codecs: z.array(z.string()),
|
|
171
173
|
bitrate_range: bitrateRangeCapsSchema,
|
|
172
174
|
});
|
|
175
|
+
export const platformConverterSchema = z.enum(['librga', 'v4l2-rga2', 'none']);
|
|
173
176
|
export const platformCapsSchema = z.object({
|
|
174
177
|
supports_h265: z.boolean(),
|
|
175
178
|
hardware_accelerated: z.boolean(),
|
|
@@ -178,6 +181,7 @@ export const platformCapsSchema = z.object({
|
|
|
178
181
|
// Optional so a pre-field engine (which omits both) still parses.
|
|
179
182
|
hardware_kind: z.enum(['rk3588', 'jetson', 'n100', 'generic']).optional(),
|
|
180
183
|
source: z.enum(['detected', 'override']).optional(),
|
|
184
|
+
converter: platformConverterSchema.optional(),
|
|
181
185
|
});
|
|
182
186
|
// Preview-server availability (0.4.0, additive). Lets the UI tell an unbound /
|
|
183
187
|
// port-conflicted preview (enabled:true, bound:false) from a down engine.
|
|
@@ -200,6 +204,12 @@ export const getCapabilitiesResultSchema = z.object({
|
|
|
200
204
|
encoder: encoderCapsSchema,
|
|
201
205
|
sources: z.array(videoSourceCapSchema),
|
|
202
206
|
audio_live_switch: z.boolean().optional(),
|
|
207
|
+
audio_backends: z
|
|
208
|
+
.object({
|
|
209
|
+
supported: z.array(audioBackendSchema),
|
|
210
|
+
active: audioBackendSchema,
|
|
211
|
+
})
|
|
212
|
+
.optional(),
|
|
203
213
|
latency_range: latencyRangeCapsSchema.optional(),
|
|
204
214
|
fec_capable: z.boolean().optional(), // engine can encode FEC on egress (SRTO_PACKETFILTER)
|
|
205
215
|
supported_profiles: z.array(z.string()).optional(), // SRT receive presets the device offers
|
package/dist/types.d.ts
CHANGED
|
@@ -116,7 +116,16 @@ export declare const audioModeSchema: z.ZodEnum<{
|
|
|
116
116
|
none: "none";
|
|
117
117
|
}>;
|
|
118
118
|
export type AudioMode = z.infer<typeof audioModeSchema>;
|
|
119
|
+
export declare const audioBackendSchema: z.ZodEnum<{
|
|
120
|
+
alsa: "alsa";
|
|
121
|
+
pipewire: "pipewire";
|
|
122
|
+
}>;
|
|
123
|
+
export type AudioBackend = z.infer<typeof audioBackendSchema>;
|
|
119
124
|
export declare const audioConfigSchema: z.ZodObject<{
|
|
125
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
126
|
+
alsa: "alsa";
|
|
127
|
+
pipewire: "pipewire";
|
|
128
|
+
}>>;
|
|
120
129
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
121
130
|
default: "default";
|
|
122
131
|
device: "device";
|
|
@@ -162,6 +171,10 @@ export declare const cerastreamConfigSchema: z.ZodObject<{
|
|
|
162
171
|
resolution: z.ZodOptional<z.ZodString>;
|
|
163
172
|
framerate: z.ZodOptional<z.ZodNumber>;
|
|
164
173
|
audio: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
backend: z.ZodOptional<z.ZodEnum<{
|
|
175
|
+
alsa: "alsa";
|
|
176
|
+
pipewire: "pipewire";
|
|
177
|
+
}>>;
|
|
165
178
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
166
179
|
default: "default";
|
|
167
180
|
device: "device";
|
package/dist/types.js
CHANGED
|
@@ -113,7 +113,9 @@ export const bitrateConfigSchema = z
|
|
|
113
113
|
// so a pre-0.6.0 caller keeps working. Replaces leaking pseudo-source strings
|
|
114
114
|
// (e.g. "No audio") into `device`.
|
|
115
115
|
export const audioModeSchema = z.enum(['none', 'default', 'device']);
|
|
116
|
+
export const audioBackendSchema = z.enum(['alsa', 'pipewire']);
|
|
116
117
|
export const audioConfigSchema = z.object({
|
|
118
|
+
backend: audioBackendSchema.optional(),
|
|
117
119
|
mode: audioModeSchema.optional(),
|
|
118
120
|
device: z.string().optional(), // ALSA capture device id; absent ⇒ test-tone fallback
|
|
119
121
|
codec: z.string().optional(), // audio encoder codec id (e.g. "aac", "opus")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ceralive/cerastream",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.2",
|
|
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",
|