@camstack/addon-agent-ui 1.2.114 → 1.2.116

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 (2) hide show
  1. package/dist/addon.js +168 -8
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -5361,7 +5361,7 @@ var ZodIssueCode = {
5361
5361
  var ZodFirstPartyTypeKind;
5362
5362
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5363
5363
  //#endregion
5364
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5364
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5365
5365
  /**
5366
5366
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5367
5367
  * window to float samples (D455).
@@ -28705,14 +28705,81 @@ DeviceType.Camera, method(object({ deviceId: number() }), PrivacyMaskOptionsSche
28705
28705
  kind: "mutation",
28706
28706
  auth: "admin"
28707
28707
  });
28708
+ /**
28709
+ * What a preset id DOES on this camera.
28710
+ *
28711
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
28712
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
28713
+ * (Hikvision) returns its own reserved band in the preset list, named by the
28714
+ * firmware:
28715
+ *
28716
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
28717
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
28718
+ * 95 Call OSD menu
28719
+ *
28720
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
28721
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
28722
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
28723
+ * operator as a transport failure.
28724
+ *
28725
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
28726
+ * is the single most useful thing that camera can do. Only `savePreset` and
28727
+ * `deletePreset` are gated.
28728
+ */
28729
+ var PtzPresetFunctionSchema = _enum([
28730
+ "home",
28731
+ "day-mode",
28732
+ "night-mode",
28733
+ "day-night-auto",
28734
+ "set-limits",
28735
+ "save-limits",
28736
+ "reboot",
28737
+ "osd-menu"
28738
+ ]);
28708
28739
  var PtzPresetSchema = object({
28709
28740
  id: string(),
28710
- name: string()
28741
+ name: string(),
28742
+ /**
28743
+ * The firmware function this id performs, when the provider KNOWS the id is
28744
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
28745
+ * provider does not recognise -- the two are told apart by `writable`.
28746
+ */
28747
+ fn: PtzPresetFunctionSchema.nullable(),
28748
+ /**
28749
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
28750
+ * it false only for a band it KNOWS is reserved; where the firmware is not
28751
+ * documented it stays true and a refusal comes from the camera, named.
28752
+ */
28753
+ writable: boolean()
28711
28754
  });
28755
+ /**
28756
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
28757
+ * read it.
28758
+ *
28759
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
28760
+ * position no way to say so. All four said `0`:
28761
+ *
28762
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
28763
+ * path lands upstream"
28764
+ * hikvision stub, "firmware-dependent and frequently absent"
28765
+ * amcrest stub, "no generic absolute-position read for this model family"
28766
+ * onvif throws
28767
+ *
28768
+ * So every consumer asking where a camera points was told "perfectly centred"
28769
+ * by four cameras that had never looked. That is D393 -- a measurement that
28770
+ * FAILED is `null`, never `0`, and the type says so all the way to the
28771
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
28772
+ * headroom", which evacuated a healthy disk.
28773
+ *
28774
+ * D393 also says to check for a narrower structural TWIN of the result type.
28775
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
28776
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
28777
+ * tells callers to migrate to.
28778
+ */
28712
28779
  var PtzPositionSchema = object({
28713
- pan: number(),
28714
- tilt: number(),
28715
- zoom: number()
28780
+ pan: number().nullable(),
28781
+ tilt: number().nullable(),
28782
+ zoom: number().nullable()
28716
28783
  });
28717
28784
  var PtzMoveCommandSchema = object({
28718
28785
  pan: number().optional(),
@@ -28731,7 +28798,72 @@ var PtzOptionsSchema = object({
28731
28798
  maxPresets: number().optional(),
28732
28799
  /** Whether the camera exposes a controllable autofocus toggle
28733
28800
  * (boolean `hasX` per the getOptions availability convention). */
28734
- hasAutofocus: boolean()
28801
+ hasAutofocus: boolean(),
28802
+ /**
28803
+ * How many distinct speeds this camera's NATIVE scale offers.
28804
+ *
28805
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
28806
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
28807
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
28808
+ * meaningless, because it has eight steps and three of them round to the
28809
+ * same one. A loop that tunes its own gain has to know the granularity of
28810
+ * the knob it is turning.
28811
+ *
28812
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
28813
+ * a float). Never a made-up number.
28814
+ */
28815
+ speedSteps: number().int().positive().nullable(),
28816
+ /**
28817
+ * How long ONE `move` pulse runs on this driver, ms.
28818
+ *
28819
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
28820
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
28821
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
28822
+ * did the head travel per pulse": without it a measured displacement has no
28823
+ * gain to be divided into.
28824
+ *
28825
+ * `null` = the driver cannot say.
28826
+ */
28827
+ moveImpulseMs: number().int().positive().nullable()
28828
+ });
28829
+ /**
28830
+ * Which preset `goHome` goes to, and WHO decided.
28831
+ *
28832
+ * `goHome` used to be three vendor "conventions" written in three comments --
28833
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
28834
+ * not one of the three cameras honours its own:
28835
+ *
28836
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
28837
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
28838
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
28839
+ *
28840
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
28841
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
28842
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
28843
+ * needs an answer that is true per camera and audible when it is missing.
28844
+ *
28845
+ * `source` is what makes it honest:
28846
+ * - `operator` -- picked in the UI, stored by the provider.
28847
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
28848
+ * "Back to origin"), adopted as the default with nothing to configure.
28849
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
28850
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
28851
+ * that is not a failure -- there is nothing to pick, and the UI must offer
28852
+ * no picker.
28853
+ * - `none` -- nothing is configured and the camera names nothing.
28854
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
28855
+ *
28856
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
28857
+ * native case has no preset and homes perfectly well.
28858
+ */
28859
+ var PtzHomePresetSchema = object({
28860
+ presetId: string().nullable(),
28861
+ source: _enum([
28862
+ "operator",
28863
+ "firmware",
28864
+ "native",
28865
+ "none"
28866
+ ])
28735
28867
  });
28736
28868
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(PtzPresetSchema)), method(object({
28737
28869
  deviceId: number(),
@@ -28749,7 +28881,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
28749
28881
  }), _void(), {
28750
28882
  kind: "mutation",
28751
28883
  auth: "admin"
28752
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
28884
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
28885
+ deviceId: number(),
28886
+ presetId: string().nullable()
28887
+ }), _void(), {
28888
+ kind: "mutation",
28889
+ auth: "admin"
28890
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
28753
28891
  deviceId: number(),
28754
28892
  enabled: boolean()
28755
28893
  }), _void(), { kind: "mutation" });
@@ -35764,6 +35902,12 @@ Object.freeze({
35764
35902
  addonId: null,
35765
35903
  access: "delete"
35766
35904
  },
35905
+ "ptz.getHomePreset": {
35906
+ capName: "ptz",
35907
+ capScope: "device",
35908
+ addonId: null,
35909
+ access: "view"
35910
+ },
35767
35911
  "ptz.getOptions": {
35768
35912
  capName: "ptz",
35769
35913
  capScope: "device",
@@ -35812,6 +35956,12 @@ Object.freeze({
35812
35956
  addonId: null,
35813
35957
  access: "create"
35814
35958
  },
35959
+ "ptz.setHomePreset": {
35960
+ capName: "ptz",
35961
+ capScope: "device",
35962
+ addonId: null,
35963
+ access: "create"
35964
+ },
35815
35965
  "ptz.stop": {
35816
35966
  capName: "ptz",
35817
35967
  capScope: "device",
@@ -38985,6 +39135,11 @@ Object.freeze({
38985
39135
  form: "single",
38986
39136
  optional: false
38987
39137
  }],
39138
+ "ptz.getHomePreset": [{
39139
+ name: "deviceId",
39140
+ form: "single",
39141
+ optional: false
39142
+ }],
38988
39143
  "ptz.getOptions": [{
38989
39144
  name: "deviceId",
38990
39145
  form: "single",
@@ -39025,6 +39180,11 @@ Object.freeze({
39025
39180
  form: "single",
39026
39181
  optional: false
39027
39182
  }],
39183
+ "ptz.setHomePreset": [{
39184
+ name: "deviceId",
39185
+ form: "single",
39186
+ optional: false
39187
+ }],
39028
39188
  "ptz.stop": [{
39029
39189
  name: "deviceId",
39030
39190
  form: "single",
@@ -40080,7 +40240,7 @@ var AgentUIAddon = class extends BaseAddon {
40080
40240
  capability: adminUiCapability,
40081
40241
  provider: {
40082
40242
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
40083
- getVersion: async () => ({ version: "1.2.114" })
40243
+ getVersion: async () => ({ version: "1.2.116" })
40084
40244
  }
40085
40245
  }];
40086
40246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.114",
3
+ "version": "1.2.116",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",