camstack 1.2.167 → 1.2.169

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.
@@ -14522,7 +14522,7 @@ function date4(params) {
14522
14522
  // ../../node_modules/zod/v4/classic/external.js
14523
14523
  config(en_default());
14524
14524
 
14525
- // ../types/dist/sleep-BDR76Ykr.mjs
14525
+ // ../types/dist/sleep-vl6nBE8d.mjs
14526
14526
  var AUDIO_CHUNK_FORMATS = [
14527
14527
  "f32le",
14528
14528
  "pcmu",
@@ -15384,7 +15384,7 @@ function sleep(ms) {
15384
15384
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
15385
15385
  }
15386
15386
 
15387
- // ../types/dist/canonical-hash-Ch5bSjFG.mjs
15387
+ // ../types/dist/canonical-hash-DBkl8q6V.mjs
15388
15388
  import { createHash } from "crypto";
15389
15389
  var DEFAULT_MAX_UNIT_BYTES = 16 * 1024 * 1024;
15390
15390
 
@@ -38683,14 +38683,36 @@ var privacyMaskCapability = {
38683
38683
  * whether persisting is worth a SQLite commit. */
38684
38684
  volatileStateFields: ["lastFetchedAt"]
38685
38685
  };
38686
+ var PtzPresetFunctionSchema = external_exports.enum([
38687
+ "home",
38688
+ "day-mode",
38689
+ "night-mode",
38690
+ "day-night-auto",
38691
+ "set-limits",
38692
+ "save-limits",
38693
+ "reboot",
38694
+ "osd-menu"
38695
+ ]);
38686
38696
  var PtzPresetSchema = external_exports.object({
38687
38697
  id: external_exports.string(),
38688
- name: external_exports.string()
38698
+ name: external_exports.string(),
38699
+ /**
38700
+ * The firmware function this id performs, when the provider KNOWS the id is
38701
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
38702
+ * provider does not recognise -- the two are told apart by `writable`.
38703
+ */
38704
+ fn: PtzPresetFunctionSchema.nullable(),
38705
+ /**
38706
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
38707
+ * it false only for a band it KNOWS is reserved; where the firmware is not
38708
+ * documented it stays true and a refusal comes from the camera, named.
38709
+ */
38710
+ writable: external_exports.boolean()
38689
38711
  });
38690
38712
  var PtzPositionSchema = external_exports.object({
38691
- pan: external_exports.number(),
38692
- tilt: external_exports.number(),
38693
- zoom: external_exports.number()
38713
+ pan: external_exports.number().nullable(),
38714
+ tilt: external_exports.number().nullable(),
38715
+ zoom: external_exports.number().nullable()
38694
38716
  });
38695
38717
  var PtzMoveCommandSchema = external_exports.object({
38696
38718
  pan: external_exports.number().optional(),
@@ -38708,7 +38730,42 @@ var PtzOptionsSchema = external_exports.object({
38708
38730
  maxPresets: external_exports.number().optional(),
38709
38731
  /** Whether the camera exposes a controllable autofocus toggle
38710
38732
  * (boolean `hasX` per the getOptions availability convention). */
38711
- hasAutofocus: external_exports.boolean()
38733
+ hasAutofocus: external_exports.boolean(),
38734
+ /**
38735
+ * How many distinct speeds this camera's NATIVE scale offers.
38736
+ *
38737
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
38738
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
38739
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
38740
+ * meaningless, because it has eight steps and three of them round to the
38741
+ * same one. A loop that tunes its own gain has to know the granularity of
38742
+ * the knob it is turning.
38743
+ *
38744
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
38745
+ * a float). Never a made-up number.
38746
+ */
38747
+ speedSteps: external_exports.number().int().positive().nullable(),
38748
+ /**
38749
+ * How long ONE `move` pulse runs on this driver, ms.
38750
+ *
38751
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
38752
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
38753
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
38754
+ * did the head travel per pulse": without it a measured displacement has no
38755
+ * gain to be divided into.
38756
+ *
38757
+ * `null` = the driver cannot say.
38758
+ */
38759
+ moveImpulseMs: external_exports.number().int().positive().nullable()
38760
+ });
38761
+ var PtzHomePresetSchema = external_exports.object({
38762
+ presetId: external_exports.string().nullable(),
38763
+ source: external_exports.enum([
38764
+ "operator",
38765
+ "firmware",
38766
+ "native",
38767
+ "none"
38768
+ ])
38712
38769
  });
38713
38770
  var ptzCapability = {
38714
38771
  name: "ptz",
@@ -38749,7 +38806,66 @@ var ptzCapability = {
38749
38806
  auth: "admin"
38750
38807
  }),
38751
38808
  getOptions: method(external_exports.object({ deviceId: external_exports.number() }), PtzOptionsSchema),
38809
+ /**
38810
+ * Move to the camera's configured home preset. THROWS when
38811
+ * `getHomePreset()` resolves to `none` -- a head that did not move must
38812
+ * never look like a head that went home.
38813
+ */
38752
38814
  goHome: method(external_exports.object({ deviceId: external_exports.number() }), external_exports.void(), { kind: "mutation" }),
38815
+ /** Which preset `goHome` targets, and who decided it. */
38816
+ getHomePreset: method(external_exports.object({ deviceId: external_exports.number() }), PtzHomePresetSchema),
38817
+ /**
38818
+ * Pin the home preset for this camera. `null` clears the operator's choice
38819
+ * and falls back to whatever the firmware names, or to `none`.
38820
+ */
38821
+ setHomePreset: method(external_exports.object({
38822
+ deviceId: external_exports.number(),
38823
+ presetId: external_exports.string().nullable()
38824
+ }), external_exports.void(), {
38825
+ kind: "mutation",
38826
+ auth: "admin"
38827
+ }),
38828
+ /**
38829
+ * Make WHERE THE HEAD IS POINTING RIGHT NOW this camera's home.
38830
+ *
38831
+ * `setHomePreset` takes a preset id, and a preset id is the wrong shape for
38832
+ * the most natural thing an operator does: aim the camera, then say "here".
38833
+ * It is also the only shape a camera whose home is NOT a preset can accept
38834
+ * -- Reolink's home is a guard point, a stored position with no id at all,
38835
+ * and hiding the control for that case (as the UI briefly did) left the one
38836
+ * vendor with a native home unable to set it.
38837
+ *
38838
+ * Each provider does it its own way:
38839
+ * reolink `setGrd` with `needSetPos`, pinning the guard point here
38840
+ * hikvision / amcrest save a preset, then pin it as home
38841
+ * onvif REFUSES -- its home is the PTZ origin and cannot be moved
38842
+ *
38843
+ * A provider that cannot honour it throws rather than silently doing
38844
+ * nothing: an operator who pressed "set home here" and saw no error would
38845
+ * believe it took.
38846
+ */
38847
+ captureHomeHere: method(external_exports.object({ deviceId: external_exports.number() }), external_exports.void(), {
38848
+ kind: "mutation",
38849
+ auth: "admin"
38850
+ }),
38851
+ /**
38852
+ * How long the camera waits, idle, before returning home on its own --
38853
+ * `null` when it has no such behaviour.
38854
+ *
38855
+ * Reolink's guard point carries one (`timeout`, freely settable in
38856
+ * seconds). It is a real function of the camera that we did not expose at
38857
+ * all, and it belongs next to the home it governs rather than in a vendor
38858
+ * settings page nobody associates with Home.
38859
+ */
38860
+ getHomeReturnSeconds: method(external_exports.object({ deviceId: external_exports.number() }), external_exports.number().int().nullable()),
38861
+ /** Set the idle-return delay. Refused by a camera that has no such timer. */
38862
+ setHomeReturnSeconds: method(external_exports.object({
38863
+ deviceId: external_exports.number(),
38864
+ seconds: external_exports.number().int().min(0).max(3600)
38865
+ }), external_exports.void(), {
38866
+ kind: "mutation",
38867
+ auth: "admin"
38868
+ }),
38753
38869
  /**
38754
38870
  * Pull the current PTZ position. Redundant with the auto-injected
38755
38871
  * `getStatus` method (see `status` below); kept for callers that
@@ -46161,6 +46277,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
46161
46277
  addonId: null,
46162
46278
  access: "create"
46163
46279
  },
46280
+ "ptz.captureHomeHere": {
46281
+ capName: "ptz",
46282
+ capScope: "device",
46283
+ addonId: null,
46284
+ access: "create"
46285
+ },
46164
46286
  "ptz.continuousMove": {
46165
46287
  capName: "ptz",
46166
46288
  capScope: "device",
@@ -46173,6 +46295,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
46173
46295
  addonId: null,
46174
46296
  access: "delete"
46175
46297
  },
46298
+ "ptz.getHomePreset": {
46299
+ capName: "ptz",
46300
+ capScope: "device",
46301
+ addonId: null,
46302
+ access: "view"
46303
+ },
46304
+ "ptz.getHomeReturnSeconds": {
46305
+ capName: "ptz",
46306
+ capScope: "device",
46307
+ addonId: null,
46308
+ access: "view"
46309
+ },
46176
46310
  "ptz.getOptions": {
46177
46311
  capName: "ptz",
46178
46312
  capScope: "device",
@@ -46221,6 +46355,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
46221
46355
  addonId: null,
46222
46356
  access: "create"
46223
46357
  },
46358
+ "ptz.setHomePreset": {
46359
+ capName: "ptz",
46360
+ capScope: "device",
46361
+ addonId: null,
46362
+ access: "create"
46363
+ },
46364
+ "ptz.setHomeReturnSeconds": {
46365
+ capName: "ptz",
46366
+ capScope: "device",
46367
+ addonId: null,
46368
+ access: "create"
46369
+ },
46224
46370
  "ptz.stop": {
46225
46371
  capName: "ptz",
46226
46372
  capScope: "device",
@@ -49384,6 +49530,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
49384
49530
  form: "single",
49385
49531
  optional: false
49386
49532
  }],
49533
+ "ptz.captureHomeHere": [{
49534
+ name: "deviceId",
49535
+ form: "single",
49536
+ optional: false
49537
+ }],
49387
49538
  "ptz.continuousMove": [{
49388
49539
  name: "deviceId",
49389
49540
  form: "single",
@@ -49394,6 +49545,16 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
49394
49545
  form: "single",
49395
49546
  optional: false
49396
49547
  }],
49548
+ "ptz.getHomePreset": [{
49549
+ name: "deviceId",
49550
+ form: "single",
49551
+ optional: false
49552
+ }],
49553
+ "ptz.getHomeReturnSeconds": [{
49554
+ name: "deviceId",
49555
+ form: "single",
49556
+ optional: false
49557
+ }],
49397
49558
  "ptz.getOptions": [{
49398
49559
  name: "deviceId",
49399
49560
  form: "single",
@@ -49434,6 +49595,16 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
49434
49595
  form: "single",
49435
49596
  optional: false
49436
49597
  }],
49598
+ "ptz.setHomePreset": [{
49599
+ name: "deviceId",
49600
+ form: "single",
49601
+ optional: false
49602
+ }],
49603
+ "ptz.setHomeReturnSeconds": [{
49604
+ name: "deviceId",
49605
+ form: "single",
49606
+ optional: false
49607
+ }],
49437
49608
  "ptz.stop": [{
49438
49609
  name: "deviceId",
49439
49610
  form: "single",
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runDiscover
4
- } from "./chunk-MXBN3QZ5.js";
4
+ } from "./chunk-T3N5WXL6.js";
5
5
  import "./chunk-LMMQX4CK.js";
6
6
 
7
7
  // src/cli.ts
@@ -38,7 +38,7 @@ async function runServe(args) {
38
38
  ...typeof values.data === "string" ? { data: values.data } : {}
39
39
  };
40
40
  Object.assign(process.env, buildServeEnv(opts));
41
- await import("./launcher-AYZZUJZ6.js");
41
+ await import("./launcher-TE2XQWET.js");
42
42
  }
43
43
 
44
44
  // src/commands/agent.ts
@@ -83,7 +83,7 @@ async function runAgent(args) {
83
83
  ...typeof values.port === "string" ? { port: values.port } : {}
84
84
  };
85
85
  Object.assign(process.env, buildAgentEnv(opts));
86
- await import("./launcher-AYZZUJZ6.js");
86
+ await import("./launcher-TE2XQWET.js");
87
87
  }
88
88
 
89
89
  // src/commands/setup.ts
@@ -1140,7 +1140,7 @@ function isUnknown(_value) {
1140
1140
  return true;
1141
1141
  }
1142
1142
  async function resolveServerInteractive(presetNamespace) {
1143
- const { discoverNodes, resolveHubFromDiscovered, filterHubNodes, DEFAULT_HUB_HTTPS_PORT } = await import("./discover-7R72RWAY.js");
1143
+ const { discoverNodes, resolveHubFromDiscovered, filterHubNodes, DEFAULT_HUB_HTTPS_PORT } = await import("./discover-XEKNY5LK.js");
1144
1144
  if (presetNamespace) {
1145
1145
  const spinner4 = clack.spinner();
1146
1146
  spinner4.start(`Discovering hub on LAN (namespace "${presetNamespace}")`);
@@ -5,7 +5,7 @@ import {
5
5
  filterHubNodes,
6
6
  resolveHubFromDiscovered,
7
7
  runDiscover
8
- } from "./chunk-MXBN3QZ5.js";
8
+ } from "./chunk-T3N5WXL6.js";
9
9
  import "./chunk-LMMQX4CK.js";
10
10
  export {
11
11
  DEFAULT_HUB_HTTPS_PORT,
@@ -23742,9 +23742,9 @@ var require_zod = __commonJS({
23742
23742
  }
23743
23743
  });
23744
23744
 
23745
- // ../system/dist/dist-DluLUTzR.js
23746
- var require_dist_DluLUTzR = __commonJS({
23747
- "../system/dist/dist-DluLUTzR.js"(exports) {
23745
+ // ../system/dist/dist-BG0p9Azt.js
23746
+ var require_dist_BG0p9Azt = __commonJS({
23747
+ "../system/dist/dist-BG0p9Azt.js"(exports) {
23748
23748
  "use strict";
23749
23749
  var zod = require_zod();
23750
23750
  var EventCategory = /* @__PURE__ */ (function(EventCategory2) {
@@ -49358,14 +49358,36 @@ var require_dist_DluLUTzR = __commonJS({
49358
49358
  * whether persisting is worth a SQLite commit. */
49359
49359
  volatileStateFields: ["lastFetchedAt"]
49360
49360
  };
49361
+ var PtzPresetFunctionSchema = zod.z.enum([
49362
+ "home",
49363
+ "day-mode",
49364
+ "night-mode",
49365
+ "day-night-auto",
49366
+ "set-limits",
49367
+ "save-limits",
49368
+ "reboot",
49369
+ "osd-menu"
49370
+ ]);
49361
49371
  var PtzPresetSchema = zod.z.object({
49362
49372
  id: zod.z.string(),
49363
- name: zod.z.string()
49373
+ name: zod.z.string(),
49374
+ /**
49375
+ * The firmware function this id performs, when the provider KNOWS the id is
49376
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
49377
+ * provider does not recognise -- the two are told apart by `writable`.
49378
+ */
49379
+ fn: PtzPresetFunctionSchema.nullable(),
49380
+ /**
49381
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
49382
+ * it false only for a band it KNOWS is reserved; where the firmware is not
49383
+ * documented it stays true and a refusal comes from the camera, named.
49384
+ */
49385
+ writable: zod.z.boolean()
49364
49386
  });
49365
49387
  var PtzPositionSchema = zod.z.object({
49366
- pan: zod.z.number(),
49367
- tilt: zod.z.number(),
49368
- zoom: zod.z.number()
49388
+ pan: zod.z.number().nullable(),
49389
+ tilt: zod.z.number().nullable(),
49390
+ zoom: zod.z.number().nullable()
49369
49391
  });
49370
49392
  var PtzMoveCommandSchema = zod.z.object({
49371
49393
  pan: zod.z.number().optional(),
@@ -49383,7 +49405,42 @@ var require_dist_DluLUTzR = __commonJS({
49383
49405
  maxPresets: zod.z.number().optional(),
49384
49406
  /** Whether the camera exposes a controllable autofocus toggle
49385
49407
  * (boolean `hasX` per the getOptions availability convention). */
49386
- hasAutofocus: zod.z.boolean()
49408
+ hasAutofocus: zod.z.boolean(),
49409
+ /**
49410
+ * How many distinct speeds this camera's NATIVE scale offers.
49411
+ *
49412
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
49413
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
49414
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
49415
+ * meaningless, because it has eight steps and three of them round to the
49416
+ * same one. A loop that tunes its own gain has to know the granularity of
49417
+ * the knob it is turning.
49418
+ *
49419
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
49420
+ * a float). Never a made-up number.
49421
+ */
49422
+ speedSteps: zod.z.number().int().positive().nullable(),
49423
+ /**
49424
+ * How long ONE `move` pulse runs on this driver, ms.
49425
+ *
49426
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
49427
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
49428
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
49429
+ * did the head travel per pulse": without it a measured displacement has no
49430
+ * gain to be divided into.
49431
+ *
49432
+ * `null` = the driver cannot say.
49433
+ */
49434
+ moveImpulseMs: zod.z.number().int().positive().nullable()
49435
+ });
49436
+ var PtzHomePresetSchema = zod.z.object({
49437
+ presetId: zod.z.string().nullable(),
49438
+ source: zod.z.enum([
49439
+ "operator",
49440
+ "firmware",
49441
+ "native",
49442
+ "none"
49443
+ ])
49387
49444
  });
49388
49445
  var ptzCapability = {
49389
49446
  name: "ptz",
@@ -49424,7 +49481,66 @@ var require_dist_DluLUTzR = __commonJS({
49424
49481
  auth: "admin"
49425
49482
  }),
49426
49483
  getOptions: method(zod.z.object({ deviceId: zod.z.number() }), PtzOptionsSchema),
49484
+ /**
49485
+ * Move to the camera's configured home preset. THROWS when
49486
+ * `getHomePreset()` resolves to `none` -- a head that did not move must
49487
+ * never look like a head that went home.
49488
+ */
49427
49489
  goHome: method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), { kind: "mutation" }),
49490
+ /** Which preset `goHome` targets, and who decided it. */
49491
+ getHomePreset: method(zod.z.object({ deviceId: zod.z.number() }), PtzHomePresetSchema),
49492
+ /**
49493
+ * Pin the home preset for this camera. `null` clears the operator's choice
49494
+ * and falls back to whatever the firmware names, or to `none`.
49495
+ */
49496
+ setHomePreset: method(zod.z.object({
49497
+ deviceId: zod.z.number(),
49498
+ presetId: zod.z.string().nullable()
49499
+ }), zod.z.void(), {
49500
+ kind: "mutation",
49501
+ auth: "admin"
49502
+ }),
49503
+ /**
49504
+ * Make WHERE THE HEAD IS POINTING RIGHT NOW this camera's home.
49505
+ *
49506
+ * `setHomePreset` takes a preset id, and a preset id is the wrong shape for
49507
+ * the most natural thing an operator does: aim the camera, then say "here".
49508
+ * It is also the only shape a camera whose home is NOT a preset can accept
49509
+ * -- Reolink's home is a guard point, a stored position with no id at all,
49510
+ * and hiding the control for that case (as the UI briefly did) left the one
49511
+ * vendor with a native home unable to set it.
49512
+ *
49513
+ * Each provider does it its own way:
49514
+ * reolink `setGrd` with `needSetPos`, pinning the guard point here
49515
+ * hikvision / amcrest save a preset, then pin it as home
49516
+ * onvif REFUSES -- its home is the PTZ origin and cannot be moved
49517
+ *
49518
+ * A provider that cannot honour it throws rather than silently doing
49519
+ * nothing: an operator who pressed "set home here" and saw no error would
49520
+ * believe it took.
49521
+ */
49522
+ captureHomeHere: method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
49523
+ kind: "mutation",
49524
+ auth: "admin"
49525
+ }),
49526
+ /**
49527
+ * How long the camera waits, idle, before returning home on its own --
49528
+ * `null` when it has no such behaviour.
49529
+ *
49530
+ * Reolink's guard point carries one (`timeout`, freely settable in
49531
+ * seconds). It is a real function of the camera that we did not expose at
49532
+ * all, and it belongs next to the home it governs rather than in a vendor
49533
+ * settings page nobody associates with Home.
49534
+ */
49535
+ getHomeReturnSeconds: method(zod.z.object({ deviceId: zod.z.number() }), zod.z.number().int().nullable()),
49536
+ /** Set the idle-return delay. Refused by a camera that has no such timer. */
49537
+ setHomeReturnSeconds: method(zod.z.object({
49538
+ deviceId: zod.z.number(),
49539
+ seconds: zod.z.number().int().min(0).max(3600)
49540
+ }), zod.z.void(), {
49541
+ kind: "mutation",
49542
+ auth: "admin"
49543
+ }),
49428
49544
  /**
49429
49545
  * Pull the current PTZ position. Redundant with the auto-injected
49430
49546
  * `getStatus` method (see `status` below); kept for callers that
@@ -57666,6 +57782,12 @@ var require_dist_DluLUTzR = __commonJS({
57666
57782
  addonId: null,
57667
57783
  access: "create"
57668
57784
  },
57785
+ "ptz.captureHomeHere": {
57786
+ capName: "ptz",
57787
+ capScope: "device",
57788
+ addonId: null,
57789
+ access: "create"
57790
+ },
57669
57791
  "ptz.continuousMove": {
57670
57792
  capName: "ptz",
57671
57793
  capScope: "device",
@@ -57678,6 +57800,18 @@ var require_dist_DluLUTzR = __commonJS({
57678
57800
  addonId: null,
57679
57801
  access: "delete"
57680
57802
  },
57803
+ "ptz.getHomePreset": {
57804
+ capName: "ptz",
57805
+ capScope: "device",
57806
+ addonId: null,
57807
+ access: "view"
57808
+ },
57809
+ "ptz.getHomeReturnSeconds": {
57810
+ capName: "ptz",
57811
+ capScope: "device",
57812
+ addonId: null,
57813
+ access: "view"
57814
+ },
57681
57815
  "ptz.getOptions": {
57682
57816
  capName: "ptz",
57683
57817
  capScope: "device",
@@ -57726,6 +57860,18 @@ var require_dist_DluLUTzR = __commonJS({
57726
57860
  addonId: null,
57727
57861
  access: "create"
57728
57862
  },
57863
+ "ptz.setHomePreset": {
57864
+ capName: "ptz",
57865
+ capScope: "device",
57866
+ addonId: null,
57867
+ access: "create"
57868
+ },
57869
+ "ptz.setHomeReturnSeconds": {
57870
+ capName: "ptz",
57871
+ capScope: "device",
57872
+ addonId: null,
57873
+ access: "create"
57874
+ },
57729
57875
  "ptz.stop": {
57730
57876
  capName: "ptz",
57731
57877
  capScope: "device",
@@ -60889,6 +61035,11 @@ var require_dist_DluLUTzR = __commonJS({
60889
61035
  form: "single",
60890
61036
  optional: false
60891
61037
  }],
61038
+ "ptz.captureHomeHere": [{
61039
+ name: "deviceId",
61040
+ form: "single",
61041
+ optional: false
61042
+ }],
60892
61043
  "ptz.continuousMove": [{
60893
61044
  name: "deviceId",
60894
61045
  form: "single",
@@ -60899,6 +61050,16 @@ var require_dist_DluLUTzR = __commonJS({
60899
61050
  form: "single",
60900
61051
  optional: false
60901
61052
  }],
61053
+ "ptz.getHomePreset": [{
61054
+ name: "deviceId",
61055
+ form: "single",
61056
+ optional: false
61057
+ }],
61058
+ "ptz.getHomeReturnSeconds": [{
61059
+ name: "deviceId",
61060
+ form: "single",
61061
+ optional: false
61062
+ }],
60902
61063
  "ptz.getOptions": [{
60903
61064
  name: "deviceId",
60904
61065
  form: "single",
@@ -60939,6 +61100,16 @@ var require_dist_DluLUTzR = __commonJS({
60939
61100
  form: "single",
60940
61101
  optional: false
60941
61102
  }],
61103
+ "ptz.setHomePreset": [{
61104
+ name: "deviceId",
61105
+ form: "single",
61106
+ optional: false
61107
+ }],
61108
+ "ptz.setHomeReturnSeconds": [{
61109
+ name: "deviceId",
61110
+ form: "single",
61111
+ optional: false
61112
+ }],
60942
61113
  "ptz.stop": [{
60943
61114
  name: "deviceId",
60944
61115
  form: "single",
@@ -62966,7 +63137,7 @@ var require_alerts_addon = __commonJS({
62966
63137
  [Symbol.toStringTag]: { value: "Module" }
62967
63138
  });
62968
63139
  require_chunk_Cek0wNdY();
62969
- var require_dist10 = require_dist_DluLUTzR();
63140
+ var require_dist10 = require_dist_BG0p9Azt();
62970
63141
  function selectExpired(alerts, cutoffMs) {
62971
63142
  return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
62972
63143
  }
@@ -63785,7 +63956,7 @@ var require_console_logging = __commonJS({
63785
63956
  [Symbol.toStringTag]: { value: "Module" }
63786
63957
  });
63787
63958
  require_chunk_Cek0wNdY();
63788
- var require_dist10 = require_dist_DluLUTzR();
63959
+ var require_dist10 = require_dist_BG0p9Azt();
63789
63960
  var require_formatter = require_formatter_DqAKDlvN();
63790
63961
  var LEVEL_RANK = {
63791
63962
  debug: 0,
@@ -63879,7 +64050,7 @@ var require_core_blocks_addon = __commonJS({
63879
64050
  "use strict";
63880
64051
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
63881
64052
  var require_chunk = require_chunk_Cek0wNdY();
63882
- var require_dist10 = require_dist_DluLUTzR();
64053
+ var require_dist10 = require_dist_BG0p9Azt();
63883
64054
  var node_crypto = __require("crypto");
63884
64055
  var node_fs_promises = __require("fs/promises");
63885
64056
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -64776,11 +64947,11 @@ var require_core_blocks = __commonJS({
64776
64947
  }
64777
64948
  });
64778
64949
 
64779
- // ../system/dist/retired-settings-keys-VcrnwKN0.js
64780
- var require_retired_settings_keys_VcrnwKN0 = __commonJS({
64781
- "../system/dist/retired-settings-keys-VcrnwKN0.js"(exports) {
64950
+ // ../system/dist/retired-settings-keys-Cmv1q2hJ.js
64951
+ var require_retired_settings_keys_Cmv1q2hJ = __commonJS({
64952
+ "../system/dist/retired-settings-keys-Cmv1q2hJ.js"(exports) {
64782
64953
  "use strict";
64783
- var require_dist10 = require_dist_DluLUTzR();
64954
+ var require_dist10 = require_dist_BG0p9Azt();
64784
64955
  function settingsStoreIsAuthoritativeHere(env) {
64785
64956
  const raw = (env["CAMSTACK_ROLE"] ?? "").trim().toLowerCase();
64786
64957
  return raw === "" || raw === "hub";
@@ -65060,9 +65231,9 @@ var require_retired_settings_keys_VcrnwKN0 = __commonJS({
65060
65231
  }
65061
65232
  });
65062
65233
 
65063
- // ../types/dist/canonical-hash-9lydiEzx.js
65064
- var require_canonical_hash_9lydiEzx = __commonJS({
65065
- "../types/dist/canonical-hash-9lydiEzx.js"(exports) {
65234
+ // ../types/dist/canonical-hash-CZ2JqJc3.js
65235
+ var require_canonical_hash_CZ2JqJc3 = __commonJS({
65236
+ "../types/dist/canonical-hash-CZ2JqJc3.js"(exports) {
65066
65237
  "use strict";
65067
65238
  var node_crypto = __require("crypto");
65068
65239
  var AUDIO_ENCODER_BY_CODEC = {
@@ -65114,7 +65285,27 @@ var require_canonical_hash_9lydiEzx = __commonJS({
65114
65285
  args.push("-i", input.url);
65115
65286
  return args;
65116
65287
  }
65117
- function buildVideoFilterArgs(scale, outputArgs) {
65288
+ function resolveStreamMaps(selection) {
65289
+ const graph = selection.filterGraph;
65290
+ if (graph) return {
65291
+ video: `[${graph.videoOutLabel}]`,
65292
+ audio: graph.audioOutLabel ? `[${graph.audioOutLabel}]` : "0:a:0?"
65293
+ };
65294
+ if (selection.extraInputs?.length) return {
65295
+ video: "0:v:0",
65296
+ audio: "0:a:0?"
65297
+ };
65298
+ return {
65299
+ video: null,
65300
+ audio: null
65301
+ };
65302
+ }
65303
+ function buildVideoFilterArgs(scale, outputArgs, filterGraph) {
65304
+ if (filterGraph) {
65305
+ if (scale) throw new Error("FfmpegInvocation: video.scale cannot be combined with a filter graph \u2014 scale inside the graph instead (the -vf would feed an output the graph already feeds)");
65306
+ if (outputArgs.some((a) => a === "-vf")) throw new Error("FfmpegInvocation: outputArgs carries a -vf while a filter graph feeds the same output \u2014 fold the filter into the graph");
65307
+ return [];
65308
+ }
65118
65309
  if (!scale) return [];
65119
65310
  if (outputArgs.some((a) => a === "-vf")) return [];
65120
65311
  if (scale.mode === "exact") return ["-vf", `scale=${scale.width}:${scale.height}`];
@@ -65136,14 +65327,17 @@ var require_canonical_hash_9lydiEzx = __commonJS({
65136
65327
  `${bufsize}k`
65137
65328
  ];
65138
65329
  }
65139
- function buildVideoArgs(video, outputArgs) {
65140
- if (video.kind === "copy") return [
65141
- "-c:v",
65142
- "copy",
65143
- ...video.bitstreamFilter ? ["-bsf:v", video.bitstreamFilter] : []
65144
- ];
65330
+ function buildVideoArgs(video, outputArgs, filterGraph) {
65331
+ if (video.kind === "copy") {
65332
+ if (filterGraph) throw new Error("FfmpegInvocation: a filter graph produces a NEW picture, so video.kind must be `encode`");
65333
+ return [
65334
+ "-c:v",
65335
+ "copy",
65336
+ ...video.bitstreamFilter ? ["-bsf:v", video.bitstreamFilter] : []
65337
+ ];
65338
+ }
65145
65339
  const args = [
65146
- ...buildVideoFilterArgs(video.scale, outputArgs),
65340
+ ...buildVideoFilterArgs(video.scale, outputArgs, filterGraph),
65147
65341
  "-c:v",
65148
65342
  video.encoder
65149
65343
  ];
@@ -65234,14 +65428,23 @@ var require_canonical_hash_9lydiEzx = __commonJS({
65234
65428
  ];
65235
65429
  }
65236
65430
  function buildFfmpegArgs(inv) {
65237
- const head = [...logBannerArgs(inv.logLevel), ...buildInputArgs(inv.input, inv.decodeHwAccel)];
65431
+ const graph = inv.filterGraph ?? null;
65432
+ const head = [
65433
+ ...logBannerArgs(inv.logLevel),
65434
+ ...buildInputArgs(inv.input, inv.decodeHwAccel),
65435
+ ...(inv.extraInputs ?? []).flatMap((extra) => buildInputArgs(extra, inv.decodeHwAccel)),
65436
+ ...graph ? ["-filter_complex", graph.graph] : []
65437
+ ];
65238
65438
  const threadArgs = inv.threadCount > 0 ? ["-threads", String(inv.threadCount)] : [];
65439
+ const maps = resolveStreamMaps(inv);
65440
+ const videoMapArgs = maps.video ? ["-map", maps.video] : [];
65441
+ const audioMapArgs = maps.audio ? ["-map", maps.audio] : [];
65239
65442
  if (inv.sink.kind === "rtp-outputs") {
65240
65443
  const videoLeg = inv.sink.video ? [
65241
65444
  "-an",
65242
65445
  "-map",
65243
- "0:v:0",
65244
- ...buildVideoArgs(inv.video, inv.outputArgs),
65446
+ maps.video ?? "0:v:0",
65447
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph),
65245
65448
  ...threadArgs,
65246
65449
  ...inv.outputArgs,
65247
65450
  ...buildRtpOutputArgs(inv.sink.video)
@@ -65249,7 +65452,7 @@ var require_canonical_hash_9lydiEzx = __commonJS({
65249
65452
  const audioLeg = inv.sink.audio ? [
65250
65453
  "-vn",
65251
65454
  "-map",
65252
- "0:a:0?",
65455
+ maps.audio ?? "0:a:0?",
65253
65456
  ...buildAudioArgs(inv.audio),
65254
65457
  ...buildRtpOutputArgs(inv.sink.audio)
65255
65458
  ] : [];
@@ -65259,15 +65462,17 @@ var require_canonical_hash_9lydiEzx = __commonJS({
65259
65462
  ...audioLeg
65260
65463
  ];
65261
65464
  }
65465
+ const mutedAudio = isElementaryVideoSink(inv.sink) || inv.audio.kind === "none";
65262
65466
  const audioArgs = isElementaryVideoSink(inv.sink) ? ["-an"] : buildAudioArgs(inv.audio);
65263
- const sinkArgs = buildStdoutOrRtspSinkArgs(inv.sink);
65264
65467
  return [
65265
65468
  ...head,
65266
- ...buildVideoArgs(inv.video, inv.outputArgs),
65469
+ ...videoMapArgs,
65470
+ ...buildVideoArgs(inv.video, inv.outputArgs, graph),
65267
65471
  ...threadArgs,
65472
+ ...mutedAudio ? [] : audioMapArgs,
65268
65473
  ...audioArgs,
65269
65474
  ...inv.outputArgs,
65270
- ...sinkArgs,
65475
+ ...buildStdoutOrRtspSinkArgs(inv.sink),
65271
65476
  ...inv.audioSidecar ? buildAudioSidecarArgs(inv.audioSidecar) : []
65272
65477
  ];
65273
65478
  }
@@ -65618,6 +65823,12 @@ var require_canonical_hash_9lydiEzx = __commonJS({
65618
65823
  return pickVideoEncoder;
65619
65824
  }
65620
65825
  });
65826
+ Object.defineProperty(exports, "resolveStreamMaps", {
65827
+ enumerable: true,
65828
+ get: function() {
65829
+ return resolveStreamMaps;
65830
+ }
65831
+ });
65621
65832
  }
65622
65833
  });
65623
65834
 
@@ -65664,7 +65875,7 @@ var require_node = __commonJS({
65664
65875
  value: mod,
65665
65876
  enumerable: true
65666
65877
  }) : target, mod));
65667
- var require_canonical_hash = require_canonical_hash_9lydiEzx();
65878
+ var require_canonical_hash = require_canonical_hash_CZ2JqJc3();
65668
65879
  var require_err_msg = require_err_msg_COpsHMw2();
65669
65880
  var node_crypto = __require("crypto");
65670
65881
  var node_fs = __require("fs");
@@ -67017,8 +67228,8 @@ var require_device_manager_addon = __commonJS({
67017
67228
  [Symbol.toStringTag]: { value: "Module" }
67018
67229
  });
67019
67230
  require_chunk_Cek0wNdY();
67020
- var require_dist10 = require_dist_DluLUTzR();
67021
- var require_retired_settings_keys = require_retired_settings_keys_VcrnwKN0();
67231
+ var require_dist10 = require_dist_BG0p9Azt();
67232
+ var require_retired_settings_keys = require_retired_settings_keys_Cmv1q2hJ();
67022
67233
  var node_crypto = __require("crypto");
67023
67234
  var _camstack_types_node = require_node();
67024
67235
  var JOB_HISTORY = 20;
@@ -73026,7 +73237,7 @@ var require_hub_forwarder = __commonJS({
73026
73237
  [Symbol.toStringTag]: { value: "Module" }
73027
73238
  });
73028
73239
  require_chunk_Cek0wNdY();
73029
- var require_dist10 = require_dist_DluLUTzR();
73240
+ var require_dist10 = require_dist_BG0p9Azt();
73030
73241
  var require_formatter = require_formatter_DqAKDlvN();
73031
73242
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
73032
73243
  var HubForwarderDestination = class {
@@ -73163,7 +73374,7 @@ var require_liveness_monitor_addon = __commonJS({
73163
73374
  "use strict";
73164
73375
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
73165
73376
  require_chunk_Cek0wNdY();
73166
- var require_dist10 = require_dist_DluLUTzR();
73377
+ var require_dist10 = require_dist_BG0p9Azt();
73167
73378
  var NO_DEVICES = "liveness:no-devices";
73168
73379
  var ALL_OFFLINE = "liveness:all-devices-offline";
73169
73380
  var NO_FOOTAGE_PREFIX = "liveness:no-footage:";
@@ -73359,7 +73570,7 @@ var require_local_auth_addon = __commonJS({
73359
73570
  [Symbol.toStringTag]: { value: "Module" }
73360
73571
  });
73361
73572
  var require_chunk = require_chunk_Cek0wNdY();
73362
- var require_dist10 = require_dist_DluLUTzR();
73573
+ var require_dist10 = require_dist_BG0p9Azt();
73363
73574
  var node_crypto = __require("crypto");
73364
73575
  node_crypto = require_chunk.__toESM(node_crypto);
73365
73576
  var crypto$1 = __require("crypto");
@@ -81172,7 +81383,7 @@ var require_loki_logging = __commonJS({
81172
81383
  [Symbol.toStringTag]: { value: "Module" }
81173
81384
  });
81174
81385
  require_chunk_Cek0wNdY();
81175
- var require_dist10 = require_dist_DluLUTzR();
81386
+ var require_dist10 = require_dist_BG0p9Azt();
81176
81387
  function sanitizeLabelName(raw) {
81177
81388
  const replaced = raw.replaceAll(/[^a-zA-Z0-9_]/g, "_");
81178
81389
  return /^[a-zA-Z_]/.test(replaced) ? replaced : `_${replaced}`;
@@ -81759,7 +81970,7 @@ var require_native_metrics_addon = __commonJS({
81759
81970
  [Symbol.toStringTag]: { value: "Module" }
81760
81971
  });
81761
81972
  var require_chunk = require_chunk_Cek0wNdY();
81762
- var require_dist10 = require_dist_DluLUTzR();
81973
+ var require_dist10 = require_dist_BG0p9Azt();
81763
81974
  var node_fs_promises = __require("fs/promises");
81764
81975
  var node_fs = __require("fs");
81765
81976
  node_fs = require_chunk.__toESM(node_fs);
@@ -84512,7 +84723,7 @@ var require_filesystem_storage_addon = __commonJS({
84512
84723
  [Symbol.toStringTag]: { value: "Module" }
84513
84724
  });
84514
84725
  var require_chunk = require_chunk_Cek0wNdY();
84515
- var require_dist10 = require_dist_DluLUTzR();
84726
+ var require_dist10 = require_dist_BG0p9Azt();
84516
84727
  var node_crypto = __require("crypto");
84517
84728
  var node_fs_promises = __require("fs/promises");
84518
84729
  var node_path = __require("path");
@@ -85739,8 +85950,8 @@ var require_sqlite_settings_addon = __commonJS({
85739
85950
  [Symbol.toStringTag]: { value: "Module" }
85740
85951
  });
85741
85952
  var require_chunk = require_chunk_Cek0wNdY();
85742
- var require_dist10 = require_dist_DluLUTzR();
85743
- var require_retired_settings_keys = require_retired_settings_keys_VcrnwKN0();
85953
+ var require_dist10 = require_dist_BG0p9Azt();
85954
+ var require_retired_settings_keys = require_retired_settings_keys_Cmv1q2hJ();
85744
85955
  var require_wal_checkpoint_policy = require_wal_checkpoint_policy_CCJZngds();
85745
85956
  var node_crypto = __require("crypto");
85746
85957
  var node_path = __require("path");
@@ -88527,7 +88738,7 @@ var require_storage_orchestrator_addon = __commonJS({
88527
88738
  [Symbol.toStringTag]: { value: "Module" }
88528
88739
  });
88529
88740
  var require_chunk = require_chunk_Cek0wNdY();
88530
- var require_dist10 = require_dist_DluLUTzR();
88741
+ var require_dist10 = require_dist_BG0p9Azt();
88531
88742
  var require_hub_cap_forward = require_hub_cap_forward_DmHNjbB0();
88532
88743
  var zod = require_zod();
88533
88744
  var node_crypto = __require("crypto");
@@ -92254,7 +92465,7 @@ var require_system_config_addon = __commonJS({
92254
92465
  [Symbol.toStringTag]: { value: "Module" }
92255
92466
  });
92256
92467
  require_chunk_Cek0wNdY();
92257
- var require_dist10 = require_dist_DluLUTzR();
92468
+ var require_dist10 = require_dist_BG0p9Azt();
92258
92469
  var SECTION_TITLES = {
92259
92470
  server: "Server",
92260
92471
  auth: "Authentication"
@@ -110315,7 +110526,7 @@ var require_winston_logging = __commonJS({
110315
110526
  [Symbol.toStringTag]: { value: "Module" }
110316
110527
  });
110317
110528
  var require_chunk = require_chunk_Cek0wNdY();
110318
- var require_dist10 = require_dist_DluLUTzR();
110529
+ var require_dist10 = require_dist_BG0p9Azt();
110319
110530
  var require_formatter = require_formatter_DqAKDlvN();
110320
110531
  var node_path = __require("path");
110321
110532
  node_path = require_chunk.__toESM(node_path);
@@ -112353,9 +112564,9 @@ var require_event_category_BVfsrBYA = __commonJS({
112353
112564
  }
112354
112565
  });
112355
112566
 
112356
- // ../types/dist/sleep-DqtlfkSS.js
112357
- var require_sleep_DqtlfkSS = __commonJS({
112358
- "../types/dist/sleep-DqtlfkSS.js"(exports) {
112567
+ // ../types/dist/sleep-WeJUxTv-.js
112568
+ var require_sleep_WeJUxTv = __commonJS({
112569
+ "../types/dist/sleep-WeJUxTv-.js"(exports) {
112359
112570
  "use strict";
112360
112571
  var require_event_category = require_event_category_BVfsrBYA();
112361
112572
  var zod = require_zod();
@@ -115258,6 +115469,11 @@ var require_sleep_DqtlfkSS = __commonJS({
115258
115469
  deletePreset: (input) => dispatch("ptz", "ptz", "deletePreset", "mutation", input),
115259
115470
  getOptions: (input) => dispatch("ptz", "ptz", "getOptions", "query", input),
115260
115471
  goHome: (input) => dispatch("ptz", "ptz", "goHome", "mutation", input),
115472
+ getHomePreset: (input) => dispatch("ptz", "ptz", "getHomePreset", "query", input),
115473
+ setHomePreset: (input) => dispatch("ptz", "ptz", "setHomePreset", "mutation", input),
115474
+ captureHomeHere: (input) => dispatch("ptz", "ptz", "captureHomeHere", "mutation", input),
115475
+ getHomeReturnSeconds: (input) => dispatch("ptz", "ptz", "getHomeReturnSeconds", "query", input),
115476
+ setHomeReturnSeconds: (input) => dispatch("ptz", "ptz", "setHomeReturnSeconds", "mutation", input),
115261
115477
  getPosition: (input) => dispatch("ptz", "ptz", "getPosition", "query", input),
115262
115478
  setAutofocus: (input) => dispatch("ptz", "ptz", "setAutofocus", "mutation", input),
115263
115479
  getStatus: (input) => dispatch("ptz", "ptz", "getStatus", "query", input)
@@ -116256,7 +116472,7 @@ var require_addon = __commonJS({
116256
116472
  "../types/dist/addon.js"(exports) {
116257
116473
  "use strict";
116258
116474
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
116259
- var require_sleep = require_sleep_DqtlfkSS();
116475
+ var require_sleep = require_sleep_WeJUxTv();
116260
116476
  var require_event_category = require_event_category_BVfsrBYA();
116261
116477
  var require_err_msg = require_err_msg_COpsHMw2();
116262
116478
  var CAP_INPUT_DEFAULTS = Object.freeze({
@@ -136582,7 +136798,7 @@ var require_dist3 = __commonJS({
136582
136798
  "use strict";
136583
136799
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
136584
136800
  var require_chunk = require_chunk_Cek0wNdY();
136585
- var require_dist10 = require_dist_DluLUTzR();
136801
+ var require_dist10 = require_dist_BG0p9Azt();
136586
136802
  var require_builtins_alerts_alerts_addon = require_alerts_addon();
136587
136803
  require_alerts();
136588
136804
  var require_formatter = require_formatter_DqAKDlvN();
@@ -217746,9 +217962,9 @@ var require_dist4 = __commonJS({
217746
217962
  "../types/dist/index.js"(exports) {
217747
217963
  "use strict";
217748
217964
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
217749
- var require_sleep = require_sleep_DqtlfkSS();
217965
+ var require_sleep = require_sleep_WeJUxTv();
217750
217966
  var require_event_category = require_event_category_BVfsrBYA();
217751
- var require_canonical_hash = require_canonical_hash_9lydiEzx();
217967
+ var require_canonical_hash = require_canonical_hash_CZ2JqJc3();
217752
217968
  var require_enums2 = require_enums();
217753
217969
  var require_err_msg = require_err_msg_COpsHMw2();
217754
217970
  var zod = require_zod();
@@ -244555,14 +244771,36 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
244555
244771
  if (profiles.length === 0) return null;
244556
244772
  return profiles.some((p) => p.audioEnabled);
244557
244773
  }
244774
+ var PtzPresetFunctionSchema = zod.z.enum([
244775
+ "home",
244776
+ "day-mode",
244777
+ "night-mode",
244778
+ "day-night-auto",
244779
+ "set-limits",
244780
+ "save-limits",
244781
+ "reboot",
244782
+ "osd-menu"
244783
+ ]);
244558
244784
  var PtzPresetSchema = zod.z.object({
244559
244785
  id: zod.z.string(),
244560
- name: zod.z.string()
244786
+ name: zod.z.string(),
244787
+ /**
244788
+ * The firmware function this id performs, when the provider KNOWS the id is
244789
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
244790
+ * provider does not recognise -- the two are told apart by `writable`.
244791
+ */
244792
+ fn: PtzPresetFunctionSchema.nullable(),
244793
+ /**
244794
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
244795
+ * it false only for a band it KNOWS is reserved; where the firmware is not
244796
+ * documented it stays true and a refusal comes from the camera, named.
244797
+ */
244798
+ writable: zod.z.boolean()
244561
244799
  });
244562
244800
  var PtzPositionSchema = zod.z.object({
244563
- pan: zod.z.number(),
244564
- tilt: zod.z.number(),
244565
- zoom: zod.z.number()
244801
+ pan: zod.z.number().nullable(),
244802
+ tilt: zod.z.number().nullable(),
244803
+ zoom: zod.z.number().nullable()
244566
244804
  });
244567
244805
  var PtzMoveCommandSchema = zod.z.object({
244568
244806
  pan: zod.z.number().optional(),
@@ -244580,7 +244818,42 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
244580
244818
  maxPresets: zod.z.number().optional(),
244581
244819
  /** Whether the camera exposes a controllable autofocus toggle
244582
244820
  * (boolean `hasX` per the getOptions availability convention). */
244583
- hasAutofocus: zod.z.boolean()
244821
+ hasAutofocus: zod.z.boolean(),
244822
+ /**
244823
+ * How many distinct speeds this camera's NATIVE scale offers.
244824
+ *
244825
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
244826
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
244827
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
244828
+ * meaningless, because it has eight steps and three of them round to the
244829
+ * same one. A loop that tunes its own gain has to know the granularity of
244830
+ * the knob it is turning.
244831
+ *
244832
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
244833
+ * a float). Never a made-up number.
244834
+ */
244835
+ speedSteps: zod.z.number().int().positive().nullable(),
244836
+ /**
244837
+ * How long ONE `move` pulse runs on this driver, ms.
244838
+ *
244839
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
244840
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
244841
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
244842
+ * did the head travel per pulse": without it a measured displacement has no
244843
+ * gain to be divided into.
244844
+ *
244845
+ * `null` = the driver cannot say.
244846
+ */
244847
+ moveImpulseMs: zod.z.number().int().positive().nullable()
244848
+ });
244849
+ var PtzHomePresetSchema = zod.z.object({
244850
+ presetId: zod.z.string().nullable(),
244851
+ source: zod.z.enum([
244852
+ "operator",
244853
+ "firmware",
244854
+ "native",
244855
+ "none"
244856
+ ])
244584
244857
  });
244585
244858
  var ptzCapability = {
244586
244859
  name: "ptz",
@@ -244621,7 +244894,66 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
244621
244894
  auth: "admin"
244622
244895
  }),
244623
244896
  getOptions: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), PtzOptionsSchema),
244897
+ /**
244898
+ * Move to the camera's configured home preset. THROWS when
244899
+ * `getHomePreset()` resolves to `none` -- a head that did not move must
244900
+ * never look like a head that went home.
244901
+ */
244624
244902
  goHome: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), { kind: "mutation" }),
244903
+ /** Which preset `goHome` targets, and who decided it. */
244904
+ getHomePreset: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), PtzHomePresetSchema),
244905
+ /**
244906
+ * Pin the home preset for this camera. `null` clears the operator's choice
244907
+ * and falls back to whatever the firmware names, or to `none`.
244908
+ */
244909
+ setHomePreset: require_sleep.method(zod.z.object({
244910
+ deviceId: zod.z.number(),
244911
+ presetId: zod.z.string().nullable()
244912
+ }), zod.z.void(), {
244913
+ kind: "mutation",
244914
+ auth: "admin"
244915
+ }),
244916
+ /**
244917
+ * Make WHERE THE HEAD IS POINTING RIGHT NOW this camera's home.
244918
+ *
244919
+ * `setHomePreset` takes a preset id, and a preset id is the wrong shape for
244920
+ * the most natural thing an operator does: aim the camera, then say "here".
244921
+ * It is also the only shape a camera whose home is NOT a preset can accept
244922
+ * -- Reolink's home is a guard point, a stored position with no id at all,
244923
+ * and hiding the control for that case (as the UI briefly did) left the one
244924
+ * vendor with a native home unable to set it.
244925
+ *
244926
+ * Each provider does it its own way:
244927
+ * reolink `setGrd` with `needSetPos`, pinning the guard point here
244928
+ * hikvision / amcrest save a preset, then pin it as home
244929
+ * onvif REFUSES -- its home is the PTZ origin and cannot be moved
244930
+ *
244931
+ * A provider that cannot honour it throws rather than silently doing
244932
+ * nothing: an operator who pressed "set home here" and saw no error would
244933
+ * believe it took.
244934
+ */
244935
+ captureHomeHere: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
244936
+ kind: "mutation",
244937
+ auth: "admin"
244938
+ }),
244939
+ /**
244940
+ * How long the camera waits, idle, before returning home on its own --
244941
+ * `null` when it has no such behaviour.
244942
+ *
244943
+ * Reolink's guard point carries one (`timeout`, freely settable in
244944
+ * seconds). It is a real function of the camera that we did not expose at
244945
+ * all, and it belongs next to the home it governs rather than in a vendor
244946
+ * settings page nobody associates with Home.
244947
+ */
244948
+ getHomeReturnSeconds: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.number().int().nullable()),
244949
+ /** Set the idle-return delay. Refused by a camera that has no such timer. */
244950
+ setHomeReturnSeconds: require_sleep.method(zod.z.object({
244951
+ deviceId: zod.z.number(),
244952
+ seconds: zod.z.number().int().min(0).max(3600)
244953
+ }), zod.z.void(), {
244954
+ kind: "mutation",
244955
+ auth: "admin"
244956
+ }),
244625
244957
  /**
244626
244958
  * Pull the current PTZ position. Redundant with the auto-injected
244627
244959
  * `getStatus` method (see `status` below); kept for callers that
@@ -256237,6 +256569,12 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
256237
256569
  addonId: null,
256238
256570
  access: "create"
256239
256571
  },
256572
+ "ptz.captureHomeHere": {
256573
+ capName: "ptz",
256574
+ capScope: "device",
256575
+ addonId: null,
256576
+ access: "create"
256577
+ },
256240
256578
  "ptz.continuousMove": {
256241
256579
  capName: "ptz",
256242
256580
  capScope: "device",
@@ -256249,6 +256587,18 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
256249
256587
  addonId: null,
256250
256588
  access: "delete"
256251
256589
  },
256590
+ "ptz.getHomePreset": {
256591
+ capName: "ptz",
256592
+ capScope: "device",
256593
+ addonId: null,
256594
+ access: "view"
256595
+ },
256596
+ "ptz.getHomeReturnSeconds": {
256597
+ capName: "ptz",
256598
+ capScope: "device",
256599
+ addonId: null,
256600
+ access: "view"
256601
+ },
256252
256602
  "ptz.getOptions": {
256253
256603
  capName: "ptz",
256254
256604
  capScope: "device",
@@ -256297,6 +256647,18 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
256297
256647
  addonId: null,
256298
256648
  access: "create"
256299
256649
  },
256650
+ "ptz.setHomePreset": {
256651
+ capName: "ptz",
256652
+ capScope: "device",
256653
+ addonId: null,
256654
+ access: "create"
256655
+ },
256656
+ "ptz.setHomeReturnSeconds": {
256657
+ capName: "ptz",
256658
+ capScope: "device",
256659
+ addonId: null,
256660
+ access: "create"
256661
+ },
256300
256662
  "ptz.stop": {
256301
256663
  capName: "ptz",
256302
256664
  capScope: "device",
@@ -259726,6 +260088,11 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
259726
260088
  form: "single",
259727
260089
  optional: false
259728
260090
  }],
260091
+ "ptz.captureHomeHere": [{
260092
+ name: "deviceId",
260093
+ form: "single",
260094
+ optional: false
260095
+ }],
259729
260096
  "ptz.continuousMove": [{
259730
260097
  name: "deviceId",
259731
260098
  form: "single",
@@ -259736,6 +260103,16 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
259736
260103
  form: "single",
259737
260104
  optional: false
259738
260105
  }],
260106
+ "ptz.getHomePreset": [{
260107
+ name: "deviceId",
260108
+ form: "single",
260109
+ optional: false
260110
+ }],
260111
+ "ptz.getHomeReturnSeconds": [{
260112
+ name: "deviceId",
260113
+ form: "single",
260114
+ optional: false
260115
+ }],
259739
260116
  "ptz.getOptions": [{
259740
260117
  name: "deviceId",
259741
260118
  form: "single",
@@ -259776,6 +260153,16 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
259776
260153
  form: "single",
259777
260154
  optional: false
259778
260155
  }],
260156
+ "ptz.setHomePreset": [{
260157
+ name: "deviceId",
260158
+ form: "single",
260159
+ optional: false
260160
+ }],
260161
+ "ptz.setHomeReturnSeconds": [{
260162
+ name: "deviceId",
260163
+ form: "single",
260164
+ optional: false
260165
+ }],
259779
260166
  "ptz.stop": [{
259780
260167
  name: "deviceId",
259781
260168
  form: "single",
@@ -264925,9 +265312,11 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
264925
265312
  exports.PtzAutotrackSettingsSchema = PtzAutotrackSettingsSchema;
264926
265313
  exports.PtzAutotrackStatusSchema = PtzAutotrackStatusSchema;
264927
265314
  exports.PtzAutotrackTargetOptionSchema = PtzAutotrackTargetOptionSchema;
265315
+ exports.PtzHomePresetSchema = PtzHomePresetSchema;
264928
265316
  exports.PtzMoveCommandSchema = PtzMoveCommandSchema;
264929
265317
  exports.PtzOptionsSchema = PtzOptionsSchema;
264930
265318
  exports.PtzPositionSchema = PtzPositionSchema;
265319
+ exports.PtzPresetFunctionSchema = PtzPresetFunctionSchema;
264931
265320
  exports.PtzPresetSchema = PtzPresetSchema;
264932
265321
  exports.PtzStatusSchema = PtzStatusSchema;
264933
265322
  exports.QueryFilterSchema = QueryFilterSchema;
@@ -265648,6 +266037,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
265648
266037
  exports.resolvePoolMemoryPolicy = resolvePoolMemoryPolicy;
265649
266038
  exports.resolveRecordingProfiles = resolveRecordingProfiles;
265650
266039
  exports.resolveRunnerId = resolveRunnerId;
266040
+ exports.resolveStreamMaps = require_canonical_hash.resolveStreamMaps;
265651
266041
  exports.resolveVariantModelId = resolveVariantModelId;
265652
266042
  exports.resolveViewableDeviceIds = resolveViewableDeviceIds;
265653
266043
  exports.roleSpec = roleSpec;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstack",
3
- "version": "1.2.167",
3
+ "version": "1.2.169",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",