@ceralive/cerastream 2026.9.5 → 2026.9.6
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 +9 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +4 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/events.d.ts +40 -0
- package/dist/events.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/session-switch.d.ts +33 -0
- package/dist/session-switch.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,15 @@ systemd-owned service — the client connects to it and never spawns it.
|
|
|
86
86
|
|
|
87
87
|
## Versioning
|
|
88
88
|
|
|
89
|
+
Version **2026.9.6 / schema 0.18.0** adds
|
|
90
|
+
`client.listSwitchTargets()` and optional `active_encode.switch_targets`.
|
|
91
|
+
Targets are `{input_id, kind: "capture"|"synthetic"|"network"}`; the query returns
|
|
92
|
+
`{session_id?, active_input?, switch_targets: [...]}`. They describe built live
|
|
93
|
+
legs, not idle capabilities; passthrough/composition explicitly return `[]`.
|
|
94
|
+
Import `SessionSwitchTarget` and `ListSwitchTargetsResult` from this package,
|
|
95
|
+
never shadow the wire types. Re-query before switching and handle refusal; the
|
|
96
|
+
snapshot does not reserve a leg. Release/publish must happen before consumption.
|
|
97
|
+
|
|
89
98
|
Two independent version axes. The **wire-schema version** (`PROTOCOL_VERSION` +
|
|
90
99
|
`SCHEMA_VERSION`) is pinned cross-language with the engine and is additive-only
|
|
91
100
|
within `cerastream-ipc/1`. The **npm package version** is CalVer
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type HelloResult } from './envelope.js';
|
|
2
2
|
import { type EventParams } from './events.js';
|
|
3
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 SetEdidProfileParams, type SetEdidProfileResult, type StartParams, type StartResult, type StopParams, type StopResult, type SubscribeEventsParams, type SubscribeEventsResult, type SwitchInputParams, type SwitchInputResult } from './messages.js';
|
|
4
|
+
import { type ListSwitchTargetsResult } from './session-switch.js';
|
|
4
5
|
/** Options for {@link connect}. All optional — `connect({})` is valid. */
|
|
5
6
|
export interface ConnectOptions {
|
|
6
7
|
/** Control socket path override. Defaults to the resolved /run/cerastream/control.sock. */
|
|
@@ -82,6 +83,7 @@ export interface CerastreamClient {
|
|
|
82
83
|
* @throws {CerastreamRpcError} when the input id is unknown.
|
|
83
84
|
*/
|
|
84
85
|
switchInput(params: SwitchInputParams): Promise<SwitchInputResult>;
|
|
86
|
+
listSwitchTargets(): Promise<ListSwitchTargetsResult>;
|
|
85
87
|
/**
|
|
86
88
|
* Enumerate capture devices (GstDeviceMonitor, de-duped by device path).
|
|
87
89
|
* @param params Optional media-class filter.
|
package/dist/client.js
CHANGED
|
@@ -5,6 +5,7 @@ import { CerastreamConnectionError, CerastreamRpcError, CerastreamTimeoutError,
|
|
|
5
5
|
import { eventParamsSchema } from './events.js';
|
|
6
6
|
import { changeConfigParamsSchema, changeConfigResultSchema, getCapabilitiesResultSchema, requestKeyframeResultSchema, requestSchemas, setEdidProfileResultSchema, } from './messages.js';
|
|
7
7
|
import { controlSocketPath } from './paths.js';
|
|
8
|
+
import { listSwitchTargetsResultSchema } from './session-switch.js';
|
|
8
9
|
import { LineSocket } from './transport.js';
|
|
9
10
|
const DEFAULTS = {
|
|
10
11
|
requestTimeoutMs: 10_000,
|
|
@@ -82,6 +83,9 @@ class ClientImpl {
|
|
|
82
83
|
listDevices(params) {
|
|
83
84
|
return this.call('list-devices', params);
|
|
84
85
|
}
|
|
86
|
+
async listSwitchTargets() {
|
|
87
|
+
return listSwitchTargetsResultSchema.parse(await this.rawRequest('list-switch-targets', {}));
|
|
88
|
+
}
|
|
85
89
|
async getCapabilities() {
|
|
86
90
|
return getCapabilitiesResultSchema.parse(await this.rawRequest('get-capabilities', undefined));
|
|
87
91
|
}
|
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.18.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.18.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/events.d.ts
CHANGED
|
@@ -11,6 +11,14 @@ export declare const activeEncodeSchema: z.ZodObject<{
|
|
|
11
11
|
resolution: z.ZodString;
|
|
12
12
|
framerate: z.ZodNumber;
|
|
13
13
|
active_input: z.ZodOptional<z.ZodString>;
|
|
14
|
+
switch_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
input_id: z.ZodString;
|
|
16
|
+
kind: z.ZodEnum<{
|
|
17
|
+
capture: "capture";
|
|
18
|
+
network: "network";
|
|
19
|
+
synthetic: "synthetic";
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strip>>>;
|
|
14
22
|
decoder: z.ZodOptional<z.ZodString>;
|
|
15
23
|
input_codec: z.ZodOptional<z.ZodString>;
|
|
16
24
|
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -84,6 +92,14 @@ export declare const statusEventSchema: z.ZodObject<{
|
|
|
84
92
|
resolution: z.ZodString;
|
|
85
93
|
framerate: z.ZodNumber;
|
|
86
94
|
active_input: z.ZodOptional<z.ZodString>;
|
|
95
|
+
switch_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
input_id: z.ZodString;
|
|
97
|
+
kind: z.ZodEnum<{
|
|
98
|
+
capture: "capture";
|
|
99
|
+
network: "network";
|
|
100
|
+
synthetic: "synthetic";
|
|
101
|
+
}>;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
87
103
|
decoder: z.ZodOptional<z.ZodString>;
|
|
88
104
|
input_codec: z.ZodOptional<z.ZodString>;
|
|
89
105
|
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -342,6 +358,14 @@ export declare const eventParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
342
358
|
resolution: z.ZodString;
|
|
343
359
|
framerate: z.ZodNumber;
|
|
344
360
|
active_input: z.ZodOptional<z.ZodString>;
|
|
361
|
+
switch_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
362
|
+
input_id: z.ZodString;
|
|
363
|
+
kind: z.ZodEnum<{
|
|
364
|
+
capture: "capture";
|
|
365
|
+
network: "network";
|
|
366
|
+
synthetic: "synthetic";
|
|
367
|
+
}>;
|
|
368
|
+
}, z.core.$strip>>>;
|
|
345
369
|
decoder: z.ZodOptional<z.ZodString>;
|
|
346
370
|
input_codec: z.ZodOptional<z.ZodString>;
|
|
347
371
|
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -547,6 +571,14 @@ export declare const cerastreamEventSchema: z.ZodObject<{
|
|
|
547
571
|
resolution: z.ZodString;
|
|
548
572
|
framerate: z.ZodNumber;
|
|
549
573
|
active_input: z.ZodOptional<z.ZodString>;
|
|
574
|
+
switch_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
575
|
+
input_id: z.ZodString;
|
|
576
|
+
kind: z.ZodEnum<{
|
|
577
|
+
capture: "capture";
|
|
578
|
+
network: "network";
|
|
579
|
+
synthetic: "synthetic";
|
|
580
|
+
}>;
|
|
581
|
+
}, z.core.$strip>>>;
|
|
550
582
|
decoder: z.ZodOptional<z.ZodString>;
|
|
551
583
|
input_codec: z.ZodOptional<z.ZodString>;
|
|
552
584
|
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -756,6 +788,14 @@ export declare const eventSchemas: {
|
|
|
756
788
|
resolution: z.ZodString;
|
|
757
789
|
framerate: z.ZodNumber;
|
|
758
790
|
active_input: z.ZodOptional<z.ZodString>;
|
|
791
|
+
switch_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
792
|
+
input_id: z.ZodString;
|
|
793
|
+
kind: z.ZodEnum<{
|
|
794
|
+
capture: "capture";
|
|
795
|
+
network: "network";
|
|
796
|
+
synthetic: "synthetic";
|
|
797
|
+
}>;
|
|
798
|
+
}, z.core.$strip>>>;
|
|
759
799
|
decoder: z.ZodOptional<z.ZodString>;
|
|
760
800
|
input_codec: z.ZodOptional<z.ZodString>;
|
|
761
801
|
passthrough: z.ZodOptional<z.ZodBoolean>;
|
package/dist/events.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { captureCauseSchema, processErrorCodeSchema, processErrorSourceSchema } from './errors.js';
|
|
3
|
+
import { sessionSwitchTargetSchema } from './session-switch.js';
|
|
3
4
|
import { captureDeviceSchema, configChangePhaseSchema, inputModeSchema, mediaClassSchema, previewEncodeFallbackSchema, previewEncodeModeSchema, streamStateSchema, } from './types.js';
|
|
4
5
|
// Server → client `event` notifications, delivered after `subscribe-events`
|
|
5
6
|
// (schema.md "Events"). Each event is the inner `params` of an rpcEventSchema:
|
|
@@ -17,6 +18,7 @@ export const activeEncodeSchema = z.object({
|
|
|
17
18
|
resolution: z.string(), // "WxH" pixels in effect, e.g. "1920x1080"
|
|
18
19
|
framerate: z.number(), // fps in effect, e.g. 29.97
|
|
19
20
|
active_input: z.string().optional(), // active input id feeding the encode
|
|
21
|
+
switch_targets: z.array(sessionSwitchTargetSchema).optional(),
|
|
20
22
|
decoder: z.string().optional(), // runtime-selected decode element when transcoding
|
|
21
23
|
input_codec: z.string().optional(), // incoming pre-decode codec token: "h264"/"h265"/"mjpeg"
|
|
22
24
|
passthrough: z.boolean().optional(), // 0.5.0: true when a same-codec passthrough graph is live (no decode/re-encode)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Already-built program-switch legs, not the idle source catalog. */
|
|
3
|
+
export declare const sessionSwitchTargetKindSchema: z.ZodEnum<{
|
|
4
|
+
capture: "capture";
|
|
5
|
+
network: "network";
|
|
6
|
+
synthetic: "synthetic";
|
|
7
|
+
}>;
|
|
8
|
+
export type SessionSwitchTargetKind = z.infer<typeof sessionSwitchTargetKindSchema>;
|
|
9
|
+
export declare const sessionSwitchTargetSchema: z.ZodObject<{
|
|
10
|
+
input_id: z.ZodString;
|
|
11
|
+
kind: z.ZodEnum<{
|
|
12
|
+
capture: "capture";
|
|
13
|
+
network: "network";
|
|
14
|
+
synthetic: "synthetic";
|
|
15
|
+
}>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type SessionSwitchTarget = z.infer<typeof sessionSwitchTargetSchema>;
|
|
18
|
+
export declare const listSwitchTargetsParamsSchema: z.ZodObject<{}, z.core.$strip>;
|
|
19
|
+
export type ListSwitchTargetsParams = z.infer<typeof listSwitchTargetsParamsSchema>;
|
|
20
|
+
/** A snapshot, not a reservation; re-query before dispatch and handle switch refusal. */
|
|
21
|
+
export declare const listSwitchTargetsResultSchema: z.ZodObject<{
|
|
22
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
active_input: z.ZodOptional<z.ZodString>;
|
|
24
|
+
switch_targets: z.ZodArray<z.ZodObject<{
|
|
25
|
+
input_id: z.ZodString;
|
|
26
|
+
kind: z.ZodEnum<{
|
|
27
|
+
capture: "capture";
|
|
28
|
+
network: "network";
|
|
29
|
+
synthetic: "synthetic";
|
|
30
|
+
}>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type ListSwitchTargetsResult = z.infer<typeof listSwitchTargetsResultSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Already-built program-switch legs, not the idle source catalog. */
|
|
3
|
+
export const sessionSwitchTargetKindSchema = z.enum(['capture', 'synthetic', 'network']);
|
|
4
|
+
export const sessionSwitchTargetSchema = z.object({
|
|
5
|
+
input_id: z.string(),
|
|
6
|
+
kind: sessionSwitchTargetKindSchema,
|
|
7
|
+
});
|
|
8
|
+
export const listSwitchTargetsParamsSchema = z.object({});
|
|
9
|
+
/** A snapshot, not a reservation; re-query before dispatch and handle switch refusal. */
|
|
10
|
+
export const listSwitchTargetsResultSchema = z.object({
|
|
11
|
+
session_id: z.string().optional(),
|
|
12
|
+
active_input: z.string().optional(),
|
|
13
|
+
switch_targets: z.array(sessionSwitchTargetSchema),
|
|
14
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ceralive/cerastream",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.6",
|
|
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",
|