@camstack/addon-ai 0.4.116 → 0.4.118

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/addon.js CHANGED
@@ -5520,7 +5520,7 @@ function number(params) {
5520
5520
  return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
5521
5521
  }
5522
5522
  //#endregion
5523
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5523
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5524
5524
  /**
5525
5525
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5526
5526
  * window to float samples (D455).
@@ -28999,14 +28999,81 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), PrivacyMaskOptionsSc
28999
28999
  kind: "mutation",
29000
29000
  auth: "admin"
29001
29001
  });
29002
+ /**
29003
+ * What a preset id DOES on this camera.
29004
+ *
29005
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
29006
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
29007
+ * (Hikvision) returns its own reserved band in the preset list, named by the
29008
+ * firmware:
29009
+ *
29010
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
29011
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
29012
+ * 95 Call OSD menu
29013
+ *
29014
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
29015
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
29016
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
29017
+ * operator as a transport failure.
29018
+ *
29019
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
29020
+ * is the single most useful thing that camera can do. Only `savePreset` and
29021
+ * `deletePreset` are gated.
29022
+ */
29023
+ var PtzPresetFunctionSchema = _enum([
29024
+ "home",
29025
+ "day-mode",
29026
+ "night-mode",
29027
+ "day-night-auto",
29028
+ "set-limits",
29029
+ "save-limits",
29030
+ "reboot",
29031
+ "osd-menu"
29032
+ ]);
29002
29033
  var PtzPresetSchema = object({
29003
29034
  id: string(),
29004
- name: string()
29035
+ name: string(),
29036
+ /**
29037
+ * The firmware function this id performs, when the provider KNOWS the id is
29038
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
29039
+ * provider does not recognise -- the two are told apart by `writable`.
29040
+ */
29041
+ fn: PtzPresetFunctionSchema.nullable(),
29042
+ /**
29043
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
29044
+ * it false only for a band it KNOWS is reserved; where the firmware is not
29045
+ * documented it stays true and a refusal comes from the camera, named.
29046
+ */
29047
+ writable: boolean()
29005
29048
  });
29049
+ /**
29050
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
29051
+ * read it.
29052
+ *
29053
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
29054
+ * position no way to say so. All four said `0`:
29055
+ *
29056
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
29057
+ * path lands upstream"
29058
+ * hikvision stub, "firmware-dependent and frequently absent"
29059
+ * amcrest stub, "no generic absolute-position read for this model family"
29060
+ * onvif throws
29061
+ *
29062
+ * So every consumer asking where a camera points was told "perfectly centred"
29063
+ * by four cameras that had never looked. That is D393 -- a measurement that
29064
+ * FAILED is `null`, never `0`, and the type says so all the way to the
29065
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
29066
+ * headroom", which evacuated a healthy disk.
29067
+ *
29068
+ * D393 also says to check for a narrower structural TWIN of the result type.
29069
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
29070
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
29071
+ * tells callers to migrate to.
29072
+ */
29006
29073
  var PtzPositionSchema = object({
29007
- pan: number$1(),
29008
- tilt: number$1(),
29009
- zoom: number$1()
29074
+ pan: number$1().nullable(),
29075
+ tilt: number$1().nullable(),
29076
+ zoom: number$1().nullable()
29010
29077
  });
29011
29078
  var PtzMoveCommandSchema = object({
29012
29079
  pan: number$1().optional(),
@@ -29025,7 +29092,72 @@ var PtzOptionsSchema = object({
29025
29092
  maxPresets: number$1().optional(),
29026
29093
  /** Whether the camera exposes a controllable autofocus toggle
29027
29094
  * (boolean `hasX` per the getOptions availability convention). */
29028
- hasAutofocus: boolean()
29095
+ hasAutofocus: boolean(),
29096
+ /**
29097
+ * How many distinct speeds this camera's NATIVE scale offers.
29098
+ *
29099
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
29100
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
29101
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
29102
+ * meaningless, because it has eight steps and three of them round to the
29103
+ * same one. A loop that tunes its own gain has to know the granularity of
29104
+ * the knob it is turning.
29105
+ *
29106
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
29107
+ * a float). Never a made-up number.
29108
+ */
29109
+ speedSteps: number$1().int().positive().nullable(),
29110
+ /**
29111
+ * How long ONE `move` pulse runs on this driver, ms.
29112
+ *
29113
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
29114
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
29115
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
29116
+ * did the head travel per pulse": without it a measured displacement has no
29117
+ * gain to be divided into.
29118
+ *
29119
+ * `null` = the driver cannot say.
29120
+ */
29121
+ moveImpulseMs: number$1().int().positive().nullable()
29122
+ });
29123
+ /**
29124
+ * Which preset `goHome` goes to, and WHO decided.
29125
+ *
29126
+ * `goHome` used to be three vendor "conventions" written in three comments --
29127
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
29128
+ * not one of the three cameras honours its own:
29129
+ *
29130
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
29131
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
29132
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
29133
+ *
29134
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
29135
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
29136
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
29137
+ * needs an answer that is true per camera and audible when it is missing.
29138
+ *
29139
+ * `source` is what makes it honest:
29140
+ * - `operator` -- picked in the UI, stored by the provider.
29141
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
29142
+ * "Back to origin"), adopted as the default with nothing to configure.
29143
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
29144
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
29145
+ * that is not a failure -- there is nothing to pick, and the UI must offer
29146
+ * no picker.
29147
+ * - `none` -- nothing is configured and the camera names nothing.
29148
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
29149
+ *
29150
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
29151
+ * native case has no preset and homes perfectly well.
29152
+ */
29153
+ var PtzHomePresetSchema = object({
29154
+ presetId: string().nullable(),
29155
+ source: _enum([
29156
+ "operator",
29157
+ "firmware",
29158
+ "native",
29159
+ "none"
29160
+ ])
29029
29161
  });
29030
29162
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), array(PtzPresetSchema)), method(object({
29031
29163
  deviceId: number$1(),
@@ -29043,7 +29175,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number$1() }),
29043
29175
  }), _void(), {
29044
29176
  kind: "mutation",
29045
29177
  auth: "admin"
29046
- }), method(object({ deviceId: number$1() }), PtzOptionsSchema), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), PtzPositionSchema), method(object({
29178
+ }), method(object({ deviceId: number$1() }), PtzOptionsSchema), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), PtzHomePresetSchema), method(object({
29179
+ deviceId: number$1(),
29180
+ presetId: string().nullable()
29181
+ }), _void(), {
29182
+ kind: "mutation",
29183
+ auth: "admin"
29184
+ }), method(object({ deviceId: number$1() }), PtzPositionSchema), method(object({
29047
29185
  deviceId: number$1(),
29048
29186
  enabled: boolean()
29049
29187
  }), _void(), { kind: "mutation" });
@@ -36058,6 +36196,12 @@ Object.freeze({
36058
36196
  addonId: null,
36059
36197
  access: "delete"
36060
36198
  },
36199
+ "ptz.getHomePreset": {
36200
+ capName: "ptz",
36201
+ capScope: "device",
36202
+ addonId: null,
36203
+ access: "view"
36204
+ },
36061
36205
  "ptz.getOptions": {
36062
36206
  capName: "ptz",
36063
36207
  capScope: "device",
@@ -36106,6 +36250,12 @@ Object.freeze({
36106
36250
  addonId: null,
36107
36251
  access: "create"
36108
36252
  },
36253
+ "ptz.setHomePreset": {
36254
+ capName: "ptz",
36255
+ capScope: "device",
36256
+ addonId: null,
36257
+ access: "create"
36258
+ },
36109
36259
  "ptz.stop": {
36110
36260
  capName: "ptz",
36111
36261
  capScope: "device",
@@ -39279,6 +39429,11 @@ Object.freeze({
39279
39429
  form: "single",
39280
39430
  optional: false
39281
39431
  }],
39432
+ "ptz.getHomePreset": [{
39433
+ name: "deviceId",
39434
+ form: "single",
39435
+ optional: false
39436
+ }],
39282
39437
  "ptz.getOptions": [{
39283
39438
  name: "deviceId",
39284
39439
  form: "single",
@@ -39319,6 +39474,11 @@ Object.freeze({
39319
39474
  form: "single",
39320
39475
  optional: false
39321
39476
  }],
39477
+ "ptz.setHomePreset": [{
39478
+ name: "deviceId",
39479
+ form: "single",
39480
+ optional: false
39481
+ }],
39322
39482
  "ptz.stop": [{
39323
39483
  name: "deviceId",
39324
39484
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5547,7 +5547,7 @@ function number(params) {
5547
5547
  return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
5548
5548
  }
5549
5549
  //#endregion
5550
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5550
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5551
5551
  /**
5552
5552
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5553
5553
  * window to float samples (D455).
@@ -29026,14 +29026,81 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), PrivacyMaskOptionsSc
29026
29026
  kind: "mutation",
29027
29027
  auth: "admin"
29028
29028
  });
29029
+ /**
29030
+ * What a preset id DOES on this camera.
29031
+ *
29032
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
29033
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
29034
+ * (Hikvision) returns its own reserved band in the preset list, named by the
29035
+ * firmware:
29036
+ *
29037
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
29038
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
29039
+ * 95 Call OSD menu
29040
+ *
29041
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
29042
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
29043
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
29044
+ * operator as a transport failure.
29045
+ *
29046
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
29047
+ * is the single most useful thing that camera can do. Only `savePreset` and
29048
+ * `deletePreset` are gated.
29049
+ */
29050
+ var PtzPresetFunctionSchema = _enum([
29051
+ "home",
29052
+ "day-mode",
29053
+ "night-mode",
29054
+ "day-night-auto",
29055
+ "set-limits",
29056
+ "save-limits",
29057
+ "reboot",
29058
+ "osd-menu"
29059
+ ]);
29029
29060
  var PtzPresetSchema = object({
29030
29061
  id: string(),
29031
- name: string()
29062
+ name: string(),
29063
+ /**
29064
+ * The firmware function this id performs, when the provider KNOWS the id is
29065
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
29066
+ * provider does not recognise -- the two are told apart by `writable`.
29067
+ */
29068
+ fn: PtzPresetFunctionSchema.nullable(),
29069
+ /**
29070
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
29071
+ * it false only for a band it KNOWS is reserved; where the firmware is not
29072
+ * documented it stays true and a refusal comes from the camera, named.
29073
+ */
29074
+ writable: boolean()
29032
29075
  });
29076
+ /**
29077
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
29078
+ * read it.
29079
+ *
29080
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
29081
+ * position no way to say so. All four said `0`:
29082
+ *
29083
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
29084
+ * path lands upstream"
29085
+ * hikvision stub, "firmware-dependent and frequently absent"
29086
+ * amcrest stub, "no generic absolute-position read for this model family"
29087
+ * onvif throws
29088
+ *
29089
+ * So every consumer asking where a camera points was told "perfectly centred"
29090
+ * by four cameras that had never looked. That is D393 -- a measurement that
29091
+ * FAILED is `null`, never `0`, and the type says so all the way to the
29092
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
29093
+ * headroom", which evacuated a healthy disk.
29094
+ *
29095
+ * D393 also says to check for a narrower structural TWIN of the result type.
29096
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
29097
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
29098
+ * tells callers to migrate to.
29099
+ */
29033
29100
  var PtzPositionSchema = object({
29034
- pan: number$1(),
29035
- tilt: number$1(),
29036
- zoom: number$1()
29101
+ pan: number$1().nullable(),
29102
+ tilt: number$1().nullable(),
29103
+ zoom: number$1().nullable()
29037
29104
  });
29038
29105
  var PtzMoveCommandSchema = object({
29039
29106
  pan: number$1().optional(),
@@ -29052,7 +29119,72 @@ var PtzOptionsSchema = object({
29052
29119
  maxPresets: number$1().optional(),
29053
29120
  /** Whether the camera exposes a controllable autofocus toggle
29054
29121
  * (boolean `hasX` per the getOptions availability convention). */
29055
- hasAutofocus: boolean()
29122
+ hasAutofocus: boolean(),
29123
+ /**
29124
+ * How many distinct speeds this camera's NATIVE scale offers.
29125
+ *
29126
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
29127
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
29128
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
29129
+ * meaningless, because it has eight steps and three of them round to the
29130
+ * same one. A loop that tunes its own gain has to know the granularity of
29131
+ * the knob it is turning.
29132
+ *
29133
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
29134
+ * a float). Never a made-up number.
29135
+ */
29136
+ speedSteps: number$1().int().positive().nullable(),
29137
+ /**
29138
+ * How long ONE `move` pulse runs on this driver, ms.
29139
+ *
29140
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
29141
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
29142
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
29143
+ * did the head travel per pulse": without it a measured displacement has no
29144
+ * gain to be divided into.
29145
+ *
29146
+ * `null` = the driver cannot say.
29147
+ */
29148
+ moveImpulseMs: number$1().int().positive().nullable()
29149
+ });
29150
+ /**
29151
+ * Which preset `goHome` goes to, and WHO decided.
29152
+ *
29153
+ * `goHome` used to be three vendor "conventions" written in three comments --
29154
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
29155
+ * not one of the three cameras honours its own:
29156
+ *
29157
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
29158
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
29159
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
29160
+ *
29161
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
29162
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
29163
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
29164
+ * needs an answer that is true per camera and audible when it is missing.
29165
+ *
29166
+ * `source` is what makes it honest:
29167
+ * - `operator` -- picked in the UI, stored by the provider.
29168
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
29169
+ * "Back to origin"), adopted as the default with nothing to configure.
29170
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
29171
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
29172
+ * that is not a failure -- there is nothing to pick, and the UI must offer
29173
+ * no picker.
29174
+ * - `none` -- nothing is configured and the camera names nothing.
29175
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
29176
+ *
29177
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
29178
+ * native case has no preset and homes perfectly well.
29179
+ */
29180
+ var PtzHomePresetSchema = object({
29181
+ presetId: string().nullable(),
29182
+ source: _enum([
29183
+ "operator",
29184
+ "firmware",
29185
+ "native",
29186
+ "none"
29187
+ ])
29056
29188
  });
29057
29189
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), array(PtzPresetSchema)), method(object({
29058
29190
  deviceId: number$1(),
@@ -29070,7 +29202,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number$1() }),
29070
29202
  }), _void(), {
29071
29203
  kind: "mutation",
29072
29204
  auth: "admin"
29073
- }), method(object({ deviceId: number$1() }), PtzOptionsSchema), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), PtzPositionSchema), method(object({
29205
+ }), method(object({ deviceId: number$1() }), PtzOptionsSchema), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), PtzHomePresetSchema), method(object({
29206
+ deviceId: number$1(),
29207
+ presetId: string().nullable()
29208
+ }), _void(), {
29209
+ kind: "mutation",
29210
+ auth: "admin"
29211
+ }), method(object({ deviceId: number$1() }), PtzPositionSchema), method(object({
29074
29212
  deviceId: number$1(),
29075
29213
  enabled: boolean()
29076
29214
  }), _void(), { kind: "mutation" });
@@ -36085,6 +36223,12 @@ Object.freeze({
36085
36223
  addonId: null,
36086
36224
  access: "delete"
36087
36225
  },
36226
+ "ptz.getHomePreset": {
36227
+ capName: "ptz",
36228
+ capScope: "device",
36229
+ addonId: null,
36230
+ access: "view"
36231
+ },
36088
36232
  "ptz.getOptions": {
36089
36233
  capName: "ptz",
36090
36234
  capScope: "device",
@@ -36133,6 +36277,12 @@ Object.freeze({
36133
36277
  addonId: null,
36134
36278
  access: "create"
36135
36279
  },
36280
+ "ptz.setHomePreset": {
36281
+ capName: "ptz",
36282
+ capScope: "device",
36283
+ addonId: null,
36284
+ access: "create"
36285
+ },
36136
36286
  "ptz.stop": {
36137
36287
  capName: "ptz",
36138
36288
  capScope: "device",
@@ -39306,6 +39456,11 @@ Object.freeze({
39306
39456
  form: "single",
39307
39457
  optional: false
39308
39458
  }],
39459
+ "ptz.getHomePreset": [{
39460
+ name: "deviceId",
39461
+ form: "single",
39462
+ optional: false
39463
+ }],
39309
39464
  "ptz.getOptions": [{
39310
39465
  name: "deviceId",
39311
39466
  form: "single",
@@ -39346,6 +39501,11 @@ Object.freeze({
39346
39501
  form: "single",
39347
39502
  optional: false
39348
39503
  }],
39504
+ "ptz.setHomePreset": [{
39505
+ name: "deviceId",
39506
+ form: "single",
39507
+ optional: false
39508
+ }],
39349
39509
  "ptz.stop": [{
39350
39510
  name: "deviceId",
39351
39511
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.4.116",
3
+ "version": "0.4.118",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",