@camstack/types 1.2.210 → 1.2.212

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-CDG4jaLR.js");
2
+ const require_sleep = require("./sleep-VlZxDyXq.js");
3
3
  const require_event_category = require("./event-category-BVfsrBYA.js");
4
4
  const require_canonical_hash = require("./canonical-hash-CZ2JqJc3.js");
5
5
  const require_enums = require("./enums.js");
@@ -8748,6 +8748,24 @@ var GetStreamWithCodecInputSchema = zod.z.object({
8748
8748
  });
8749
8749
  var RtpSourceSchema = zod.z.object({
8750
8750
  url: zod.z.string(),
8751
+ /**
8752
+ * The SENTRY counterpart of {@link url} — the dial that asks for the stream
8753
+ * WITHOUT asking for the camera — or `null` when this camera offers none.
8754
+ *
8755
+ * The broker answers it because the broker is the only thing that can:
8756
+ * eligibility is `sentryEligible` (a BATTERY camera that DECLARES the signals
8757
+ * cap), asked of facts only the broker holds. A consumer re-deriving it from
8758
+ * cap bindings would be a second authority, and two authorities on the same
8759
+ * question is how a composite camera ends up dialling a sleeping camera
8760
+ * because its own copy of the rule was a release behind.
8761
+ *
8762
+ * `null` is a real answer and is never a live url in disguise: a consumer
8763
+ * that silently fell back to {@link url} would perform exactly the wake this
8764
+ * field exists to prevent. Only a PASSTHROUGH acquisition can offer one — a
8765
+ * transcode hands back an egress the broker is feeding itself, which has no
8766
+ * sentry counterpart.
8767
+ */
8768
+ sentryUrl: zod.z.string().nullable().optional(),
8751
8769
  videoCodec: zod.z.enum(["H264", "H265"]),
8752
8770
  audioCodec: zod.z.string(),
8753
8771
  resolution: zod.z.object({
@@ -32420,6 +32438,156 @@ var motionTriggerCapability = {
32420
32438
  durability: "session"
32421
32439
  };
32422
32440
  //#endregion
32441
+ //#region src/capabilities/camera-grid-layout.cap.ts
32442
+ /**
32443
+ * camera-grid-layout — the geometry of a COMPOSITE camera, on the camera's own
32444
+ * page.
32445
+ *
32446
+ * ## Why this is a capability and not an addon settings schema
32447
+ *
32448
+ * It was one, and it did not render. The addon declared the editor as a
32449
+ * `type: 'widget'` field inside its own `deviceSettingsSchema()`; the hub
32450
+ * returned that section correctly and `ConfigFormField` renders `type:'widget'`
32451
+ * perfectly well — and nothing ever asked camera-grid for it. The Cluster →
32452
+ * Pipeline → Device Overrides page interrogates a HAND-WRITTEN list of four
32453
+ * addons (`PIPELINE_CLUSTER_DEVICE_ADDONS`), whose own comment says an addon
32454
+ * not on it "falls off silently".
32455
+ *
32456
+ * Adding a fifth name to that list would have been the wrong fix twice over:
32457
+ * that page is per-camera DETECTION tuning, and a grid's geometry belongs
32458
+ * beside PTZ and motion zones on the camera itself. The device page is
32459
+ * BINDING-driven (D12), so the way in is a capability bound to the device —
32460
+ * and this cap carries its section the way `recording` does, by RETURNING it
32461
+ * from `getDeviceSettingsContribution`.
32462
+ *
32463
+ * Seven other widgets are still declared the other way, through a
32464
+ * `deviceConfig.ui` block the framework derives a section from. That route
32465
+ * gives the addon no say in where its own panel lands and no way to decline
32466
+ * for a device the panel does not suit, which is why this one does not use it.
32467
+ *
32468
+ * ## Why one addon may implement it
32469
+ *
32470
+ * It is a device-scoped NATIVE cap, registered by the grid camera device
32471
+ * itself. Nothing else declares a composite camera, so nothing else has a
32472
+ * layout — and the device-scoped route means the widget asks THE camera, not
32473
+ * "the camera-grid addon", which is what let the old custom-action pair be
32474
+ * reached only by a caller that already knew the addon id.
32475
+ *
32476
+ * ## The tab
32477
+ *
32478
+ * `streaming`, not a top-tab of its own. A grid's geometry IS what its stream
32479
+ * is, so the Streaming tab is where it belongs; a `grid` top-tab would need an
32480
+ * entry in `WELL_KNOWN_TAB_MAP` or the device page renders the raw id as the
32481
+ * label (measured on the robot camera, 2026-09-06 — a tab called "navigation"
32482
+ * next to "PTZ").
32483
+ */
32484
+ /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
32485
+ var GridNormalizedRectSchema = zod.z.object({
32486
+ x: zod.z.number().min(0).max(1),
32487
+ y: zod.z.number().min(0).max(1),
32488
+ width: zod.z.number().gt(0).max(1),
32489
+ height: zod.z.number().gt(0).max(1)
32490
+ });
32491
+ /**
32492
+ * One source camera, the part of its picture taken, and where that part lands.
32493
+ *
32494
+ * Both rectangles are NORMALIZED (D519): a source camera can change resolution
32495
+ * — a profile switch, a firmware update, a substream that comes back different
32496
+ * — and a stored PIXEL rectangle would quietly start cutting the wrong region,
32497
+ * which is the class of bug nobody files.
32498
+ */
32499
+ var GridLayoutCellSchema = zod.z.object({
32500
+ deviceId: zod.z.number().int().positive(),
32501
+ /** The part of the SOURCE taken, normalized against the source. */
32502
+ source: GridNormalizedRectSchema,
32503
+ /** Where it lands, normalized against the CANVAS. */
32504
+ cell: GridNormalizedRectSchema
32505
+ });
32506
+ /**
32507
+ * Which profiles this grid can actually compose, and why not.
32508
+ *
32509
+ * A grid's `high` composes its sources' `high` and its `low` their `low`, so a
32510
+ * profile is on offer only when EVERY source can serve it. The refusal NAMES
32511
+ * the sources, because "this grid has no low" is not a finding — "615 has no
32512
+ * low" is, and it is the one an operator can act on.
32513
+ */
32514
+ var GridProfileOfferSchema = zod.z.object({
32515
+ profile: zod.z.enum([
32516
+ "high",
32517
+ "mid",
32518
+ "low"
32519
+ ]),
32520
+ offered: zod.z.boolean(),
32521
+ /** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
32522
+ missingSources: zod.z.array(zod.z.number().int().positive())
32523
+ });
32524
+ var GridLayoutViewSchema = zod.z.object({
32525
+ /** The persisted grid row this camera was declared from. */
32526
+ instanceId: zod.z.string(),
32527
+ deviceId: zod.z.number().int().nonnegative(),
32528
+ name: zod.z.string(),
32529
+ /** The canvas the operator laid out — this grid's `high`. mid/low are scaled from it. */
32530
+ width: zod.z.number().int(),
32531
+ height: zod.z.number().int(),
32532
+ fps: zod.z.number().int(),
32533
+ cells: zod.z.array(GridLayoutCellSchema),
32534
+ /** What the catalog will publish, and what it refuses to. Read-only. */
32535
+ profiles: zod.z.array(GridProfileOfferSchema)
32536
+ });
32537
+ var GridLayoutPatchSchema = zod.z.object({
32538
+ deviceId: zod.z.number().int().nonnegative(),
32539
+ name: zod.z.string().min(1).max(160).optional(),
32540
+ width: zod.z.number().int().min(160).max(7680).optional(),
32541
+ height: zod.z.number().int().min(120).max(4320).optional(),
32542
+ fps: zod.z.number().int().min(1).max(60).optional(),
32543
+ /**
32544
+ * The whole cell list at once. A per-cell patch would need an ordering the
32545
+ * editor does not have, and a half-applied layout is a picture nobody asked
32546
+ * for.
32547
+ */
32548
+ cells: zod.z.array(GridLayoutCellSchema).max(16)
32549
+ });
32550
+ var cameraGridLayoutCapability = {
32551
+ name: "camera-grid-layout",
32552
+ scope: "device",
32553
+ deviceNative: true,
32554
+ mode: "singleton",
32555
+ deviceTypes: [require_sleep.DeviceType.Camera],
32556
+ /**
32557
+ * The section is built by the ADDON and returned from
32558
+ * `getDeviceSettingsContribution`, not derived by the framework from a
32559
+ * `deviceConfig.ui` block.
32560
+ *
32561
+ * Both mechanisms render the same widget. This one hands the addon two
32562
+ * things the framework-derived route cannot give it:
32563
+ *
32564
+ * - it chooses its own section, `tab`, `location` and `order`, the way any
32565
+ * other setting does, instead of receiving them from a cap declaration;
32566
+ * - it can DECLINE per device. A camera that is not a grid gets no section
32567
+ * at all, rather than a widget that renders its own "not a grid" state.
32568
+ *
32569
+ * `recording` is the precedent (`recorder/recording-device-settings.ts`): it
32570
+ * returns `null` for anything that is not a camera, so the Recording tab
32571
+ * never appears there.
32572
+ */
32573
+ exposesDeviceSettings: true,
32574
+ methods: {
32575
+ /**
32576
+ * The grid behind this device.
32577
+ *
32578
+ * `null` means ANSWERED and this camera is not a grid — not "not yet
32579
+ * known". The widget renders its "this is not a grid camera" state only
32580
+ * from this answer, never from an unresolved query (D315).
32581
+ */
32582
+ getLayout: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), GridLayoutViewSchema.nullable(), { auth: "admin" }),
32583
+ /** Write the geometry back. Returns the grid as it now stands, profiles included. */
32584
+ saveLayout: require_sleep.method(GridLayoutPatchSchema, GridLayoutViewSchema, {
32585
+ kind: "mutation",
32586
+ auth: "admin"
32587
+ })
32588
+ }
32589
+ };
32590
+ //#endregion
32423
32591
  //#region src/capabilities/motion-zones.cap.ts
32424
32592
  /**
32425
32593
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -43052,6 +43220,7 @@ var CAPABILITY_NAMES = {
43052
43220
  broker: "broker",
43053
43221
  button: "button",
43054
43222
  cameraCredentials: "camera-credentials",
43223
+ cameraGridLayout: "camera-grid-layout",
43055
43224
  cameraPipelineConfig: "camera-pipeline-config",
43056
43225
  cameraStreams: "camera-streams",
43057
43226
  carbonMonoxide: "carbon-monoxide",
@@ -43290,6 +43459,10 @@ var CAPABILITY_ROUTER_KEYS = [
43290
43459
  key: "cameraCredentials",
43291
43460
  name: "camera-credentials"
43292
43461
  },
43462
+ {
43463
+ key: "cameraGridLayout",
43464
+ name: "camera-grid-layout"
43465
+ },
43293
43466
  {
43294
43467
  key: "cameraPipelineConfig",
43295
43468
  name: "camera-pipeline-config"
@@ -43851,6 +44024,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
43851
44024
  brokerCapability,
43852
44025
  buttonCapability,
43853
44026
  cameraCredentialsCapability,
44027
+ cameraGridLayoutCapability,
43854
44028
  cameraPipelineConfigCapability,
43855
44029
  cameraStreamsCapability,
43856
44030
  carbonMonoxideCapability,
@@ -44706,6 +44880,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
44706
44880
  addonId: null,
44707
44881
  access: "view"
44708
44882
  },
44883
+ "cameraGridLayout.getLayout": {
44884
+ capName: "camera-grid-layout",
44885
+ capScope: "device",
44886
+ addonId: null,
44887
+ access: "view"
44888
+ },
44889
+ "cameraGridLayout.saveLayout": {
44890
+ capName: "camera-grid-layout",
44891
+ capScope: "device",
44892
+ addonId: null,
44893
+ access: "create"
44894
+ },
44709
44895
  "cameraStreams.getBrokerStreams": {
44710
44896
  capName: "camera-streams",
44711
44897
  capScope: "device",
@@ -50330,6 +50516,7 @@ var KNOWN_CAP_NAMES = [
50330
50516
  "broker",
50331
50517
  "button",
50332
50518
  "camera-credentials",
50519
+ "camera-grid-layout",
50333
50520
  "camera-streams",
50334
50521
  "climate-control",
50335
50522
  "color",
@@ -50449,6 +50636,7 @@ var DEVICE_CAP_NAMES = [
50449
50636
  "brightness",
50450
50637
  "button",
50451
50638
  "camera-credentials",
50639
+ "camera-grid-layout",
50452
50640
  "camera-streams",
50453
50641
  "climate-control",
50454
50642
  "color",
@@ -50676,6 +50864,21 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
50676
50864
  form: "single",
50677
50865
  optional: false
50678
50866
  }],
50867
+ "cameraGridLayout.getLayout": [{
50868
+ name: "deviceId",
50869
+ form: "single",
50870
+ optional: false
50871
+ }],
50872
+ "cameraGridLayout.saveLayout": [{
50873
+ name: "cells",
50874
+ form: "object-array",
50875
+ optional: false,
50876
+ itemField: "deviceId"
50877
+ }, {
50878
+ name: "deviceId",
50879
+ form: "single",
50880
+ optional: false
50881
+ }],
50679
50882
  "cameraStreams.getBrokerStreams": [{
50680
50883
  name: "deviceId",
50681
50884
  form: "single",
@@ -58267,6 +58470,8 @@ exports.GasStatusSchema = GasStatusSchema;
58267
58470
  exports.GetLoggingSettingsInputSchema = GetLoggingSettingsInputSchema;
58268
58471
  exports.GetStreamWithCodecInputSchema = GetStreamWithCodecInputSchema;
58269
58472
  exports.GlobalMetricsSchema = GlobalMetricsSchema;
58473
+ exports.GridLayoutPatchSchema = GridLayoutPatchSchema;
58474
+ exports.GridLayoutViewSchema = GridLayoutViewSchema;
58270
58475
  exports.HAP_AUDIO_BASE = HAP_AUDIO_BASE;
58271
58476
  exports.HAP_AUDIO_BITRATE_KBPS = HAP_AUDIO_BITRATE_KBPS;
58272
58477
  exports.HAP_AUDIO_VBV_KBITS = HAP_AUDIO_VBV_KBITS;
@@ -59061,6 +59266,7 @@ exports.buildStreamParamsConfigSchema = buildStreamParamsConfigSchema;
59061
59266
  exports.buildVideoArgs = require_canonical_hash.buildVideoArgs;
59062
59267
  exports.buttonCapability = buttonCapability;
59063
59268
  exports.cameraCredentialsCapability = cameraCredentialsCapability;
59269
+ exports.cameraGridLayoutCapability = cameraGridLayoutCapability;
59064
59270
  exports.cameraPipelineConfigCapability = cameraPipelineConfigCapability;
59065
59271
  exports.cameraStreamsCapability = cameraStreamsCapability;
59066
59272
  exports.canConvertUnit = canConvertUnit;