@camstack/addon-terminal 0.1.115 → 0.1.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.
package/dist/addon.js CHANGED
@@ -5392,7 +5392,7 @@ var ZodIssueCode = {
5392
5392
  var ZodFirstPartyTypeKind;
5393
5393
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5394
5394
  //#endregion
5395
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5395
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5396
5396
  /**
5397
5397
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5398
5398
  * window to float samples (D455).
@@ -31035,14 +31035,81 @@ var privacyMaskCapability = {
31035
31035
  * whether persisting is worth a SQLite commit. */
31036
31036
  volatileStateFields: ["lastFetchedAt"]
31037
31037
  };
31038
+ /**
31039
+ * What a preset id DOES on this camera.
31040
+ *
31041
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31042
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31043
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31044
+ * firmware:
31045
+ *
31046
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31047
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31048
+ * 95 Call OSD menu
31049
+ *
31050
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31051
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31052
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31053
+ * operator as a transport failure.
31054
+ *
31055
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31056
+ * is the single most useful thing that camera can do. Only `savePreset` and
31057
+ * `deletePreset` are gated.
31058
+ */
31059
+ var PtzPresetFunctionSchema = _enum([
31060
+ "home",
31061
+ "day-mode",
31062
+ "night-mode",
31063
+ "day-night-auto",
31064
+ "set-limits",
31065
+ "save-limits",
31066
+ "reboot",
31067
+ "osd-menu"
31068
+ ]);
31038
31069
  var PtzPresetSchema = object({
31039
31070
  id: string(),
31040
- name: string()
31071
+ name: string(),
31072
+ /**
31073
+ * The firmware function this id performs, when the provider KNOWS the id is
31074
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31075
+ * provider does not recognise -- the two are told apart by `writable`.
31076
+ */
31077
+ fn: PtzPresetFunctionSchema.nullable(),
31078
+ /**
31079
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31080
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31081
+ * documented it stays true and a refusal comes from the camera, named.
31082
+ */
31083
+ writable: boolean()
31041
31084
  });
31085
+ /**
31086
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31087
+ * read it.
31088
+ *
31089
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31090
+ * position no way to say so. All four said `0`:
31091
+ *
31092
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31093
+ * path lands upstream"
31094
+ * hikvision stub, "firmware-dependent and frequently absent"
31095
+ * amcrest stub, "no generic absolute-position read for this model family"
31096
+ * onvif throws
31097
+ *
31098
+ * So every consumer asking where a camera points was told "perfectly centred"
31099
+ * by four cameras that had never looked. That is D393 -- a measurement that
31100
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31101
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31102
+ * headroom", which evacuated a healthy disk.
31103
+ *
31104
+ * D393 also says to check for a narrower structural TWIN of the result type.
31105
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31106
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31107
+ * tells callers to migrate to.
31108
+ */
31042
31109
  var PtzPositionSchema = object({
31043
- pan: number(),
31044
- tilt: number(),
31045
- zoom: number()
31110
+ pan: number().nullable(),
31111
+ tilt: number().nullable(),
31112
+ zoom: number().nullable()
31046
31113
  });
31047
31114
  var PtzMoveCommandSchema = object({
31048
31115
  pan: number().optional(),
@@ -31061,7 +31128,72 @@ var PtzOptionsSchema = object({
31061
31128
  maxPresets: number().optional(),
31062
31129
  /** Whether the camera exposes a controllable autofocus toggle
31063
31130
  * (boolean `hasX` per the getOptions availability convention). */
31064
- hasAutofocus: boolean()
31131
+ hasAutofocus: boolean(),
31132
+ /**
31133
+ * How many distinct speeds this camera's NATIVE scale offers.
31134
+ *
31135
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31136
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31137
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31138
+ * meaningless, because it has eight steps and three of them round to the
31139
+ * same one. A loop that tunes its own gain has to know the granularity of
31140
+ * the knob it is turning.
31141
+ *
31142
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31143
+ * a float). Never a made-up number.
31144
+ */
31145
+ speedSteps: number().int().positive().nullable(),
31146
+ /**
31147
+ * How long ONE `move` pulse runs on this driver, ms.
31148
+ *
31149
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31150
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31151
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31152
+ * did the head travel per pulse": without it a measured displacement has no
31153
+ * gain to be divided into.
31154
+ *
31155
+ * `null` = the driver cannot say.
31156
+ */
31157
+ moveImpulseMs: number().int().positive().nullable()
31158
+ });
31159
+ /**
31160
+ * Which preset `goHome` goes to, and WHO decided.
31161
+ *
31162
+ * `goHome` used to be three vendor "conventions" written in three comments --
31163
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31164
+ * not one of the three cameras honours its own:
31165
+ *
31166
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31167
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31168
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31169
+ *
31170
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31171
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31172
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31173
+ * needs an answer that is true per camera and audible when it is missing.
31174
+ *
31175
+ * `source` is what makes it honest:
31176
+ * - `operator` -- picked in the UI, stored by the provider.
31177
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31178
+ * "Back to origin"), adopted as the default with nothing to configure.
31179
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31180
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31181
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31182
+ * no picker.
31183
+ * - `none` -- nothing is configured and the camera names nothing.
31184
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31185
+ *
31186
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31187
+ * native case has no preset and homes perfectly well.
31188
+ */
31189
+ var PtzHomePresetSchema = object({
31190
+ presetId: string().nullable(),
31191
+ source: _enum([
31192
+ "operator",
31193
+ "firmware",
31194
+ "native",
31195
+ "none"
31196
+ ])
31065
31197
  });
31066
31198
  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({
31067
31199
  deviceId: number(),
@@ -31079,7 +31211,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31079
31211
  }), _void(), {
31080
31212
  kind: "mutation",
31081
31213
  auth: "admin"
31082
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31214
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31215
+ deviceId: number(),
31216
+ presetId: string().nullable()
31217
+ }), _void(), {
31218
+ kind: "mutation",
31219
+ auth: "admin"
31220
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31083
31221
  deviceId: number(),
31084
31222
  enabled: boolean()
31085
31223
  }), _void(), { kind: "mutation" });
@@ -39915,6 +40053,12 @@ Object.freeze({
39915
40053
  addonId: null,
39916
40054
  access: "delete"
39917
40055
  },
40056
+ "ptz.getHomePreset": {
40057
+ capName: "ptz",
40058
+ capScope: "device",
40059
+ addonId: null,
40060
+ access: "view"
40061
+ },
39918
40062
  "ptz.getOptions": {
39919
40063
  capName: "ptz",
39920
40064
  capScope: "device",
@@ -39963,6 +40107,12 @@ Object.freeze({
39963
40107
  addonId: null,
39964
40108
  access: "create"
39965
40109
  },
40110
+ "ptz.setHomePreset": {
40111
+ capName: "ptz",
40112
+ capScope: "device",
40113
+ addonId: null,
40114
+ access: "create"
40115
+ },
39966
40116
  "ptz.stop": {
39967
40117
  capName: "ptz",
39968
40118
  capScope: "device",
@@ -43136,6 +43286,11 @@ Object.freeze({
43136
43286
  form: "single",
43137
43287
  optional: false
43138
43288
  }],
43289
+ "ptz.getHomePreset": [{
43290
+ name: "deviceId",
43291
+ form: "single",
43292
+ optional: false
43293
+ }],
43139
43294
  "ptz.getOptions": [{
43140
43295
  name: "deviceId",
43141
43296
  form: "single",
@@ -43176,6 +43331,11 @@ Object.freeze({
43176
43331
  form: "single",
43177
43332
  optional: false
43178
43333
  }],
43334
+ "ptz.setHomePreset": [{
43335
+ name: "deviceId",
43336
+ form: "single",
43337
+ optional: false
43338
+ }],
43179
43339
  "ptz.stop": [{
43180
43340
  name: "deviceId",
43181
43341
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5369,7 +5369,7 @@ var ZodIssueCode = {
5369
5369
  var ZodFirstPartyTypeKind;
5370
5370
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5371
5371
  //#endregion
5372
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5372
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5373
5373
  /**
5374
5374
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5375
5375
  * window to float samples (D455).
@@ -31012,14 +31012,81 @@ var privacyMaskCapability = {
31012
31012
  * whether persisting is worth a SQLite commit. */
31013
31013
  volatileStateFields: ["lastFetchedAt"]
31014
31014
  };
31015
+ /**
31016
+ * What a preset id DOES on this camera.
31017
+ *
31018
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31019
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31020
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31021
+ * firmware:
31022
+ *
31023
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31024
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31025
+ * 95 Call OSD menu
31026
+ *
31027
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31028
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31029
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31030
+ * operator as a transport failure.
31031
+ *
31032
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31033
+ * is the single most useful thing that camera can do. Only `savePreset` and
31034
+ * `deletePreset` are gated.
31035
+ */
31036
+ var PtzPresetFunctionSchema = _enum([
31037
+ "home",
31038
+ "day-mode",
31039
+ "night-mode",
31040
+ "day-night-auto",
31041
+ "set-limits",
31042
+ "save-limits",
31043
+ "reboot",
31044
+ "osd-menu"
31045
+ ]);
31015
31046
  var PtzPresetSchema = object({
31016
31047
  id: string(),
31017
- name: string()
31048
+ name: string(),
31049
+ /**
31050
+ * The firmware function this id performs, when the provider KNOWS the id is
31051
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31052
+ * provider does not recognise -- the two are told apart by `writable`.
31053
+ */
31054
+ fn: PtzPresetFunctionSchema.nullable(),
31055
+ /**
31056
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31057
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31058
+ * documented it stays true and a refusal comes from the camera, named.
31059
+ */
31060
+ writable: boolean()
31018
31061
  });
31062
+ /**
31063
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31064
+ * read it.
31065
+ *
31066
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31067
+ * position no way to say so. All four said `0`:
31068
+ *
31069
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31070
+ * path lands upstream"
31071
+ * hikvision stub, "firmware-dependent and frequently absent"
31072
+ * amcrest stub, "no generic absolute-position read for this model family"
31073
+ * onvif throws
31074
+ *
31075
+ * So every consumer asking where a camera points was told "perfectly centred"
31076
+ * by four cameras that had never looked. That is D393 -- a measurement that
31077
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31078
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31079
+ * headroom", which evacuated a healthy disk.
31080
+ *
31081
+ * D393 also says to check for a narrower structural TWIN of the result type.
31082
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31083
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31084
+ * tells callers to migrate to.
31085
+ */
31019
31086
  var PtzPositionSchema = object({
31020
- pan: number(),
31021
- tilt: number(),
31022
- zoom: number()
31087
+ pan: number().nullable(),
31088
+ tilt: number().nullable(),
31089
+ zoom: number().nullable()
31023
31090
  });
31024
31091
  var PtzMoveCommandSchema = object({
31025
31092
  pan: number().optional(),
@@ -31038,7 +31105,72 @@ var PtzOptionsSchema = object({
31038
31105
  maxPresets: number().optional(),
31039
31106
  /** Whether the camera exposes a controllable autofocus toggle
31040
31107
  * (boolean `hasX` per the getOptions availability convention). */
31041
- hasAutofocus: boolean()
31108
+ hasAutofocus: boolean(),
31109
+ /**
31110
+ * How many distinct speeds this camera's NATIVE scale offers.
31111
+ *
31112
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31113
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31114
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31115
+ * meaningless, because it has eight steps and three of them round to the
31116
+ * same one. A loop that tunes its own gain has to know the granularity of
31117
+ * the knob it is turning.
31118
+ *
31119
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31120
+ * a float). Never a made-up number.
31121
+ */
31122
+ speedSteps: number().int().positive().nullable(),
31123
+ /**
31124
+ * How long ONE `move` pulse runs on this driver, ms.
31125
+ *
31126
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31127
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31128
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31129
+ * did the head travel per pulse": without it a measured displacement has no
31130
+ * gain to be divided into.
31131
+ *
31132
+ * `null` = the driver cannot say.
31133
+ */
31134
+ moveImpulseMs: number().int().positive().nullable()
31135
+ });
31136
+ /**
31137
+ * Which preset `goHome` goes to, and WHO decided.
31138
+ *
31139
+ * `goHome` used to be three vendor "conventions" written in three comments --
31140
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31141
+ * not one of the three cameras honours its own:
31142
+ *
31143
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31144
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31145
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31146
+ *
31147
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31148
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31149
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31150
+ * needs an answer that is true per camera and audible when it is missing.
31151
+ *
31152
+ * `source` is what makes it honest:
31153
+ * - `operator` -- picked in the UI, stored by the provider.
31154
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31155
+ * "Back to origin"), adopted as the default with nothing to configure.
31156
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31157
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31158
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31159
+ * no picker.
31160
+ * - `none` -- nothing is configured and the camera names nothing.
31161
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31162
+ *
31163
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31164
+ * native case has no preset and homes perfectly well.
31165
+ */
31166
+ var PtzHomePresetSchema = object({
31167
+ presetId: string().nullable(),
31168
+ source: _enum([
31169
+ "operator",
31170
+ "firmware",
31171
+ "native",
31172
+ "none"
31173
+ ])
31042
31174
  });
31043
31175
  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({
31044
31176
  deviceId: number(),
@@ -31056,7 +31188,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31056
31188
  }), _void(), {
31057
31189
  kind: "mutation",
31058
31190
  auth: "admin"
31059
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31191
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31192
+ deviceId: number(),
31193
+ presetId: string().nullable()
31194
+ }), _void(), {
31195
+ kind: "mutation",
31196
+ auth: "admin"
31197
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31060
31198
  deviceId: number(),
31061
31199
  enabled: boolean()
31062
31200
  }), _void(), { kind: "mutation" });
@@ -39892,6 +40030,12 @@ Object.freeze({
39892
40030
  addonId: null,
39893
40031
  access: "delete"
39894
40032
  },
40033
+ "ptz.getHomePreset": {
40034
+ capName: "ptz",
40035
+ capScope: "device",
40036
+ addonId: null,
40037
+ access: "view"
40038
+ },
39895
40039
  "ptz.getOptions": {
39896
40040
  capName: "ptz",
39897
40041
  capScope: "device",
@@ -39940,6 +40084,12 @@ Object.freeze({
39940
40084
  addonId: null,
39941
40085
  access: "create"
39942
40086
  },
40087
+ "ptz.setHomePreset": {
40088
+ capName: "ptz",
40089
+ capScope: "device",
40090
+ addonId: null,
40091
+ access: "create"
40092
+ },
39943
40093
  "ptz.stop": {
39944
40094
  capName: "ptz",
39945
40095
  capScope: "device",
@@ -43113,6 +43263,11 @@ Object.freeze({
43113
43263
  form: "single",
43114
43264
  optional: false
43115
43265
  }],
43266
+ "ptz.getHomePreset": [{
43267
+ name: "deviceId",
43268
+ form: "single",
43269
+ optional: false
43270
+ }],
43116
43271
  "ptz.getOptions": [{
43117
43272
  name: "deviceId",
43118
43273
  form: "single",
@@ -43153,6 +43308,11 @@ Object.freeze({
43153
43308
  form: "single",
43154
43309
  optional: false
43155
43310
  }],
43311
+ "ptz.setHomePreset": [{
43312
+ name: "deviceId",
43313
+ form: "single",
43314
+ optional: false
43315
+ }],
43156
43316
  "ptz.stop": [{
43157
43317
  name: "deviceId",
43158
43318
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.115",
3
+ "version": "0.1.116",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",