@camstack/core 0.1.34 → 0.1.35

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/dist/index.js CHANGED
@@ -37,7 +37,7 @@ let node_vm = require("node:vm");
37
37
  node_vm = require_chunk.__toESM(node_vm);
38
38
  let node_os = require("node:os");
39
39
  node_os = require_chunk.__toESM(node_os);
40
- //#region ../types/dist/index-BKnvgAep.mjs
40
+ //#region ../types/dist/index-BBVUwOlZ.mjs
41
41
  var MODEL_FORMATS = [
42
42
  "onnx",
43
43
  "coreml",
@@ -898,7 +898,7 @@ var DecodedFrameSchema = zod.z.object({
898
898
  ]),
899
899
  timestamp: zod.z.number()
900
900
  });
901
- var BrokerStatusSchema = zod.z.enum([
901
+ var BrokerStatusSchema$1 = zod.z.enum([
902
902
  "idle",
903
903
  "connecting",
904
904
  "streaming",
@@ -906,7 +906,7 @@ var BrokerStatusSchema = zod.z.enum([
906
906
  "stopped"
907
907
  ]);
908
908
  var BrokerStatsSchema = zod.z.object({
909
- status: BrokerStatusSchema,
909
+ status: BrokerStatusSchema$1,
910
910
  inputFps: zod.z.number(),
911
911
  decodeFps: zod.z.number(),
912
912
  encodedSubscribers: zod.z.number(),
@@ -1006,6 +1006,37 @@ zod.z.enum([
1006
1006
  "disabled",
1007
1007
  "waking"
1008
1008
  ]);
1009
+ var VideoCodecTargetSchema = zod.z.enum([
1010
+ "H264",
1011
+ "H265",
1012
+ "auto"
1013
+ ]);
1014
+ var AudioCodecTargetSchema = zod.z.enum([
1015
+ "AAC",
1016
+ "Opus",
1017
+ "PCMU",
1018
+ "none"
1019
+ ]);
1020
+ var MaxResolutionSchema = zod.z.object({
1021
+ width: zod.z.number().int().positive(),
1022
+ height: zod.z.number().int().positive()
1023
+ });
1024
+ var GetStreamWithCodecInputSchema = zod.z.object({
1025
+ deviceId: zod.z.number().int().nonnegative(),
1026
+ videoCodec: VideoCodecTargetSchema,
1027
+ audioCodec: AudioCodecTargetSchema.optional(),
1028
+ maxResolution: MaxResolutionSchema.optional(),
1029
+ tag: zod.z.string().optional()
1030
+ });
1031
+ var RtpSourceSchema = zod.z.object({
1032
+ url: zod.z.string(),
1033
+ videoCodec: zod.z.enum(["H264", "H265"]),
1034
+ audioCodec: zod.z.string(),
1035
+ resolution: MaxResolutionSchema,
1036
+ transcoded: zod.z.boolean(),
1037
+ encoder: zod.z.string(),
1038
+ pipelineKey: zod.z.string()
1039
+ });
1009
1040
  method(zod.z.object({
1010
1041
  deviceId: zod.z.number().int().nonnegative(),
1011
1042
  camStreamId: zod.z.string().min(1),
@@ -1015,28 +1046,8 @@ method(zod.z.object({
1015
1046
  resolution: CamStreamResolutionSchema.optional(),
1016
1047
  fps: zod.z.number().positive().optional(),
1017
1048
  label: zod.z.string().optional(),
1018
- /**
1019
- * Device-level features that the broker / manager / snapshot
1020
- * orchestrator consult to derive per-stream policy (e.g.
1021
- * `BatteryOperated` → relax stall watchdog, default pre-buffer
1022
- * to off, raise snapshot rate-limit). Single source of truth —
1023
- * publishers no longer set per-stream flags like `allowStall`.
1024
- */
1025
1049
  deviceFeatures: zod.z.array(zod.z.string()).optional(),
1026
- /**
1027
- * Whether this stream participates in the broker's automatic
1028
- * profile assignment. Defaults `true`. Publishers set `false` for
1029
- * streams that should be SELECTABLE but not auto-picked — e.g.
1030
- * Reolink publishes native Baichuan as eligible and RTSP/RTMP
1031
- * mirrors as ineligible (still assignable manually via
1032
- * `assignProfile`).
1033
- */
1034
1050
  autoEligible: zod.z.boolean().optional(),
1035
- /**
1036
- * Transport-specific opaque metadata stashed alongside the stream
1037
- * record. `pull-rfc4571` publishers put the SDP here so the broker
1038
- * reader can route packets without an in-band DESCRIBE phase.
1039
- */
1040
1051
  metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1041
1052
  }), zod.z.object({ success: zod.z.literal(true) }), {
1042
1053
  kind: "mutation",
@@ -1080,7 +1091,16 @@ method(zod.z.object({
1080
1091
  }), method(zod.z.object({
1081
1092
  streamId: zod.z.string(),
1082
1093
  format: StreamFormatSchema
1083
- }), zod.z.object({ url: zod.z.string() })), method(zod.z.object({ brokerId: zod.z.string() }), zod.z.custom()), method(zod.z.object({
1094
+ }), zod.z.object({ url: zod.z.string() })), method(GetStreamWithCodecInputSchema, RtpSourceSchema, {
1095
+ kind: "mutation",
1096
+ auth: "admin"
1097
+ }), method(zod.z.object({ pipelineKey: zod.z.string() }), zod.z.object({
1098
+ released: zod.z.boolean(),
1099
+ refcount: zod.z.number().int().nonnegative()
1100
+ }), {
1101
+ kind: "mutation",
1102
+ auth: "admin"
1103
+ }), method(zod.z.object({ brokerId: zod.z.string() }), zod.z.custom()), method(zod.z.object({
1084
1104
  brokerId: zod.z.string(),
1085
1105
  seconds: zod.z.number().min(0).max(30)
1086
1106
  }), zod.z.void(), {
@@ -2451,14 +2471,25 @@ method(LogEntrySchema, zod.z.void(), { kind: "mutation" }), method(zod.z.object(
2451
2471
  limit: zod.z.number().optional(),
2452
2472
  tags: zod.z.record(zod.z.string(), zod.z.string()).optional()
2453
2473
  }), zod.z.array(LogEntrySchema).readonly());
2454
- method(zod.z.void(), zod.z.string()), method(zod.z.void(), zod.z.string());
2474
+ var StaticDirOutputSchema = zod.z.object({ staticDir: zod.z.string() });
2475
+ var VersionOutputSchema = zod.z.object({ version: zod.z.string() });
2476
+ method(zod.z.void(), StaticDirOutputSchema), method(zod.z.void(), VersionOutputSchema);
2455
2477
  var SsoBridgeClaimsSchema = zod.z.object({
2456
2478
  userId: zod.z.string(),
2457
2479
  username: zod.z.string(),
2458
2480
  isAdmin: zod.z.boolean(),
2459
2481
  provider: zod.z.string(),
2460
2482
  email: zod.z.string().optional(),
2461
- displayName: zod.z.string().optional()
2483
+ displayName: zod.z.string().optional(),
2484
+ /**
2485
+ * Public HTTPS URL of the hub that issued this token. Used by
2486
+ * cloud-mode OAuth proxies (Alexa Smart Home Lambda, future Google
2487
+ * Home Lambda) to route a request back to the originating hub
2488
+ * without holding routing state of their own. The Lambda decodes the
2489
+ * JWT WITHOUT verifying the signature — the hub re-verifies on every
2490
+ * inbound call so trust still rests with the signing hub.
2491
+ */
2492
+ hubUrl: zod.z.string().optional()
2462
2493
  });
2463
2494
  method(zod.z.object({
2464
2495
  claims: SsoBridgeClaimsSchema,
@@ -2510,7 +2541,7 @@ method(zod.z.object({
2510
2541
  auth: "admin",
2511
2542
  access: "delete"
2512
2543
  });
2513
- var EmailAddressSchema = zod.z.string().email();
2544
+ var EmailAddressSchema = zod.z.email();
2514
2545
  var SendEmailInputSchema = zod.z.object({
2515
2546
  to: zod.z.union([EmailAddressSchema, zod.z.array(EmailAddressSchema).min(1)]),
2516
2547
  cc: zod.z.array(EmailAddressSchema).optional(),
@@ -2552,133 +2583,94 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
2552
2583
  auth: "admin",
2553
2584
  access: "view"
2554
2585
  }), method(zod.z.void(), SmtpStatusSchema, { auth: "admin" });
2555
- var QosSchema = zod.z.union([
2556
- zod.z.literal(0),
2557
- zod.z.literal(1),
2558
- zod.z.literal(2)
2586
+ var BrokerKindSchema = zod.z.enum(["external", "embedded"]);
2587
+ var BrokerStatusSchema = zod.z.enum([
2588
+ "connected",
2589
+ "disconnected",
2590
+ "auth-failed",
2591
+ "unreachable",
2592
+ "tls-error"
2559
2593
  ]);
2560
- var PublishInputSchema = zod.z.object({
2561
- topic: zod.z.string(),
2562
- /** UTF-8 payload. Binary payloads must be base64-encoded by the caller. */
2563
- payload: zod.z.string(),
2564
- qos: QosSchema.default(0),
2565
- retain: zod.z.boolean().default(false)
2566
- });
2567
- var SubscribeInputSchema = zod.z.object({
2568
- /** MQTT topic filter (supports `+` single-level and `#` multi-level wildcards). */
2569
- topic: zod.z.string(),
2570
- qos: QosSchema.default(0),
2594
+ var BrokerInfoSchema = zod.z.object({
2595
+ id: zod.z.string(),
2596
+ name: zod.z.string(),
2597
+ url: zod.z.string(),
2598
+ kind: BrokerKindSchema,
2599
+ status: BrokerStatusSchema,
2600
+ latencyMs: zod.z.number().nullable(),
2601
+ error: zod.z.string().optional(),
2602
+ /** Embedded brokers only: number of MQTT clients currently connected. */
2603
+ connectedClients: zod.z.number().int().nonnegative().optional(),
2604
+ /** Epoch ms of the last live probe (external) or aedes snapshot (embedded). */
2605
+ lastCheckedAt: zod.z.number().optional()
2606
+ });
2607
+ var BrokerConnectionDetailsSchema = zod.z.object({
2608
+ url: zod.z.string(),
2609
+ username: zod.z.string().optional(),
2610
+ password: zod.z.string().optional(),
2571
2611
  /**
2572
- * Caller-supplied owner tag. Useful for debugging + the
2573
- * `listSubscriptions` admin view ("which consumer owns this?").
2574
- * When omitted, the addon synthesizes one from the caller's addon id.
2612
+ * Suggested prefix for `clientId`. Each consumer should suffix this
2613
+ * with its own discriminator (addon id, instance id) so reconnects
2614
+ * don't kick each other off (MQTT spec: clientId must be unique per
2615
+ * broker).
2575
2616
  */
2576
- owner: zod.z.string().optional()
2617
+ clientIdPrefix: zod.z.string().optional()
2577
2618
  });
2578
- var SubscribeResultSchema = zod.z.object({
2579
- success: zod.z.literal(true),
2580
- /** Server-generated subscription id. Pass to `unsubscribe` to release. */
2581
- subscriptionId: zod.z.string()
2582
- });
2583
- var UnsubscribeInputSchema = zod.z.object({
2584
- /** Subscription id from `subscribe`. */
2585
- subscriptionId: zod.z.string() });
2586
- var MqttStatusSchema = zod.z.object({
2587
- /** True iff the addon has an active connection to the broker. */
2588
- connected: zod.z.boolean(),
2589
- /** Operator-visible host string (e.g. `mqtt://broker.example:1883`). */
2590
- brokerUrl: zod.z.string(),
2591
- /** Active subscription count (per-owner, NOT broker-side topic count). */
2592
- subscriptionCount: zod.z.number().int(),
2593
- /** Last error reported by the broker. */
2594
- error: zod.z.string().optional(),
2595
- /** Last successful connection timestamp (unix ms). */
2596
- connectedAt: zod.z.number().optional()
2597
- });
2598
- var SubscriptionInfoSchema = zod.z.object({
2599
- subscriptionId: zod.z.string(),
2600
- topic: zod.z.string(),
2601
- qos: QosSchema,
2602
- owner: zod.z.string(),
2603
- /** When this individual subscription was created. */
2604
- createdAt: zod.z.number()
2619
+ var AddBrokerInputSchema = zod.z.object({
2620
+ name: zod.z.string().min(1),
2621
+ url: zod.z.string().regex(/^(mqtt|mqtts|ws|wss):\/\//, "URL must start with mqtt(s):// or ws(s)://"),
2622
+ username: zod.z.string().optional(),
2623
+ password: zod.z.string().optional(),
2624
+ clientIdPrefix: zod.z.string().optional()
2605
2625
  });
2606
- method(PublishInputSchema, zod.z.object({ success: zod.z.literal(true) }), {
2607
- kind: "mutation",
2608
- auth: "admin",
2609
- access: "create"
2610
- }), method(SubscribeInputSchema, SubscribeResultSchema, {
2611
- kind: "mutation",
2612
- auth: "admin",
2613
- access: "create"
2614
- }), method(UnsubscribeInputSchema, zod.z.object({ success: zod.z.literal(true) }), {
2615
- kind: "mutation",
2616
- auth: "admin",
2617
- access: "delete"
2618
- }), method(zod.z.void(), zod.z.array(SubscriptionInfoSchema), { auth: "admin" }), method(zod.z.void(), MqttStatusSchema, { auth: "admin" });
2619
- var HaServiceCallSchema = zod.z.object({
2620
- /** HA domain (e.g. `light`, `switch`, `notify`). */
2621
- domain: zod.z.string(),
2622
- /** HA service (e.g. `turn_on`, `toggle`). */
2623
- service: zod.z.string(),
2624
- /** Service-specific data payload (e.g. `{entity_id: 'light.kitchen', brightness: 200}`). */
2625
- serviceData: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
2626
- /** Optional target spec (entity_id / device_id / area_id). */
2627
- target: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
2628
- });
2629
- var HaStateSchema = zod.z.object({
2630
- entity_id: zod.z.string(),
2631
- state: zod.z.string(),
2632
- attributes: zod.z.record(zod.z.string(), zod.z.unknown()).default({}),
2633
- last_changed: zod.z.string().optional(),
2634
- last_updated: zod.z.string().optional()
2626
+ var AddBrokerResultSchema = zod.z.object({ id: zod.z.string() });
2627
+ var IdInputSchema = zod.z.object({ id: zod.z.string() });
2628
+ var TestResultSchema = zod.z.discriminatedUnion("ok", [zod.z.object({
2629
+ ok: zod.z.literal(true),
2630
+ latencyMs: zod.z.number()
2631
+ }), zod.z.object({
2632
+ ok: zod.z.literal(false),
2633
+ error: zod.z.string()
2634
+ })]);
2635
+ var StartEmbeddedInputSchema = zod.z.object({
2636
+ port: zod.z.number().int().min(1).max(65535).default(1883),
2637
+ /** Allow anonymous connect (no username/password). Default: false. */
2638
+ allowAnonymous: zod.z.boolean().default(false),
2639
+ /** Optional shared username/password for clients. */
2640
+ username: zod.z.string().optional(),
2641
+ password: zod.z.string().optional()
2635
2642
  });
2636
- var HaStatusSchema = zod.z.object({
2637
- connected: zod.z.boolean(),
2638
- host: zod.z.string(),
2639
- /** Active per-owner subscription count. */
2640
- subscriptionCount: zod.z.number().int(),
2641
- /** Last error reported by the WebSocket. */
2642
- error: zod.z.string().optional(),
2643
- /** HA version reported during the auth handshake, when reachable. */
2644
- haVersion: zod.z.string().optional(),
2645
- connectedAt: zod.z.number().optional()
2643
+ var StartEmbeddedResultSchema = zod.z.object({
2644
+ id: zod.z.string(),
2645
+ url: zod.z.string()
2646
2646
  });
2647
- var HaSubscribeInputSchema = zod.z.object({
2648
- /**
2649
- * Specific HA event type to subscribe to (`state_changed`,
2650
- * `service_called`, etc.). Empty string = all events (firehose —
2651
- * only for debugging).
2652
- */
2653
- eventType: zod.z.string().optional(),
2654
- /** Caller-supplied tag for listSubscriptions debugging. */
2655
- owner: zod.z.string().optional()
2647
+ var StatusSchema = zod.z.object({
2648
+ brokerCount: zod.z.number(),
2649
+ embeddedRunning: zod.z.boolean()
2656
2650
  });
2657
- var HaSubscribeResultSchema = zod.z.object({
2658
- success: zod.z.literal(true),
2659
- subscriptionId: zod.z.string()
2660
- });
2661
- var HaUnsubscribeInputSchema = zod.z.object({ subscriptionId: zod.z.string() });
2662
- var HaSubscriptionInfoSchema = zod.z.object({
2663
- subscriptionId: zod.z.string(),
2664
- /** Empty string when subscribed to ALL events. */
2665
- eventType: zod.z.string(),
2666
- owner: zod.z.string(),
2667
- createdAt: zod.z.number()
2651
+ method(zod.z.void(), zod.z.array(BrokerInfoSchema)), method(IdInputSchema, BrokerConnectionDetailsSchema), method(AddBrokerInputSchema, AddBrokerResultSchema, { kind: "mutation" }), method(IdInputSchema, zod.z.void(), { kind: "mutation" }), method(IdInputSchema, TestResultSchema, { kind: "mutation" }), method(StartEmbeddedInputSchema, StartEmbeddedResultSchema, { kind: "mutation" }), method(IdInputSchema, zod.z.void(), { kind: "mutation" }), method(zod.z.void(), StatusSchema);
2652
+ var LinkStateSchema = zod.z.enum([
2653
+ "unlinked",
2654
+ "linked",
2655
+ "error"
2656
+ ]);
2657
+ var DeviceExportStatusSchema = zod.z.object({
2658
+ linkState: LinkStateSchema,
2659
+ exposedDeviceCount: zod.z.number(),
2660
+ error: zod.z.string().optional()
2668
2661
  });
2669
- method(HaSubscribeInputSchema, HaSubscribeResultSchema, {
2670
- kind: "mutation",
2671
- auth: "admin",
2672
- access: "create"
2673
- }), method(HaUnsubscribeInputSchema, zod.z.object({ success: zod.z.literal(true) }), {
2674
- kind: "mutation",
2675
- auth: "admin",
2676
- access: "delete"
2677
- }), method(HaServiceCallSchema, zod.z.object({ result: zod.z.unknown() }), {
2678
- kind: "mutation",
2679
- auth: "admin",
2680
- access: "create"
2681
- }), method(zod.z.void(), zod.z.array(HaStateSchema).readonly(), { auth: "admin" }), method(zod.z.object({ entityId: zod.z.string() }), HaStateSchema.nullable(), { auth: "admin" }), method(zod.z.void(), zod.z.array(HaSubscriptionInfoSchema).readonly(), { auth: "admin" }), method(zod.z.void(), HaStatusSchema, { auth: "admin" });
2662
+ var DeviceKindSchema = zod.z.string();
2663
+ var ExposedDeviceSchema = zod.z.object({
2664
+ deviceId: zod.z.string(),
2665
+ exposedAs: zod.z.string().optional(),
2666
+ capabilities: zod.z.array(zod.z.string()).optional()
2667
+ });
2668
+ var ExposeInputSchema = zod.z.object({
2669
+ deviceId: zod.z.string(),
2670
+ capabilities: zod.z.array(zod.z.string()).optional()
2671
+ });
2672
+ var UnexposeInputSchema = zod.z.object({ deviceId: zod.z.string() });
2673
+ method(zod.z.void(), DeviceExportStatusSchema), method(zod.z.void(), zod.z.array(DeviceKindSchema)), method(zod.z.void(), zod.z.array(ExposedDeviceSchema)), method(ExposeInputSchema, zod.z.void(), { kind: "mutation" }), method(UnexposeInputSchema, zod.z.void(), { kind: "mutation" });
2682
2674
  var AddonPageDeclarationSchema$1 = zod.z.object({
2683
2675
  id: zod.z.string(),
2684
2676
  label: zod.z.string(),
@@ -2934,6 +2926,14 @@ DeviceType.Camera, method(zod.z.object({ deviceId: zod.z.number().int().nonnegat
2934
2926
  }), zod.z.object({
2935
2927
  sessionId: zod.z.string(),
2936
2928
  sdpOffer: zod.z.string()
2929
+ }), { kind: "mutation" }), method(zod.z.object({
2930
+ deviceId: zod.z.number().int().nonnegative(),
2931
+ target: WebrtcStreamTargetSchema.optional(),
2932
+ sdpOffer: zod.z.string(),
2933
+ sessionId: zod.z.string().optional()
2934
+ }), zod.z.object({
2935
+ sessionId: zod.z.string(),
2936
+ sdpAnswer: zod.z.string()
2937
2937
  }), { kind: "mutation" }), method(zod.z.object({
2938
2938
  deviceId: zod.z.number().int().nonnegative(),
2939
2939
  sessionId: zod.z.string(),
@@ -3272,12 +3272,12 @@ method(zod.z.void(), zod.z.array(AudioCodecInfoSchema).readonly()), method(zod.z
3272
3272
  }), zod.z.array(AudioEncodedChunkSchema), { kind: "mutation" }), method(zod.z.void(), zod.z.array(SessionInventoryEntrySchema).readonly());
3273
3273
  var EmbeddingResultSchema = zod.z.object({
3274
3274
  embedding: zod.z.array(zod.z.number()),
3275
- dimensions: zod.z.number()
3275
+ inferenceMs: zod.z.number()
3276
3276
  });
3277
3277
  var EmbeddingInfoSchema = zod.z.object({
3278
3278
  modelId: zod.z.string(),
3279
- dimensions: zod.z.number(),
3280
- inputSize: zod.z.number()
3279
+ embeddingDim: zod.z.number(),
3280
+ ready: zod.z.boolean()
3281
3281
  });
3282
3282
  method(zod.z.object({
3283
3283
  crop: zod.z.instanceof(Uint8Array),
@@ -3618,7 +3618,20 @@ var NetworkAccessStatusSchema = zod.z.object({
3618
3618
  endpoint: NetworkEndpointSchema.nullable(),
3619
3619
  error: zod.z.string().optional()
3620
3620
  });
3621
- method(zod.z.void(), NetworkEndpointSchema, { kind: "mutation" }), method(zod.z.void(), zod.z.void(), { kind: "mutation" }), method(zod.z.void(), NetworkEndpointSchema.nullable()), method(zod.z.void(), NetworkAccessStatusSchema);
3621
+ var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
3622
+ /**
3623
+ * Stable id within the provider — typically `<mode>-<sourcePort>` so
3624
+ * the orchestrator can dedupe across `listEndpoints` polls.
3625
+ */
3626
+ id: zod.z.string(),
3627
+ /** Operator-facing label (mirrors `MeshEndpoint.label`). */
3628
+ label: zod.z.string(),
3629
+ /** Optional provider-specific mode tag, used for icon/colour in admin UI. */
3630
+ mode: zod.z.string().optional(),
3631
+ /** Originating local port the ingress fronts (informational). */
3632
+ sourcePort: zod.z.number().optional()
3633
+ });
3634
+ method(zod.z.void(), NetworkEndpointSchema, { kind: "mutation" }), method(zod.z.void(), zod.z.void(), { kind: "mutation" }), method(zod.z.void(), NetworkEndpointSchema.nullable()), method(zod.z.void(), NetworkAccessStatusSchema), method(zod.z.void(), zod.z.array(NetworkEndpointEntrySchema).readonly());
3622
3635
  var RemoteAccessEndpointSchema = zod.z.object({
3623
3636
  url: zod.z.string(),
3624
3637
  hostname: zod.z.string(),
@@ -3731,28 +3744,78 @@ method(zod.z.object({
3731
3744
  success: zod.z.boolean(),
3732
3745
  error: zod.z.string().optional()
3733
3746
  }), { kind: "mutation" });
3747
+ var NotificationRuleConditionsSchema = zod.z.object({
3748
+ deviceIds: zod.z.array(zod.z.number()).readonly().optional(),
3749
+ classNames: zod.z.array(zod.z.string()).readonly().optional(),
3750
+ zoneIds: zod.z.array(zod.z.string()).readonly().optional(),
3751
+ minConfidence: zod.z.number().optional(),
3752
+ source: zod.z.enum([
3753
+ "pipeline",
3754
+ "onboard",
3755
+ "any"
3756
+ ]).optional(),
3757
+ schedule: zod.z.object({
3758
+ days: zod.z.array(zod.z.number()).readonly(),
3759
+ startHour: zod.z.number(),
3760
+ endHour: zod.z.number()
3761
+ }).optional(),
3762
+ cooldownSeconds: zod.z.number().optional(),
3763
+ minDwellSeconds: zod.z.number().optional()
3764
+ });
3765
+ var NotificationRuleTemplateSchema = zod.z.object({
3766
+ title: zod.z.string(),
3767
+ body: zod.z.string(),
3768
+ imageMode: zod.z.enum([
3769
+ "crop",
3770
+ "annotated",
3771
+ "full",
3772
+ "none"
3773
+ ])
3774
+ });
3734
3775
  var NotificationRuleSchema = zod.z.object({
3735
3776
  id: zod.z.string(),
3736
3777
  name: zod.z.string(),
3737
3778
  enabled: zod.z.boolean(),
3738
- conditions: zod.z.record(zod.z.string(), zod.z.unknown()),
3739
- actions: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown()))
3779
+ eventTypes: zod.z.array(zod.z.string()).readonly(),
3780
+ conditions: NotificationRuleConditionsSchema,
3781
+ outputs: zod.z.array(zod.z.string()).readonly(),
3782
+ template: NotificationRuleTemplateSchema.optional(),
3783
+ priority: zod.z.enum([
3784
+ "low",
3785
+ "normal",
3786
+ "high",
3787
+ "critical"
3788
+ ])
3789
+ });
3790
+ var NotificationTestResultSchema = zod.z.object({
3791
+ ruleId: zod.z.string(),
3792
+ eventId: zod.z.string(),
3793
+ timestamp: zod.z.number(),
3794
+ wouldFire: zod.z.boolean(),
3795
+ reason: zod.z.string().optional()
3740
3796
  });
3741
3797
  var NotificationHistoryEntrySchema = zod.z.object({
3742
3798
  id: zod.z.string(),
3743
3799
  ruleId: zod.z.string(),
3800
+ ruleName: zod.z.string(),
3801
+ eventId: zod.z.string(),
3744
3802
  timestamp: zod.z.number(),
3745
- deviceId: zod.z.number().optional(),
3803
+ outputs: zod.z.array(zod.z.string()).readonly(),
3746
3804
  success: zod.z.boolean(),
3747
- error: zod.z.string().optional()
3805
+ error: zod.z.string().optional(),
3806
+ deviceId: zod.z.number().optional()
3748
3807
  });
3749
- method(zod.z.void(), zod.z.array(NotificationRuleSchema).readonly()), method(NotificationRuleSchema, zod.z.void(), { kind: "mutation" }), method(zod.z.object({ ruleId: zod.z.string() }), zod.z.void(), { kind: "mutation" }), method(zod.z.object({
3750
- ruleId: zod.z.string(),
3751
- lookbackMinutes: zod.z.number()
3752
- }), zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())), { kind: "mutation" }), method(zod.z.object({
3808
+ var NotificationHistoryFilterSchema = zod.z.object({
3753
3809
  ruleId: zod.z.string().optional(),
3810
+ deviceId: zod.z.number().optional(),
3811
+ from: zod.z.number().optional(),
3812
+ to: zod.z.number().optional(),
3754
3813
  limit: zod.z.number().optional()
3755
- }), zod.z.array(NotificationHistoryEntrySchema));
3814
+ });
3815
+ method(zod.z.void(), zod.z.object({ rules: zod.z.array(NotificationRuleSchema).readonly() })), method(zod.z.object({ rule: NotificationRuleSchema }), zod.z.object({ success: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.object({ ruleId: zod.z.string() }), zod.z.object({ success: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.object({
3816
+ ruleId: zod.z.string(),
3817
+ lookbackMinutes: zod.z.number()
3818
+ }), zod.z.object({ results: zod.z.array(NotificationTestResultSchema).readonly() }), { kind: "mutation" }), method(zod.z.object({ filter: NotificationHistoryFilterSchema.optional() }), zod.z.object({ entries: zod.z.array(NotificationHistoryEntrySchema).readonly() }));
3756
3819
  var RecordingModeSchema = zod.z.enum([
3757
3820
  "continuous",
3758
3821
  "motion",
@@ -4440,6 +4503,22 @@ DeviceType.Camera, method(zod.z.object({ deviceId: zod.z.number() }), zod.z.obje
4440
4503
  }), zod.z.void(), {
4441
4504
  kind: "mutation",
4442
4505
  auth: "admin"
4506
+ }), method(zod.z.object({ deviceId: zod.z.number() }), zod.z.object({ sessionId: zod.z.string() }), {
4507
+ kind: "mutation",
4508
+ auth: "admin"
4509
+ }), method(zod.z.object({
4510
+ deviceId: zod.z.number(),
4511
+ /** PCM frames as little-endian s16, mono. Base64-encoded so
4512
+ * the payload survives tRPC JSON serialization. */
4513
+ pcmBase64: zod.z.string(),
4514
+ /** Sequence number for ordering / dropping out-of-order frames. */
4515
+ sequenceNumber: zod.z.number().int()
4516
+ }), zod.z.object({ accepted: zod.z.boolean() }), {
4517
+ kind: "mutation",
4518
+ auth: "admin"
4519
+ }), method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
4520
+ kind: "mutation",
4521
+ auth: "admin"
4443
4522
  }), zod.z.object({
4444
4523
  deviceId: zod.z.number(),
4445
4524
  status: IntercomStatusSchema
@@ -4491,6 +4570,40 @@ var HwAccelBackendInputSchema = zod.z.enum([
4491
4570
  "none"
4492
4571
  ]).nullable().optional();
4493
4572
  var HwAccelResolutionSchema = zod.z.object({ preferred: zod.z.array(zod.z.string()).readonly() });
4573
+ var HardwareEncoderIdSchema = zod.z.enum([
4574
+ "h264_videotoolbox",
4575
+ "hevc_videotoolbox",
4576
+ "h264_vaapi",
4577
+ "hevc_vaapi",
4578
+ "h264_nvenc",
4579
+ "hevc_nvenc",
4580
+ "h264_qsv",
4581
+ "hevc_qsv",
4582
+ "h264_amf",
4583
+ "hevc_amf",
4584
+ "libx264",
4585
+ "libx265"
4586
+ ]);
4587
+ var HardwareEncoderProbeSchema = zod.z.object({
4588
+ encoder: HardwareEncoderIdSchema,
4589
+ codec: zod.z.enum(["H264", "H265"]),
4590
+ family: zod.z.enum([
4591
+ "videotoolbox",
4592
+ "vaapi",
4593
+ "nvenc",
4594
+ "qsv",
4595
+ "amf",
4596
+ "software"
4597
+ ]),
4598
+ available: zod.z.boolean(),
4599
+ reason: zod.z.string().optional()
4600
+ });
4601
+ var HardwareEncodersSchema = zod.z.object({
4602
+ encoders: zod.z.array(HardwareEncoderProbeSchema).readonly(),
4603
+ defaultH264: HardwareEncoderIdSchema,
4604
+ defaultH265: HardwareEncoderIdSchema,
4605
+ probedAt: zod.z.number()
4606
+ });
4494
4607
  var HardwarePlatformSchema = zod.z.enum([
4495
4608
  "darwin",
4496
4609
  "linux",
@@ -4553,7 +4666,10 @@ var ResolvedInferenceConfigSchema = zod.z.object({
4553
4666
  method(zod.z.void(), PlatformCapabilitiesSchema), method(zod.z.void(), HardwareInfoSchema), method(zod.z.object({ requirements: zod.z.array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema), method(zod.z.object({
4554
4667
  prefer: HwAccelBackendInputSchema,
4555
4668
  nodeId: zod.z.string().optional()
4556
- }), HwAccelResolutionSchema);
4669
+ }), HwAccelResolutionSchema), method(zod.z.void(), HardwareEncodersSchema), method(zod.z.void(), HardwareEncodersSchema, {
4670
+ kind: "mutation",
4671
+ auth: "admin"
4672
+ });
4557
4673
  var InterfaceKindEnum = zod.z.enum([
4558
4674
  "lan",
4559
4675
  "wifi",
@@ -4723,28 +4839,17 @@ var MeshStatusSchema = zod.z.object({
4723
4839
  /** Last error from the daemon, when not joined. */
4724
4840
  error: zod.z.string().optional()
4725
4841
  });
4726
- var PublicIngressConfigSchema = zod.z.object({
4727
- /** Whether the provider should expose CamStack via its public
4728
- * ingress (Tailscale Funnel, etc.). */
4729
- enabled: zod.z.boolean(),
4730
- /** Local port to forward. Auto-detected from the hub HTTP port
4731
- * when omitted. */
4732
- port: zod.z.number().int().min(1).max(65535).optional()
4733
- });
4734
- var MeshIngressConfigSchema = zod.z.object({
4735
- /** Whether the provider should expose CamStack inside the mesh
4736
- * via HTTPS (Tailscale Serve, etc.) instead of just raw IP. */
4737
- enabled: zod.z.boolean(),
4738
- /** Local port to forward. Auto-detected when omitted. */
4739
- port: zod.z.number().int().min(1).max(65535).optional()
4740
- });
4741
4842
  method(zod.z.void(), MeshStatusSchema), method(zod.z.object({
4742
4843
  /** Provider-specific auth key. For Tailscale this is the
4743
4844
  * `tskey-auth-*` token from admin.tailscale.com. */
4744
4845
  authKey: zod.z.string().min(8),
4745
4846
  /** Optional hostname override the host should advertise. */
4746
4847
  hostname: zod.z.string().optional()
4747
- }), zod.z.object({ joined: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.void(), zod.z.object({ left: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.void(), zod.z.object({ peers: zod.z.array(MeshPeerSchema).readonly() })), method(PublicIngressConfigSchema, zod.z.object({ success: zod.z.literal(true) }), { kind: "mutation" }), method(MeshIngressConfigSchema, zod.z.object({ success: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.object({
4848
+ }), zod.z.object({ joined: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.object({
4849
+ /** Optional hostname override the host should advertise once joined. */
4850
+ hostname: zod.z.string().optional() }), zod.z.object({
4851
+ /** Authentication URL the operator should open in a browser. */
4852
+ loginUrl: zod.z.string() }), { kind: "mutation" }), method(zod.z.void(), zod.z.object({ left: zod.z.literal(true) }), { kind: "mutation" }), method(zod.z.void(), zod.z.object({ peers: zod.z.array(MeshPeerSchema).readonly() })), method(zod.z.object({
4748
4853
  /** Optional auth key — when provided, probes the key validity
4749
4854
  * against the provider's API. Omit when already joined to
4750
4855
  * just ping the daemon. */