@camstack/types 0.1.39 → 0.1.40

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.
Files changed (83) hide show
  1. package/dist/addon/base-addon.d.ts +2 -2
  2. package/dist/addon/base-addon.d.ts.map +1 -1
  3. package/dist/capabilities/addon-settings.cap.d.ts +1 -0
  4. package/dist/capabilities/addon-settings.cap.d.ts.map +1 -1
  5. package/dist/capabilities/addons.cap.d.ts +187 -1
  6. package/dist/capabilities/addons.cap.d.ts.map +1 -1
  7. package/dist/capabilities/alerts.cap.d.ts +5 -5
  8. package/dist/capabilities/audio-analyzer.cap.d.ts +2 -2
  9. package/dist/capabilities/camera-pipeline-config.cap.d.ts +43 -0
  10. package/dist/capabilities/camera-pipeline-config.cap.d.ts.map +1 -0
  11. package/dist/capabilities/index.d.ts +11 -4
  12. package/dist/capabilities/index.d.ts.map +1 -1
  13. package/dist/capabilities/local-network.cap.d.ts +1 -1
  14. package/dist/capabilities/mask-shape.d.ts +99 -0
  15. package/dist/capabilities/mask-shape.d.ts.map +1 -0
  16. package/dist/capabilities/mesh-network.cap.d.ts +3 -3
  17. package/dist/capabilities/motion-zones.cap.d.ts +94 -13
  18. package/dist/capabilities/motion-zones.cap.d.ts.map +1 -1
  19. package/dist/capabilities/mqtt-broker.cap.d.ts +3 -3
  20. package/dist/capabilities/native-object-detection.cap.d.ts +73 -3
  21. package/dist/capabilities/native-object-detection.cap.d.ts.map +1 -1
  22. package/dist/capabilities/network-access.cap.d.ts +7 -7
  23. package/dist/capabilities/oauth-integration.cap.d.ts +4 -2
  24. package/dist/capabilities/oauth-integration.cap.d.ts.map +1 -1
  25. package/dist/capabilities/pipeline-runner.cap.d.ts +2 -0
  26. package/dist/capabilities/pipeline-runner.cap.d.ts.map +1 -1
  27. package/dist/capabilities/privacy-mask.cap.d.ts +206 -0
  28. package/dist/capabilities/privacy-mask.cap.d.ts.map +1 -0
  29. package/dist/capabilities/schemas/detection-shared.d.ts +14 -1
  30. package/dist/capabilities/schemas/detection-shared.d.ts.map +1 -1
  31. package/dist/capabilities/sso-bridge.cap.d.ts +3 -3
  32. package/dist/capabilities/stream-catalog.cap.d.ts +82 -0
  33. package/dist/capabilities/stream-catalog.cap.d.ts.map +1 -0
  34. package/dist/capabilities/user-management.cap.d.ts +20 -20
  35. package/dist/capabilities/webrtc-session.cap.d.ts +34 -0
  36. package/dist/capabilities/webrtc-session.cap.d.ts.map +1 -1
  37. package/dist/enums/event-category.d.ts +28 -1
  38. package/dist/enums/event-category.d.ts.map +1 -1
  39. package/dist/generated/addon-api.d.ts +1250 -670
  40. package/dist/generated/addon-api.d.ts.map +1 -1
  41. package/dist/generated/cap-status-types.d.ts +3 -1
  42. package/dist/generated/cap-status-types.d.ts.map +1 -1
  43. package/dist/generated/capability-router-map.d.ts +11 -2
  44. package/dist/generated/capability-router-map.d.ts.map +1 -1
  45. package/dist/generated/device-local-state.d.ts +6 -0
  46. package/dist/generated/device-local-state.d.ts.map +1 -1
  47. package/dist/generated/device-proxy.d.ts +8 -0
  48. package/dist/generated/device-proxy.d.ts.map +1 -1
  49. package/dist/generated/method-access-map.d.ts +1 -1
  50. package/dist/generated/method-access-map.d.ts.map +1 -1
  51. package/dist/generated/system-proxy.d.ts +1 -1
  52. package/dist/generated/system-proxy.d.ts.map +1 -1
  53. package/dist/health/wiring-health.d.ts +136 -0
  54. package/dist/health/wiring-health.d.ts.map +1 -0
  55. package/dist/{index-QRlzao1I.mjs → index-C2zzIDdX.mjs} +829 -420
  56. package/dist/index-C2zzIDdX.mjs.map +1 -0
  57. package/dist/{index-CMM1Y9W6.js → index-DnpdVFKv.js} +458 -49
  58. package/dist/index-DnpdVFKv.js.map +1 -0
  59. package/dist/index.d.ts +2 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +176 -4
  62. package/dist/index.js.map +1 -1
  63. package/dist/index.mjs +487 -315
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/interfaces/addon.d.ts +1 -1
  66. package/dist/interfaces/addon.d.ts.map +1 -1
  67. package/dist/interfaces/capability.d.ts +17 -0
  68. package/dist/interfaces/capability.d.ts.map +1 -1
  69. package/dist/interfaces/event-bus.d.ts +56 -1
  70. package/dist/interfaces/event-bus.d.ts.map +1 -1
  71. package/dist/interfaces/stream-broker.d.ts +21 -1
  72. package/dist/interfaces/stream-broker.d.ts.map +1 -1
  73. package/dist/node.js +1 -1
  74. package/dist/node.mjs +1 -1
  75. package/dist/readiness/readiness-registry.d.ts.map +1 -1
  76. package/dist/schemas/auth-records.d.ts +4 -4
  77. package/dist/types/io.d.ts +13 -1
  78. package/dist/types/io.d.ts.map +1 -1
  79. package/dist/utils/privacy-grid-raster.d.ts +48 -0
  80. package/dist/utils/privacy-grid-raster.d.ts.map +1 -0
  81. package/package.json +1 -1
  82. package/dist/index-CMM1Y9W6.js.map +0 -1
  83. package/dist/index-QRlzao1I.mjs.map +0 -1
@@ -1,5 +1,36 @@
1
1
  "use strict";
2
2
  const zod = require("zod");
3
+ const wiringProbeKindSchema = zod.z.enum(["singleton", "device", "widget"]);
4
+ const wiringProbeResultSchema = zod.z.object({
5
+ capName: zod.z.string(),
6
+ kind: wiringProbeKindSchema,
7
+ deviceId: zod.z.number().optional(),
8
+ reachable: zod.z.boolean(),
9
+ latencyMs: zod.z.number(),
10
+ error: zod.z.string().optional()
11
+ });
12
+ const wiringAddonHealthSchema = zod.z.object({
13
+ addonId: zod.z.string(),
14
+ caps: zod.z.array(wiringProbeResultSchema).readonly(),
15
+ widgets: zod.z.array(wiringProbeResultSchema).readonly()
16
+ });
17
+ const wiringNodeHealthSchema = zod.z.object({
18
+ nodeId: zod.z.string(),
19
+ addons: zod.z.array(wiringAddonHealthSchema).readonly()
20
+ });
21
+ const wiringHealthSnapshotSchema = zod.z.object({
22
+ /** True only when every probed target is reachable. */
23
+ ok: zod.z.boolean(),
24
+ /** True when at least one target is unreachable. */
25
+ degraded: zod.z.boolean(),
26
+ checkedAt: zod.z.string(),
27
+ nodes: zod.z.array(wiringNodeHealthSchema).readonly(),
28
+ summary: zod.z.object({
29
+ total: zod.z.number(),
30
+ reachable: zod.z.number(),
31
+ unreachable: zod.z.number()
32
+ })
33
+ });
3
34
  const MODEL_FORMATS = ["onnx", "coreml", "openvino", "tflite", "pt"];
4
35
  const WELL_KNOWN_TABS = [
5
36
  { id: "overview", label: "Overview", icon: "layout-dashboard", order: -10 },
@@ -1739,7 +1770,7 @@ const SpatialDetectionSchema = zod.z.object({
1739
1770
  bbox: BoundingBoxSchema
1740
1771
  });
1741
1772
  const AudioChunkInputSchema = zod.z.object({
1742
- data: zod.z.instanceof(Float32Array),
1773
+ data: zod.z.instanceof(Uint8Array),
1743
1774
  sampleRate: zod.z.number(),
1744
1775
  channels: zod.z.number(),
1745
1776
  timestamp: zod.z.number(),
@@ -2422,7 +2453,23 @@ const RunnerCameraConfigSchema = zod.z.object({
2422
2453
  * whenever its `zones` device-state slice changes, so the runner's
2423
2454
  * copy stays in sync. Empty array → no zone filtering.
2424
2455
  */
2425
- zones: zod.z.array(ZoneSchema).readonly().default([])
2456
+ zones: zod.z.array(ZoneSchema).readonly().default([]),
2457
+ /**
2458
+ * When true (default) and the camera's `motionSources` contains only
2459
+ * `'onboard'`, the runner dynamically opens the same WASM frame-diff
2460
+ * motion-frames subscription on each `MotionOnMotionChanged
2461
+ * source:'onboard'` event and tears it down after `motionCooldownMs`.
2462
+ * This causes `runMotionAnalysis` to emit `MotionZonesRaw` /
2463
+ * `MotionAnalysis` during active-motion windows without the
2464
+ * substream being held open continuously.
2465
+ *
2466
+ * Set to `false` to disable the dynamic analyzer for this camera
2467
+ * (e.g. very low-bandwidth links where the extra substream is
2468
+ * undesirable). Has no effect when `motionSources` already includes
2469
+ * `'analyzer'` — the analyzer runs continuously in that case and
2470
+ * this gate is bypassed.
2471
+ */
2472
+ onboardMotionDrivesAnalyzer: zod.z.boolean().default(true)
2426
2473
  });
2427
2474
  const RunnerCameraDeviceUIFields = [
2428
2475
  {
@@ -2482,6 +2529,16 @@ const RunnerCameraDeviceUIFields = [
2482
2529
  showValue: true,
2483
2530
  unit: "s",
2484
2531
  displayScale: 1e3
2532
+ },
2533
+ // Only meaningful for onboard-only cameras — when `motionSources`
2534
+ // contains `'analyzer'` the analyzer runs continuously already.
2535
+ {
2536
+ key: "onboardMotionDrivesAnalyzer",
2537
+ type: "boolean",
2538
+ label: "Run motion analyzer on onboard motion",
2539
+ description: "When onboard motion is detected, temporarily start the frame-diff analyzer to emit zone results. Stops after the motion cooldown window.",
2540
+ default: true,
2541
+ showWhen: { field: "motionSources", includes: "onboard" }
2485
2542
  }
2486
2543
  ];
2487
2544
  const RunnerLocalLoadSchema = zod.z.object({
@@ -2660,22 +2717,68 @@ const motionTriggerCapability = {
2660
2717
  },
2661
2718
  runtimeState: MotionTriggerRuntimeStateSchema
2662
2719
  };
2720
+ const MaskPointSchema = zod.z.object({
2721
+ x: zod.z.number(),
2722
+ y: zod.z.number()
2723
+ });
2724
+ const MaskRectShapeSchema = zod.z.object({
2725
+ kind: zod.z.literal("rect"),
2726
+ x: zod.z.number(),
2727
+ y: zod.z.number(),
2728
+ width: zod.z.number(),
2729
+ height: zod.z.number()
2730
+ });
2731
+ const MaskPolygonShapeSchema = zod.z.object({
2732
+ kind: zod.z.literal("polygon"),
2733
+ points: zod.z.array(MaskPointSchema)
2734
+ });
2735
+ const MaskGridShapeSchema = zod.z.object({
2736
+ kind: zod.z.literal("grid"),
2737
+ gridWidth: zod.z.number(),
2738
+ gridHeight: zod.z.number(),
2739
+ cells: zod.z.array(zod.z.boolean())
2740
+ });
2741
+ const MaskLineShapeSchema = zod.z.object({
2742
+ kind: zod.z.literal("line"),
2743
+ points: zod.z.array(MaskPointSchema)
2744
+ });
2745
+ const MaskShapeSchema = zod.z.discriminatedUnion("kind", [
2746
+ MaskRectShapeSchema,
2747
+ MaskPolygonShapeSchema,
2748
+ MaskGridShapeSchema,
2749
+ MaskLineShapeSchema
2750
+ ]);
2751
+ const MaskShapeKindSchema = zod.z.enum(["rect", "polygon", "grid", "line"]);
2752
+ const MaskPolygonVerticesSchema = zod.z.object({
2753
+ min: zod.z.number(),
2754
+ max: zod.z.number()
2755
+ });
2756
+ const MaskGridDimsSchema = zod.z.object({
2757
+ width: zod.z.number(),
2758
+ height: zod.z.number()
2759
+ });
2760
+ const MotionZoneRegionSchema = zod.z.object({
2761
+ id: zod.z.number(),
2762
+ enabled: zod.z.boolean(),
2763
+ shape: MaskGridShapeSchema
2764
+ });
2663
2765
  const MotionZoneStatusSchema = zod.z.object({
2664
2766
  enabled: zod.z.boolean(),
2665
2767
  sensitivity: zod.z.number(),
2666
- /** Row-major active-cell grid. Length = gridWidth*gridHeight (see getOptions). */
2667
- cells: zod.z.array(zod.z.boolean()),
2768
+ /** Grid region(s). Today exactly one `grid` shape. */
2769
+ regions: zod.z.array(MotionZoneRegionSchema),
2668
2770
  lastFetchedAt: zod.z.number()
2669
2771
  });
2670
2772
  const MotionZoneOptionsSchema = zod.z.object({
2671
- gridWidth: zod.z.number(),
2672
- gridHeight: zod.z.number(),
2773
+ maxRegions: zod.z.number(),
2774
+ supportedShapes: zod.z.array(MaskShapeKindSchema),
2775
+ grid: MaskGridDimsSchema,
2673
2776
  sensitivity: zod.z.object({ min: zod.z.number(), max: zod.z.number(), step: zod.z.number() })
2674
2777
  });
2675
2778
  const MotionZonePatchSchema = zod.z.object({
2676
2779
  enabled: zod.z.boolean().optional(),
2677
2780
  sensitivity: zod.z.number().optional(),
2678
- cells: zod.z.array(zod.z.boolean()).optional()
2781
+ regions: zod.z.array(MotionZoneRegionSchema).optional()
2679
2782
  });
2680
2783
  const motionZonesCapability = {
2681
2784
  name: "motion-zones",
@@ -2696,6 +2799,118 @@ const motionZonesCapability = {
2696
2799
  status: { schema: MotionZoneStatusSchema, kind: "poll" },
2697
2800
  runtimeState: MotionZoneStatusSchema
2698
2801
  };
2802
+ const NativeObjectClassEnum = zod.z.enum([
2803
+ "person",
2804
+ "vehicle",
2805
+ "animal",
2806
+ "face",
2807
+ "package",
2808
+ "other"
2809
+ ]);
2810
+ const NativeDetectionSchema = zod.z.object({
2811
+ class: NativeObjectClassEnum,
2812
+ timestamp: zod.z.number(),
2813
+ /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
2814
+ confidence: zod.z.number().min(0).max(1).optional()
2815
+ });
2816
+ const NativeObjectDetectionStatusSchema = zod.z.object({
2817
+ /**
2818
+ * Last observed instance per class. Missing entries mean the class
2819
+ * is supported but nothing has been seen since the provider started.
2820
+ *
2821
+ * MUST be a partial record: providers seed an empty `{}` on cold-start
2822
+ * and write one class at a time as detections arrive. In Zod 4
2823
+ * `z.record(enum, …)` is EXHAUSTIVE (requires every enum key), so a
2824
+ * partial write throws "expected object, received undefined" for every
2825
+ * unseen class. `z.partialRecord` keeps the enum-key narrowing while
2826
+ * allowing the sparse shape the providers actually write.
2827
+ */
2828
+ lastByClass: zod.z.partialRecord(NativeObjectClassEnum, NativeDetectionSchema.nullable()),
2829
+ /** Classes the firmware is capable of detecting — enumerated at device register. */
2830
+ supportedClasses: zod.z.array(NativeObjectClassEnum).readonly(),
2831
+ /**
2832
+ * Whether forwarding of onboard AI detections is enabled for this device.
2833
+ * Default true (on cold-start) — detections flow unconditionally before
2834
+ * the toggle is saved, so defaulting true preserves existing behaviour.
2835
+ */
2836
+ enabled: zod.z.boolean()
2837
+ });
2838
+ const NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
2839
+ /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
2840
+ lastFetchedAt: zod.z.number()
2841
+ });
2842
+ const nativeObjectDetectionCapability = {
2843
+ name: "native-object-detection",
2844
+ scope: "device",
2845
+ mode: "singleton",
2846
+ deviceTypes: [DeviceType.Camera],
2847
+ methods: {
2848
+ setEnabled: method(
2849
+ zod.z.object({ deviceId: zod.z.number(), enabled: zod.z.boolean() }),
2850
+ zod.z.void(),
2851
+ { kind: "mutation", auth: "admin" }
2852
+ )
2853
+ },
2854
+ events: {
2855
+ onDetected: { data: zod.z.object({
2856
+ deviceId: zod.z.number(),
2857
+ detection: NativeDetectionSchema
2858
+ }) }
2859
+ },
2860
+ status: {
2861
+ schema: NativeObjectDetectionStatusSchema,
2862
+ kind: "push"
2863
+ },
2864
+ runtimeState: NativeObjectDetectionRuntimeStateSchema
2865
+ };
2866
+ const PrivacyMaskShapeSchema = zod.z.discriminatedUnion("kind", [
2867
+ MaskRectShapeSchema,
2868
+ MaskPolygonShapeSchema
2869
+ ]);
2870
+ const PrivacyMaskRegionSchema = zod.z.object({
2871
+ /** Slot id, 0-based. Stable across read/write. */
2872
+ id: zod.z.number(),
2873
+ /** Whether this zone is active (blanked out by the camera). */
2874
+ enabled: zod.z.boolean(),
2875
+ shape: PrivacyMaskShapeSchema
2876
+ });
2877
+ const PrivacyMaskStatusSchema = zod.z.object({
2878
+ enabled: zod.z.boolean(),
2879
+ /** Active zones (normalized 0..1). Length ≤ maxRegions. */
2880
+ regions: zod.z.array(PrivacyMaskRegionSchema),
2881
+ lastFetchedAt: zod.z.number()
2882
+ });
2883
+ const PrivacyMaskOptionsSchema = zod.z.object({
2884
+ /** Maximum number of supported zones. */
2885
+ maxRegions: zod.z.number(),
2886
+ /** Shape kinds this camera accepts — Reolink: ['rect']; Hikvision: ['rect','polygon']. */
2887
+ supportedShapes: zod.z.array(MaskShapeKindSchema),
2888
+ /** Polygon vertex bounds when 'polygon' is supported (Hikvision: {min:4,max:4}). */
2889
+ polygonVertices: MaskPolygonVerticesSchema.optional()
2890
+ });
2891
+ const PrivacyMaskPatchSchema = zod.z.object({
2892
+ enabled: zod.z.boolean().optional(),
2893
+ regions: zod.z.array(PrivacyMaskRegionSchema).optional()
2894
+ });
2895
+ const privacyMaskCapability = {
2896
+ name: "privacy-mask",
2897
+ scope: "device",
2898
+ mode: "singleton",
2899
+ deviceTypes: [DeviceType.Camera],
2900
+ deviceConfig: {
2901
+ ui: { kind: "widget", widgetId: "host/privacy-mask-grid", tab: "image", label: "Privacy Mask" }
2902
+ },
2903
+ methods: {
2904
+ getOptions: method(zod.z.object({ deviceId: zod.z.number() }), PrivacyMaskOptionsSchema),
2905
+ setMask: method(
2906
+ zod.z.object({ deviceId: zod.z.number(), patch: PrivacyMaskPatchSchema }),
2907
+ zod.z.void(),
2908
+ { kind: "mutation", auth: "admin" }
2909
+ )
2910
+ },
2911
+ status: { schema: PrivacyMaskStatusSchema, kind: "poll" },
2912
+ runtimeState: PrivacyMaskStatusSchema
2913
+ };
2699
2914
  const AutotrackTargetTypeSchema = zod.z.string().describe("Vendor target string (people/vehicle/pet); empty = camera default");
2700
2915
  const PtzAutotrackSettingsSchema = zod.z.object({
2701
2916
  targetType: AutotrackTargetTypeSchema,
@@ -3287,7 +3502,8 @@ const addonSettingsCapability = {
3287
3502
  zod.z.object({
3288
3503
  addonId: zod.z.string(),
3289
3504
  nodeId: zod.z.string().optional(),
3290
- overlay: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
3505
+ overlay: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
3506
+ cap: zod.z.string().optional()
3291
3507
  }),
3292
3508
  SettingsSchemaWithValuesSchema.nullable()
3293
3509
  ),
@@ -4046,7 +4262,14 @@ const OauthIntegrationDescriptorSchema = zod.z.object({
4046
4262
  /** Allowed redirect_uri prefixes. /api/oauth2/authorize rejects any
4047
4263
  * redirect_uri that does not start with one of these. Required —
4048
4264
  * an empty list means the integration can never complete linking. */
4049
- allowedRedirectPrefixes: zod.z.array(zod.z.string()).min(1)
4265
+ allowedRedirectPrefixes: zod.z.array(zod.z.string()).min(1),
4266
+ /** Optional public origin (no trailing slash) that this integration's
4267
+ * issued codes/tokens should carry as the `hubUrl` claim — typically the
4268
+ * operator-selected external-access endpoint resolved by the addon. When
4269
+ * present, /api/oauth2/authorize bakes THIS into the code instead of the
4270
+ * hub-global `publicHubUrl()`, so a forked exporter addon (which can't set
4271
+ * the hub's env) drives the claim that its cloud Lambda routes back on. */
4272
+ hubUrl: zod.z.string().optional()
4050
4273
  });
4051
4274
  const oauthIntegrationCapability = {
4052
4275
  name: "oauth-integration",
@@ -4750,7 +4973,20 @@ const webrtcSessionCapability = {
4750
4973
  zod.z.object({
4751
4974
  deviceId: zod.z.number().int().nonnegative(),
4752
4975
  target: WebrtcStreamTargetSchema,
4753
- hints: webrtcClientHintsSchema.optional()
4976
+ hints: webrtcClientHintsSchema.optional(),
4977
+ /**
4978
+ * SERVER-INJECTED — NOT a client hint. The hub layer that holds
4979
+ * the tRPC request context (and therefore the client IP) sets
4980
+ * this to `true` when the viewer's source IP is non-LAN
4981
+ * (4G/CGNAT/internet). The broker then forces TURN-relay-only
4982
+ * ICE for the session so a CGNAT client (which can only offer a
4983
+ * relay candidate) gets a clean relay↔relay media path instead
4984
+ * of werift nominating a dead host/hairpin-srflx pair. LAN
4985
+ * clients leave this absent/false and keep the low-latency
4986
+ * direct (host/srflx) path. Clients MUST NOT send this — the
4987
+ * server overwrites it from the request context.
4988
+ */
4989
+ relayOnly: zod.z.boolean().optional()
4754
4990
  }),
4755
4991
  zod.z.object({ sessionId: zod.z.string(), sdpOffer: zod.z.string() }),
4756
4992
  { kind: "mutation" }
@@ -4773,7 +5009,22 @@ const webrtcSessionCapability = {
4773
5009
  deviceId: zod.z.number().int().nonnegative(),
4774
5010
  target: WebrtcStreamTargetSchema.optional(),
4775
5011
  sdpOffer: zod.z.string(),
4776
- sessionId: zod.z.string().optional()
5012
+ sessionId: zod.z.string().optional(),
5013
+ /**
5014
+ * Force TURN-relay-only ICE for this session. Two kinds of caller
5015
+ * set it:
5016
+ * - A cloud peer like Alexa's RTCSessionController (reachable
5017
+ * only via TURN, never our host/srflx behind NAT) passes
5018
+ * `true` from its own trusted addon context.
5019
+ * - The hub injects it for browser client-offer viewers from the
5020
+ * request's source IP (non-LAN ⇒ true), exactly as it does for
5021
+ * `createSession`.
5022
+ * A LAN/Tailscale browser doing client-offer passthrough leaves it
5023
+ * absent/false so a direct host pair carries full native quality.
5024
+ * Untrusted browser clients MUST NOT send it — the hub overwrites
5025
+ * it from the request context.
5026
+ */
5027
+ relayOnly: zod.z.boolean().optional()
4777
5028
  }),
4778
5029
  zod.z.object({ sessionId: zod.z.string(), sdpAnswer: zod.z.string() }),
4779
5030
  { kind: "mutation" }
@@ -4787,6 +5038,46 @@ const webrtcSessionCapability = {
4787
5038
  zod.z.void(),
4788
5039
  { kind: "mutation" }
4789
5040
  ),
5041
+ /**
5042
+ * Trickle ICE — add a remote (client) ICE candidate to a live session.
5043
+ * Lets the client send its SDP offer/answer IMMEDIATELY (before ICE
5044
+ * gathering finishes) and deliver candidates as they arrive, so the
5045
+ * connection establishes in ~0s instead of waiting for full gathering.
5046
+ * The dual of `getIceCandidates`. Mirrors Scrypted's signaling.
5047
+ */
5048
+ addIceCandidate: method(
5049
+ zod.z.object({
5050
+ deviceId: zod.z.number().int().nonnegative(),
5051
+ sessionId: zod.z.string(),
5052
+ candidate: zod.z.string(),
5053
+ sdpMid: zod.z.string().nullable().optional(),
5054
+ sdpMLineIndex: zod.z.number().int().nullable().optional()
5055
+ }),
5056
+ zod.z.void(),
5057
+ { kind: "mutation" }
5058
+ ),
5059
+ /**
5060
+ * Trickle ICE — poll the server's gathered ICE candidates for a session.
5061
+ * The server answers immediately (no gathering wait) and the client polls
5062
+ * this to receive host/srflx/relay candidates as werift gathers them,
5063
+ * adding each to its PeerConnection. Returns all candidates gathered so
5064
+ * far; the client dedupes. `done` flips true once gathering completes.
5065
+ */
5066
+ getIceCandidates: method(
5067
+ zod.z.object({
5068
+ deviceId: zod.z.number().int().nonnegative(),
5069
+ sessionId: zod.z.string()
5070
+ }),
5071
+ zod.z.object({
5072
+ candidates: zod.z.array(zod.z.object({
5073
+ candidate: zod.z.string(),
5074
+ sdpMid: zod.z.string().nullable(),
5075
+ sdpMLineIndex: zod.z.number().int().nullable()
5076
+ })),
5077
+ done: zod.z.boolean()
5078
+ }),
5079
+ { kind: "query" }
5080
+ ),
4790
5081
  closeSession: method(
4791
5082
  zod.z.object({
4792
5083
  deviceId: zod.z.number().int().nonnegative(),
@@ -6539,6 +6830,16 @@ const detectionPipelineCapability = {
6539
6830
  exposesDeviceSettings: true,
6540
6831
  methods: {}
6541
6832
  };
6833
+ const cameraPipelineConfigCapability = {
6834
+ name: "camera-pipeline-config",
6835
+ scope: "device",
6836
+ mode: "singleton",
6837
+ kind: "wrapper",
6838
+ defaultActive: true,
6839
+ deviceTypes: [DeviceType.Camera],
6840
+ exposesDeviceSettings: true,
6841
+ methods: {}
6842
+ };
6542
6843
  const TrackStateSchema = zod.z.enum(["new", "entered", "left", "moving", "idle"]);
6543
6844
  const EventKindSchema = zod.z.enum(["motion", "object", "audio"]);
6544
6845
  const TrackPositionSchema = zod.z.object({
@@ -7455,44 +7756,31 @@ const intercomCapability = {
7455
7756
  kind: "command-driven"
7456
7757
  }
7457
7758
  };
7458
- const NativeObjectClassEnum = zod.z.enum([
7459
- "person",
7460
- "vehicle",
7461
- "animal",
7462
- "face",
7463
- "package",
7464
- "other"
7465
- ]);
7466
- const NativeDetectionSchema = zod.z.object({
7467
- class: NativeObjectClassEnum,
7468
- timestamp: zod.z.number(),
7469
- /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
7470
- confidence: zod.z.number().min(0).max(1).optional()
7471
- });
7472
- const NativeObjectDetectionStatusSchema = zod.z.object({
7473
- /**
7474
- * Last observed instance per class. Undefined entries mean the class
7475
- * is supported but nothing has been seen since the provider started.
7476
- */
7477
- lastByClass: zod.z.record(NativeObjectClassEnum, NativeDetectionSchema.nullable()),
7478
- /** Classes the firmware is capable of detecting — enumerated at device register. */
7479
- supportedClasses: zod.z.array(NativeObjectClassEnum).readonly()
7759
+ const CamStreamDescriptorSchema = zod.z.object({
7760
+ camStreamId: zod.z.string().min(1),
7761
+ kind: CamStreamKindSchema,
7762
+ url: zod.z.string().optional(),
7763
+ codec: zod.z.string().optional(),
7764
+ resolution: CamStreamResolutionSchema.optional(),
7765
+ fps: zod.z.number().positive().optional(),
7766
+ label: zod.z.string().optional(),
7767
+ /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
7768
+ deviceFeatures: zod.z.array(zod.z.string()).optional(),
7769
+ /** Eligible for automatic profile assignment. Absent = `true`. */
7770
+ autoEligible: zod.z.boolean().optional(),
7771
+ /** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
7772
+ metadata: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
7480
7773
  });
7481
- const nativeObjectDetectionCapability = {
7482
- name: "native-object-detection",
7774
+ const streamCatalogCapability = {
7775
+ name: "stream-catalog",
7483
7776
  scope: "device",
7484
7777
  mode: "singleton",
7485
7778
  deviceTypes: [DeviceType.Camera],
7486
- methods: {},
7487
- events: {
7488
- onDetected: { data: zod.z.object({
7489
- deviceId: zod.z.number(),
7490
- detection: NativeDetectionSchema
7491
- }) }
7492
- },
7493
- status: {
7494
- schema: NativeObjectDetectionStatusSchema,
7495
- kind: "push"
7779
+ methods: {
7780
+ getCatalog: method(
7781
+ zod.z.object({ deviceId: zod.z.number().int().nonnegative() }),
7782
+ zod.z.array(CamStreamDescriptorSchema).readonly()
7783
+ )
7496
7784
  }
7497
7785
  };
7498
7786
  const ModelFormatSchema = zod.z.enum(MODEL_FORMATS);
@@ -8729,7 +9017,8 @@ const PackageUpdateSchema = zod.z.object({
8729
9017
  currentVersion: zod.z.string(),
8730
9018
  latestVersion: zod.z.string(),
8731
9019
  category: zod.z.enum(["addon", "core"]),
8732
- requiresRestart: zod.z.boolean()
9020
+ requiresRestart: zod.z.boolean(),
9021
+ isSystem: zod.z.boolean()
8733
9022
  });
8734
9023
  const PackageVersionInfoSchema = zod.z.object({
8735
9024
  version: zod.z.string(),
@@ -8762,6 +9051,42 @@ const UpdateFrameworkPackageResultSchema = zod.z.object({
8762
9051
  /** Ms-epoch the server scheduled its self-restart. */
8763
9052
  restartingAt: zod.z.number()
8764
9053
  });
9054
+ const BulkUpdateItemStatusSchema = zod.z.enum([
9055
+ "queued",
9056
+ "updating",
9057
+ "done",
9058
+ "done-pending-restart",
9059
+ "failed"
9060
+ ]);
9061
+ const BulkUpdateItemSchema = zod.z.object({
9062
+ name: zod.z.string(),
9063
+ isSystem: zod.z.boolean(),
9064
+ fromVersion: zod.z.string(),
9065
+ toVersion: zod.z.string(),
9066
+ status: BulkUpdateItemStatusSchema,
9067
+ error: zod.z.string().optional(),
9068
+ startedAtMs: zod.z.number().optional(),
9069
+ completedAtMs: zod.z.number().optional()
9070
+ });
9071
+ const BulkUpdatePhaseSchema = zod.z.enum([
9072
+ "regular",
9073
+ "system",
9074
+ "restarting",
9075
+ "finalizing"
9076
+ ]);
9077
+ const BulkUpdateStateSchema = zod.z.object({
9078
+ id: zod.z.string(),
9079
+ nodeId: zod.z.string(),
9080
+ startedAtMs: zod.z.number(),
9081
+ completedAtMs: zod.z.number().optional(),
9082
+ total: zod.z.number(),
9083
+ completed: zod.z.number(),
9084
+ failed: zod.z.number(),
9085
+ current: zod.z.string().nullable(),
9086
+ phase: BulkUpdatePhaseSchema,
9087
+ cancelled: zod.z.boolean(),
9088
+ items: zod.z.array(BulkUpdateItemSchema).readonly()
9089
+ });
8765
9090
  const FrameworkPackageStatusSchema = zod.z.object({
8766
9091
  packageName: zod.z.string(),
8767
9092
  currentVersion: zod.z.string(),
@@ -8903,7 +9228,7 @@ const addonsCapability = {
8903
9228
  getLastRestart: method(
8904
9229
  zod.z.void(),
8905
9230
  zod.z.object({
8906
- kind: zod.z.enum(["framework-update", "manual", "system"]),
9231
+ kind: zod.z.enum(["framework-update", "manual", "system", "framework-bulk-update"]),
8907
9232
  packageName: zod.z.string().optional(),
8908
9233
  fromVersion: zod.z.string().optional(),
8909
9234
  toVersion: zod.z.string().optional(),
@@ -8993,11 +9318,70 @@ const addonsCapability = {
8993
9318
  updateFrameworkPackage: method(
8994
9319
  zod.z.object({
8995
9320
  packageName: zod.z.string().min(1),
8996
- version: zod.z.string().optional()
9321
+ version: zod.z.string().optional(),
9322
+ deferRestart: zod.z.boolean().optional()
8997
9323
  }),
8998
9324
  UpdateFrameworkPackageResultSchema,
8999
9325
  { kind: "mutation", auth: "admin" }
9000
9326
  ),
9327
+ /**
9328
+ * Kicks off a server-side bulk update operation and returns the bulk
9329
+ * id immediately. The operation runs asynchronously; observe progress
9330
+ * via the `AddonsBulkUpdateProgress` event or `getBulkUpdateState`.
9331
+ * Items with `isSystem: true` use `deferRestart` — the hub restarts
9332
+ * ONCE at the end of the system phase, after all system packages are
9333
+ * installed.
9334
+ *
9335
+ * `items[].version` is REQUIRED — callers must pass the resolved
9336
+ * version from `listUpdates`. There is no `'latest'` default here
9337
+ * (unlike `updatePackage`) to guarantee deterministic bulk rolls.
9338
+ */
9339
+ startBulkUpdate: method(
9340
+ zod.z.object({
9341
+ nodeId: zod.z.string(),
9342
+ items: zod.z.array(zod.z.object({
9343
+ name: zod.z.string(),
9344
+ version: zod.z.string(),
9345
+ isSystem: zod.z.boolean()
9346
+ })).readonly()
9347
+ }),
9348
+ zod.z.object({ id: zod.z.string() }),
9349
+ { kind: "mutation", auth: "admin" }
9350
+ ),
9351
+ /**
9352
+ * Returns the current state of a bulk update by id.
9353
+ * Returns `null` if the id is unknown or has been auto-cleaned
9354
+ * (5 minutes after `completedAt` the record is evicted from memory).
9355
+ */
9356
+ getBulkUpdateState: method(
9357
+ zod.z.object({ id: zod.z.string() }),
9358
+ BulkUpdateStateSchema.nullable(),
9359
+ { auth: "admin" }
9360
+ ),
9361
+ /**
9362
+ * Cancels an in-flight bulk update. The update loop exits after the
9363
+ * currently-processing item completes — cancellation is not
9364
+ * instantaneous. Has no effect once the `restarting` phase has been
9365
+ * entered (the hub is already shutting down at that point).
9366
+ * Returns `{ cancelled: false }` if the id is unknown, the operation
9367
+ * has already completed, or the `restarting` phase is active.
9368
+ */
9369
+ cancelBulkUpdate: method(
9370
+ zod.z.object({ id: zod.z.string() }),
9371
+ zod.z.object({ cancelled: zod.z.boolean() }),
9372
+ { kind: "mutation", auth: "admin" }
9373
+ ),
9374
+ /**
9375
+ * Lists all currently active (non-completed) bulk updates.
9376
+ * If `nodeId` is provided, filters to only bulk updates targeting
9377
+ * that node. Useful for restoring an in-progress banner on a fresh
9378
+ * page load when the UI reconnects mid-operation.
9379
+ */
9380
+ listActiveBulkUpdates: method(
9381
+ zod.z.object({ nodeId: zod.z.string().optional() }),
9382
+ zod.z.array(BulkUpdateStateSchema).readonly(),
9383
+ { auth: "admin" }
9384
+ ),
9001
9385
  getVersions: method(
9002
9386
  zod.z.object({ name: zod.z.string() }),
9003
9387
  zod.z.array(PackageVersionInfoSchema).readonly()
@@ -9137,6 +9521,7 @@ exports.BrokerStatsSchema = BrokerStatsSchema;
9137
9521
  exports.BrokerStatusSchema = BrokerStatusSchema$1;
9138
9522
  exports.CAM_PROFILE_ORDER = CAM_PROFILE_ORDER;
9139
9523
  exports.CamProfileSchema = CamProfileSchema;
9524
+ exports.CamStreamDescriptorSchema = CamStreamDescriptorSchema;
9140
9525
  exports.CamStreamKindSchema = CamStreamKindSchema;
9141
9526
  exports.CamStreamResolutionSchema = CamStreamResolutionSchema;
9142
9527
  exports.CameraCredentialsSchema = CameraCredentialsSchema;
@@ -9221,6 +9606,15 @@ exports.LogEntrySchema = LogEntrySchema;
9221
9606
  exports.LogLevelSchema = LogLevelSchema$1;
9222
9607
  exports.LogStreamEntrySchema = LogStreamEntrySchema;
9223
9608
  exports.MODEL_FORMATS = MODEL_FORMATS;
9609
+ exports.MaskGridDimsSchema = MaskGridDimsSchema;
9610
+ exports.MaskGridShapeSchema = MaskGridShapeSchema;
9611
+ exports.MaskLineShapeSchema = MaskLineShapeSchema;
9612
+ exports.MaskPointSchema = MaskPointSchema;
9613
+ exports.MaskPolygonShapeSchema = MaskPolygonShapeSchema;
9614
+ exports.MaskPolygonVerticesSchema = MaskPolygonVerticesSchema;
9615
+ exports.MaskRectShapeSchema = MaskRectShapeSchema;
9616
+ exports.MaskShapeKindSchema = MaskShapeKindSchema;
9617
+ exports.MaskShapeSchema = MaskShapeSchema;
9224
9618
  exports.MediaFileSchema = MediaFileSchema;
9225
9619
  exports.MeshPeerSchema = MeshPeerSchema;
9226
9620
  exports.MeshStatusSchema = MeshStatusSchema;
@@ -9236,9 +9630,11 @@ exports.MotionTriggerRuntimeStateSchema = MotionTriggerRuntimeStateSchema;
9236
9630
  exports.MotionTriggerStatusSchema = MotionTriggerStatusSchema;
9237
9631
  exports.MotionZoneOptionsSchema = MotionZoneOptionsSchema;
9238
9632
  exports.MotionZonePatchSchema = MotionZonePatchSchema;
9633
+ exports.MotionZoneRegionSchema = MotionZoneRegionSchema;
9239
9634
  exports.MotionZoneStatusSchema = MotionZoneStatusSchema;
9240
9635
  exports.NativeDetectionSchema = NativeDetectionSchema;
9241
9636
  exports.NativeObjectClassEnum = NativeObjectClassEnum;
9637
+ exports.NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionRuntimeStateSchema;
9242
9638
  exports.NativeObjectDetectionStatusSchema = NativeObjectDetectionStatusSchema;
9243
9639
  exports.NetworkAccessStatusSchema = NetworkAccessStatusSchema;
9244
9640
  exports.NetworkAddressSchema = NetworkAddressSchema;
@@ -9268,6 +9664,11 @@ exports.PipelineRunResultBridge = PipelineRunResultBridge;
9268
9664
  exports.PipelineStepInputSchema = PipelineStepInputSchema;
9269
9665
  exports.PlaceholderReasonSchema = PlaceholderReasonSchema;
9270
9666
  exports.PolygonPointSchema = PolygonPointSchema;
9667
+ exports.PrivacyMaskOptionsSchema = PrivacyMaskOptionsSchema;
9668
+ exports.PrivacyMaskPatchSchema = PrivacyMaskPatchSchema;
9669
+ exports.PrivacyMaskRegionSchema = PrivacyMaskRegionSchema;
9670
+ exports.PrivacyMaskShapeSchema = PrivacyMaskShapeSchema;
9671
+ exports.PrivacyMaskStatusSchema = PrivacyMaskStatusSchema;
9271
9672
  exports.ProfileSlotSchema = ProfileSlotSchema;
9272
9673
  exports.ProfileSlotStatusSchema = ProfileSlotStatusSchema;
9273
9674
  exports.ProviderInfoSchema = ProviderInfoSchema;
@@ -9382,6 +9783,7 @@ exports.backupCapability = backupCapability;
9382
9783
  exports.batteryCapability = batteryCapability;
9383
9784
  exports.brightnessCapability = brightnessCapability;
9384
9785
  exports.cameraCredentialsCapability = cameraCredentialsCapability;
9786
+ exports.cameraPipelineConfigCapability = cameraPipelineConfigCapability;
9385
9787
  exports.cameraStreamsCapability = cameraStreamsCapability;
9386
9788
  exports.decoderCapability = decoderCapability;
9387
9789
  exports.detectionPipelineCapability = detectionPipelineCapability;
@@ -9428,6 +9830,7 @@ exports.pipelineExecutorCapability = pipelineExecutorCapability;
9428
9830
  exports.pipelineOrchestratorCapability = pipelineOrchestratorCapability;
9429
9831
  exports.pipelineRunnerCapability = pipelineRunnerCapability;
9430
9832
  exports.platformProbeCapability = platformProbeCapability;
9833
+ exports.privacyMaskCapability = privacyMaskCapability;
9431
9834
  exports.ptzAutotrackCapability = ptzAutotrackCapability;
9432
9835
  exports.ptzCapability = ptzCapability;
9433
9836
  exports.rebootCapability = rebootCapability;
@@ -9443,6 +9846,7 @@ exports.ssoBridgeCapability = ssoBridgeCapability;
9443
9846
  exports.storageCapability = storageCapability;
9444
9847
  exports.storageProviderCapability = storageProviderCapability;
9445
9848
  exports.streamBrokerCapability = streamBrokerCapability;
9849
+ exports.streamCatalogCapability = streamCatalogCapability;
9446
9850
  exports.streamParamsCapability = streamParamsCapability;
9447
9851
  exports.streamingEngineCapability = streamingEngineCapability;
9448
9852
  exports.switchCapability = switchCapability;
@@ -9454,7 +9858,12 @@ exports.userPasskeysCapability = userPasskeysCapability;
9454
9858
  exports.webrtcCapability = webrtcCapability;
9455
9859
  exports.webrtcClientHintsSchema = webrtcClientHintsSchema;
9456
9860
  exports.webrtcSessionCapability = webrtcSessionCapability;
9861
+ exports.wiringAddonHealthSchema = wiringAddonHealthSchema;
9862
+ exports.wiringHealthSnapshotSchema = wiringHealthSnapshotSchema;
9863
+ exports.wiringNodeHealthSchema = wiringNodeHealthSchema;
9864
+ exports.wiringProbeKindSchema = wiringProbeKindSchema;
9865
+ exports.wiringProbeResultSchema = wiringProbeResultSchema;
9457
9866
  exports.zoneAnalyticsCapability = zoneAnalyticsCapability;
9458
9867
  exports.zoneRulesCapability = zoneRulesCapability;
9459
9868
  exports.zonesCapability = zonesCapability;
9460
- //# sourceMappingURL=index-CMM1Y9W6.js.map
9869
+ //# sourceMappingURL=index-DnpdVFKv.js.map