@camstack/system 1.2.59 → 1.2.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  8. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  9. package/dist/builtins/console-logging/index.js +1 -1
  10. package/dist/builtins/console-logging/index.mjs +1 -1
  11. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  12. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  13. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  14. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  15. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  16. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  17. package/dist/builtins/hub-forwarder/index.js +1 -1
  18. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  19. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  20. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  21. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  22. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  23. package/dist/builtins/local-network/local-network.addon.js +1 -1
  24. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  25. package/dist/builtins/loki-logging/index.js +1 -1
  26. package/dist/builtins/loki-logging/index.mjs +1 -1
  27. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  28. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  29. package/dist/builtins/platform-probe/index.js +1 -1
  30. package/dist/builtins/platform-probe/index.mjs +1 -1
  31. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  32. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  33. package/dist/builtins/snapshot/index.js +1 -1
  34. package/dist/builtins/snapshot/index.mjs +1 -1
  35. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  36. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  37. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  38. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  39. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  40. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  41. package/dist/builtins/system-config/system-config.addon.js +1 -1
  42. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  43. package/dist/builtins/winston-logging/index.js +1 -1
  44. package/dist/builtins/winston-logging/index.mjs +1 -1
  45. package/dist/{dist-BqJJWCS8.mjs → dist-C5XpOjbI.mjs} +473 -15
  46. package/dist/{dist-CV6XTApk.js → dist-Cis_iV-u.js} +473 -15
  47. package/dist/index.js +1 -1
  48. package/dist/index.mjs +1 -1
  49. package/package.json +1 -1
@@ -1814,7 +1814,20 @@ var BrokerStatsSchema = zod.z.object({
1814
1814
  sampleRate: zod.z.number(),
1815
1815
  channels: zod.z.number(),
1816
1816
  supported: zod.z.boolean()
1817
- }).nullable().optional()
1817
+ }).nullable().optional(),
1818
+ /**
1819
+ * BROKER-SIDE AUDIO MUTE (D83). `true` = this broker is deliberately
1820
+ * distributing none of the device's audio, on live or recording.
1821
+ *
1822
+ * Present so a silent camera can be told apart from a broken one on the
1823
+ * stream panel itself, without cross-referencing the switch group: a
1824
+ * broker holding an `audio` track descriptor while `audioMuted` is true is
1825
+ * working exactly as asked. `audioMutedDropped` counts the audio units
1826
+ * thrown away since the current dial — it is how you confirm from stats
1827
+ * alone that the mute is on the packet path and not merely persisted.
1828
+ */
1829
+ audioMuted: zod.z.boolean().optional(),
1830
+ audioMutedDropped: zod.z.number().optional()
1818
1831
  });
1819
1832
  /**
1820
1833
  * Exporter-facing "profile restream" entry. Returned by
@@ -3206,6 +3219,19 @@ zod.z.object({
3206
3219
  * | `notifications` | `notificationRules.setDeviceMuted` | `NotificationCenter.evaluateAndEnqueue` returns before any rule is evaluated |
3207
3220
  * | `privacy-mask` | `privacyMask.setMask({ enabled })` → the CAMERA | the camera blanks the masked regions itself; every stream and recording carries the black boxes |
3208
3221
  * | `device-audio` | `privacyMask.setAudioEnabled` → the CAMERA | the camera stops encoding an audio track at all; every consumer sees silent video |
3222
+ * | `broker-audio` | `streamBroker.setDeviceAudioMute` → `DeviceOverride.audioMuted` | `StreamBroker.setAudioMuted` drops the audio plane at the source: no `type:'audio'` packet leaves `fanOutEncoded`, no RTP reaches the restreamer, and the restreamer serves the video-only SDP |
3223
+ *
3224
+ * ## `device-audio` and `broker-audio` are two functions, not two knobs
3225
+ *
3226
+ * They look adjacent and they are not the same control ([D83](../../../../docs/decisions/adr-0083.md)):
3227
+ * `device-audio` writes the CAMERA, so it is hardware privacy — the microphone
3228
+ * genuinely stops, it survives CamStack entirely, and it costs a multi-second
3229
+ * encoder restart on every flip. `broker-audio` writes THIS server, so it is
3230
+ * instant, vendor-independent and reversible without touching the camera, and
3231
+ * a camera that ignores or lacks the ISAPI/Reolink control is still silenced.
3232
+ * D62 forbids a second switch that *disagrees* with the first; these two
3233
+ * cannot disagree, because neither reads the other's store — the camera holds
3234
+ * one, the broker holds the other, and each reports its own fact.
3209
3235
  *
3210
3236
  * ## The two switches whose authority is not on this server
3211
3237
  *
@@ -3267,6 +3293,7 @@ var CameraSwitchIdSchema = zod.z.enum([
3267
3293
  "object-detection",
3268
3294
  "privacy-mask",
3269
3295
  "device-audio",
3296
+ "broker-audio",
3270
3297
  "audio-analysis",
3271
3298
  "recording",
3272
3299
  "notifications"
@@ -3292,7 +3319,8 @@ var CameraSwitchAuthoritySchema = zod.z.discriminatedUnion("kind", [
3292
3319
  zod.z.object({
3293
3320
  kind: zod.z.literal("camera-mask"),
3294
3321
  capName: zod.z.string()
3295
- })
3322
+ }),
3323
+ zod.z.object({ kind: zod.z.literal("broker-audio-mute") })
3296
3324
  ]);
3297
3325
  /**
3298
3326
  * Why a switch is not offered for this camera. Rendered instead of the
@@ -6031,7 +6059,44 @@ var streamBrokerCapability = {
6031
6059
  kind: "mutation",
6032
6060
  auth: "admin"
6033
6061
  }),
6034
- isRtspEnabled: method(zod.z.object({ brokerId: zod.z.string() }), zod.z.boolean())
6062
+ isRtspEnabled: method(zod.z.object({ brokerId: zod.z.string() }), zod.z.boolean()),
6063
+ /**
6064
+ * ── Per-device audio-plane policy (D83) ───────────────────────────
6065
+ *
6066
+ * The BROKER-side mute: while `muted`, this node distributes none of
6067
+ * the device's audio, on any plane it serves — live (WebRTC / encoded
6068
+ * subscribers) AND recording (the RTSP restreamer the recorder pulls,
6069
+ * which additionally serves the video-only SDP so the recorder's ffmpeg
6070
+ * never declares an audio stream it will not receive).
6071
+ *
6072
+ * Keyed by `deviceId`, not `brokerId`: every one of a camera's streams
6073
+ * carries the same microphone, and a per-stream answer would let main
6074
+ * and sub disagree about whether the camera is silent.
6075
+ *
6076
+ * The state lives in the broker's existing `DeviceOverride` blob — no
6077
+ * new store — and the mute is applied to a fresh broker at creation, so
6078
+ * a restart, a re-dial or a catalog republish never un-mutes a camera.
6079
+ */
6080
+ getDeviceAudioMute: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.object({
6081
+ muted: zod.z.boolean(),
6082
+ /**
6083
+ * How many live non-derived brokers currently hold the mute. Purely
6084
+ * diagnostic: `muted` is the policy and is authoritative on its own
6085
+ * (it applies to brokers that do not exist yet), while this says
6086
+ * whether anything is presently being silenced.
6087
+ */
6088
+ appliedBrokers: zod.z.number().int().nonnegative()
6089
+ })),
6090
+ setDeviceAudioMute: method(zod.z.object({
6091
+ deviceId: zod.z.number().int(),
6092
+ muted: zod.z.boolean()
6093
+ }), zod.z.object({
6094
+ muted: zod.z.boolean(),
6095
+ appliedBrokers: zod.z.number().int().nonnegative()
6096
+ }), {
6097
+ kind: "mutation",
6098
+ auth: "admin"
6099
+ })
6035
6100
  },
6036
6101
  events: {
6037
6102
  onCamStreamDemand: event(zod.z.object({
@@ -12883,6 +12948,30 @@ var TrackSourceSchema = zod.z.enum([
12883
12948
  "audio"
12884
12949
  ]);
12885
12950
  /**
12951
+ * Where a track sits in the RETRAIN lifecycle (D81).
12952
+ *
12953
+ * - `none` — never marked, or un-marked. Evictable.
12954
+ * - `staging` — the operator wants this track as training material and has not
12955
+ * finished with it. **This is the only state retention holds**: the track and
12956
+ * everything it owns (object events, crops, keyframes, CLIP vector) survive
12957
+ * the device's age window.
12958
+ * - `trained` — the retrain page has taken what it needed. The frames it chose
12959
+ * were COPIED into the retrain dataset at selection time, so the dataset no
12960
+ * longer depends on the track's media and the track becomes EVICTABLE again.
12961
+ * Terminal for the plain `markForTrain` toggle: returning it to `staging` is
12962
+ * a deliberate action of the retrain page, not a side effect of a checkbox.
12963
+ *
12964
+ * There is no `null`. The state is stored `TEXT NOT NULL DEFAULT 'none'` because
12965
+ * the store's filter language has only positive equality and `whereIn` — no
12966
+ * negation, no IS NULL — so a NULL would be unselectable by ANY predicate and
12967
+ * would make the entire pre-column history immortal in one deploy.
12968
+ */
12969
+ var RetrainStatusSchema = zod.z.enum([
12970
+ "none",
12971
+ "staging",
12972
+ "trained"
12973
+ ]);
12974
+ /**
12886
12975
  * Per-track OPERATOR flags — set by hand from the admin UI or the viewer, never
12887
12976
  * by the pipeline. Spread into `TrackSchema` and `KeyEventSchema` from one place
12888
12977
  * so the two surfaces cannot drift.
@@ -12892,18 +12981,31 @@ var TrackSourceSchema = zod.z.enum([
12892
12981
  * columns existed read as absent, and a consumer that needs a boolean should say
12893
12982
  * `flag === true`, not `flag !== false`.
12894
12983
  *
12895
- * What the flags DO is deliberately UNDEFINED at the time of writing: they are
12896
- * operator curation, and the behaviour they drive will be specified separately.
12897
- * In particular a `markForTrain` track is NOT pinned against retention — see
12898
- * `docs/decisions/adr-0059.md` for why that is a store-level change, not a flag.
12984
+ * `markForTrain` is the WIRE FACE of {@link RetrainStatusSchema}, not a column:
12985
+ * it is exactly `retrainStatus === 'staging'`, in both directions. Writing
12986
+ * `true` moves `none → staging`, writing `false` moves `staging none`, and a
12987
+ * `trained` track reports `false` while refusing both writes. The boolean is
12988
+ * kept because three surfaces drive a toggle off it; anything that needs to tell
12989
+ * "never marked" from "already trained" must read `retrainStatus`.
12990
+ *
12991
+ * `debug` does NOT pin; it is attention, not durability.
12899
12992
  */
12900
12993
  var TrackFlagFields = {
12901
- /** Operator marked this track as training material. */
12994
+ /** Operator marked this track as training material — i.e. `retrainStatus` is
12995
+ * `'staging'`. */
12902
12996
  markForTrain: zod.z.boolean().optional(),
12903
12997
  /** Operator marked this track for diagnostic attention. */
12904
12998
  debug: zod.z.boolean().optional()
12905
12999
  };
12906
13000
  /**
13001
+ * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
13002
+ * Deliberately NOT part of {@link TrackFlagFields}: that group also builds the
13003
+ * write patch, and the status is not something the toggle sets — it is what the
13004
+ * toggle's boolean is derived from. Absent on an in-RAM track never touched;
13005
+ * always present on a persisted row (the column default materialises `'none'`).
13006
+ */
13007
+ var TrackRetrainFields = { retrainStatus: RetrainStatusSchema.optional() };
13008
+ /**
12907
13009
  * The write half: a PARTIAL patch. An omitted key is left untouched, so setting
12908
13010
  * one flag can never clear the other — the toggles are independent and are
12909
13011
  * driven from three surfaces that do not know about each other.
@@ -12917,7 +13019,32 @@ var TrackFlagsPatchSchema = zod.z.object(TrackFlagFields);
12917
13019
  var TrackFlagsSchema = zod.z.object({
12918
13020
  trackId: zod.z.string(),
12919
13021
  markForTrain: zod.z.boolean(),
12920
- debug: zod.z.boolean()
13022
+ debug: zod.z.boolean(),
13023
+ /** The lifecycle state the boolean was derived from. Required here (unlike on
13024
+ * a track row) because this shape is only ever produced by the write body,
13025
+ * which always knows it — and a surface that has just written needs to render
13026
+ * `trained` without a re-fetch. */
13027
+ retrainStatus: RetrainStatusSchema
13028
+ });
13029
+ /** Per-camera slice of a training-export estimate. */
13030
+ var TrainingExportDeviceTotalsSchema = zod.z.object({
13031
+ deviceId: zod.z.number(),
13032
+ tracks: zod.z.number().int(),
13033
+ files: zod.z.number().int(),
13034
+ bytes: zod.z.number().int()
13035
+ });
13036
+ /**
13037
+ * What a training export WOULD contain. Computed from media index rows only —
13038
+ * no blob is read to produce this.
13039
+ */
13040
+ var TrainingExportSummarySchema = zod.z.object({
13041
+ generatedAt: zod.z.number(),
13042
+ trackCount: zod.z.number().int(),
13043
+ fileCount: zod.z.number().int(),
13044
+ byteCount: zod.z.number().int(),
13045
+ /** More marked tracks exist than a single pass carries. */
13046
+ truncated: zod.z.boolean(),
13047
+ devices: zod.z.array(TrainingExportDeviceTotalsSchema).readonly()
12921
13048
  });
12922
13049
  var TrackSchema = zod.z.object({
12923
13050
  trackId: zod.z.string(),
@@ -12962,7 +13089,8 @@ var TrackSchema = zod.z.object({
12962
13089
  * Populated from the persisted envelope columns on historical reads;
12963
13090
  * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
12964
13091
  envelope: TrackEnvelopeSchema.optional(),
12965
- ...TrackFlagFields
13092
+ ...TrackFlagFields,
13093
+ ...TrackRetrainFields
12966
13094
  });
12967
13095
  var BaseEventFields = {
12968
13096
  id: zod.z.string(),
@@ -13184,7 +13312,8 @@ var KeyEventSchema = zod.z.object({
13184
13312
  bestEventId: zod.z.string(),
13185
13313
  /** Track lifetime in ms (lastSeen - firstSeen). */
13186
13314
  windowMs: zod.z.number().optional(),
13187
- ...TrackFlagFields
13315
+ ...TrackFlagFields,
13316
+ ...TrackRetrainFields
13188
13317
  });
13189
13318
  zod.z.object({
13190
13319
  trackId: zod.z.string(),
@@ -13546,11 +13675,29 @@ var pipelineAnalyticsCapability = {
13546
13675
  *
13547
13676
  * `auth: 'protected'` (the default), NOT `admin`: the viewer is an
13548
13677
  * authenticated non-admin surface and two of the three call sites are
13549
- * there. Revisit if a flag ever gains an effect that costs storage
13550
- * `deleteTracks` next door is admin for exactly that reason.
13678
+ * there. The note that used to sit here said to revisit this the day a flag
13679
+ * gained an effect that costs storage, and D81 is that day — `markForTrain`
13680
+ * now pins. It STAYS protected, and the reason is that the alternative
13681
+ * makes the feature pointless: marking a track is something you do while
13682
+ * looking at it, on the surface you were already looking at it on, and that
13683
+ * surface is the viewer. What the storage cost gets instead is a BOUND — a
13684
+ * per-device pin budget enforced in the body, refusing a new pin past the
13685
+ * limit while always allowing un-marking. `deleteTracks` next door is still
13686
+ * admin, because destroying evidence and preserving it are not symmetric.
13687
+ *
13688
+ * `markForTrain` writes the retrain LIFECYCLE, not a boolean column: `true`
13689
+ * is `none → staging`, `false` is `staging → none`. A track already
13690
+ * `trained` refuses BOTH — its frames are copies inside the retrain dataset
13691
+ * and re-staging it from a generic toggle is how the same material gets
13692
+ * annotated twice under two ground truths. Returning a trained track to
13693
+ * staging is a deliberate action of the retrain page, which is also the only
13694
+ * thing that produces `trained` in the first place.
13551
13695
  *
13552
- * Returns the RESOLVED state of both flags (absent → `false`) so a caller
13553
- * can drive its toggle without a re-fetch. Rejects an unknown track.
13696
+ * Returns the RESOLVED state of both flags (absent → `false`) plus the
13697
+ * `retrainStatus` they were derived from, so a caller can drive its toggle
13698
+ * — and render a `trained` badge — without a re-fetch. Rejects an unknown
13699
+ * track, a new staging mark on a device already holding its full budget, and
13700
+ * any `markForTrain` write against a trained track.
13554
13701
  */
13555
13702
  setTrackFlags: method(zod.z.object({
13556
13703
  /** Log/audit scope only — the trackId is globally unique on its own. */
@@ -13614,6 +13761,42 @@ var pipelineAnalyticsCapability = {
13614
13761
  kind: "query",
13615
13762
  auth: "admin"
13616
13763
  }),
13764
+ /**
13765
+ * The CHEAP QUESTION, asked before any media moves: how big is the dataset
13766
+ * the marked (`markForTrain`) tracks would produce?
13767
+ *
13768
+ * Answered from media INDEX rows only — key, kind, size, timestamp — so it
13769
+ * costs ~2 KB of reads per track and no blob reads at all. The measured harm
13770
+ * behind D56 was a bulk pass that read and base64'd every blob a track owned
13771
+ * before deciding anything, taking hub-main to 82 s busy out of 120; an
13772
+ * export is that same I/O shape, so it inherits the same discipline: know
13773
+ * the size, then decide.
13774
+ *
13775
+ * `truncated` reports that more marked tracks exist than one pass carries.
13776
+ * Empty `deviceIds` ⇒ every device that has marked tracks.
13777
+ */
13778
+ getTrainingExportSummary: method(zod.z.object({ deviceIds: zod.z.array(zod.z.number()).optional() }), TrainingExportSummarySchema, {
13779
+ kind: "query",
13780
+ auth: "admin"
13781
+ }),
13782
+ /**
13783
+ * Where to download the dataset archive.
13784
+ *
13785
+ * The BYTES do not come back through this cap — they come from the returned
13786
+ * data-plane URL, which streams a tar built entry by entry. A multi-gigabyte
13787
+ * archive base64'd through a unary RPC envelope would be held whole in
13788
+ * memory twice on a hub this repo has already OOM'd once (D9/D18 are the
13789
+ * same lesson about frames). `getDownloadUrl` on `recordingExport` is the
13790
+ * precedent, and this follows it deliberately.
13791
+ *
13792
+ * The archive contains a `manifest.json` FIRST, then the stored media
13793
+ * VERBATIM under `tracks/<deviceId>/<trackId>/…`. No crop is derived and no
13794
+ * model is run: a training set's pixels must be the pixels the pipeline saw.
13795
+ */
13796
+ getTrainingExportUrl: method(zod.z.object({ deviceIds: zod.z.array(zod.z.number()).optional() }), zod.z.object({ url: zod.z.string() }), {
13797
+ kind: "query",
13798
+ auth: "admin"
13799
+ }),
13617
13800
  getEventMedia: method(zod.z.object({
13618
13801
  eventId: zod.z.string(),
13619
13802
  kind: MediaFileKindEnum.optional()
@@ -22066,6 +22249,214 @@ setOverlay: method(zod.z.object({
22066
22249
  }] }
22067
22250
  };
22068
22251
  /**
22252
+ * `osd-manager` — the ORCHESTRATOR over the device-scope `osd` cap.
22253
+ *
22254
+ * The `osd` cap is the firmware contract: it probes a camera's overlay
22255
+ * SLOTS and writes literal text into one. It has no idea WHERE that text
22256
+ * comes from, and it must not — a driver that grew a "show the temperature
22257
+ * here" feature would grow it once per vendor.
22258
+ *
22259
+ * This cap owns the other half: a per-(camera, slot) BINDING that says
22260
+ * which value feeds the slot, how it is formatted, and under which
22261
+ * conditions it is shown at all. One addon renders every binding on every
22262
+ * camera, so a new source costs zero driver code.
22263
+ *
22264
+ * Three deliberate choices, each with a rejected alternative:
22265
+ *
22266
+ * 1. A source is `(capName, valuePath)` over the kernel's device
22267
+ * runtime-state mirror — NOT a closed enum of source kinds. Every
22268
+ * cap-keyed slice a device publishes is bindable the day the cap
22269
+ * ships. The rejected alternative (one enum member per source, with
22270
+ * a resolver branch each) is what makes "add the humidity too" a
22271
+ * code change.
22272
+ * 2. The display gate reuses `NcConditionsSchema` verbatim — the
22273
+ * notification centre's condition vocabulary — rather than a parallel
22274
+ * model. An operator who has learned one condition editor has learned
22275
+ * both.
22276
+ * 3. Because the renderer's facts are device STATE and not a detection
22277
+ * record, only a SUBSET of that vocabulary can be answered here.
22278
+ * `setSlotBinding` REJECTS the rest at write time (see
22279
+ * `getConditionSupport`). It does not accept-then-fail-closed: a
22280
+ * condition that can never be true renders a permanently blank
22281
+ * overlay, and a blank overlay looks exactly like a broken camera.
22282
+ */
22283
+ /** Where a slot's value comes from. */
22284
+ var OsdSourceSchema = zod.z.discriminatedUnion("kind", [
22285
+ zod.z.object({
22286
+ kind: zod.z.literal("static"),
22287
+ text: zod.z.string().max(64)
22288
+ }),
22289
+ zod.z.object({
22290
+ kind: zod.z.literal("clock"),
22291
+ /** Token pattern: `YYYY MM DD HH mm ss`. Everything else is literal. */
22292
+ pattern: zod.z.string().min(1).max(32).default("HH:mm"),
22293
+ /** IANA zone. Omitted = the server's zone. */
22294
+ timezone: zod.z.string().min(1).max(64).optional()
22295
+ }),
22296
+ zod.z.object({
22297
+ kind: zod.z.literal("device-state"),
22298
+ deviceId: zod.z.number().int().optional(),
22299
+ capName: zod.z.string().min(1).max(64),
22300
+ /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22301
+ valuePath: zod.z.string().min(1).max(64)
22302
+ })
22303
+ ]);
22304
+ var OsdSlotBindingSchema = zod.z.object({
22305
+ /** Off = the manager stops driving this slot. It does NOT clear it. */
22306
+ enabled: zod.z.boolean().default(true),
22307
+ source: OsdSourceSchema,
22308
+ /** `${value}` and `${unit}` are substituted; every occurrence. */
22309
+ template: zod.z.string().max(96).default("${value}"),
22310
+ /** Truncate with an ellipsis past this length. Absent = no limit. */
22311
+ maxCharacters: zod.z.number().int().min(4).max(64).optional(),
22312
+ /**
22313
+ * Decimal places for a numeric value. `0` yields an integer — the
22314
+ * documented workaround for firmwares that reject `.` in overlay text.
22315
+ */
22316
+ maxDecimals: zod.z.number().int().min(0).max(4).default(1),
22317
+ /** Appended via `${unit}`. The state mirror does not carry units. */
22318
+ unitLabel: zod.z.string().max(8).optional(),
22319
+ /** Raw value → display text, e.g. `{"true":"MOTION","false":""}`. */
22320
+ valueMap: zod.z.record(zod.z.string(), zod.z.string()).optional(),
22321
+ /** Time windows in which the slot is shown. Absent = always. */
22322
+ schedule: NcScheduleSchema.optional(),
22323
+ /**
22324
+ * Display gate, in the notification centre's condition vocabulary.
22325
+ * Only the keys reported by `getConditionSupport` are accepted.
22326
+ */
22327
+ conditions: NcConditionsSchema.optional(),
22328
+ /** Rendered when the gate is closed or the value unreadable. Empty = hide. */
22329
+ fallbackText: zod.z.string().max(64).default("")
22330
+ });
22331
+ /** One camera slot, as the operator sees it: firmware truth + our binding. */
22332
+ var OsdSlotViewSchema = zod.z.object({
22333
+ slotId: zod.z.string(),
22334
+ kind: OsdOverlayKindEnum,
22335
+ /** Firmware refuses text edits (a timestamp, the channel name). */
22336
+ readOnly: zod.z.boolean(),
22337
+ cameraEnabled: zod.z.boolean(),
22338
+ cameraText: zod.z.string().optional(),
22339
+ binding: OsdSlotBindingSchema.nullable()
22340
+ });
22341
+ /**
22342
+ * What happened to one slot on one render pass. `unchanged` exists so the
22343
+ * operator can tell "we are driving this and the value is steady" from
22344
+ * "we never got there" — and so the loop can prove it is not rewriting
22345
+ * identical text to the camera every tick.
22346
+ */
22347
+ var OsdRenderOutcomeEnum = zod.z.enum([
22348
+ "written",
22349
+ "unchanged",
22350
+ "gated",
22351
+ "unreadable",
22352
+ "disabled",
22353
+ "unbound",
22354
+ "failed"
22355
+ ]);
22356
+ var OsdRenderResultSchema = zod.z.object({
22357
+ slotId: zod.z.string(),
22358
+ outcome: OsdRenderOutcomeEnum,
22359
+ /** The text the slot should carry. Empty = the slot is switched off. */
22360
+ text: zod.z.string(),
22361
+ /** Why, whenever the outcome is not a plain write. Never silent. */
22362
+ reason: zod.z.string().optional()
22363
+ });
22364
+ var OsdSourceValueTypeEnum = zod.z.enum([
22365
+ "number",
22366
+ "boolean",
22367
+ "string",
22368
+ "enum"
22369
+ ]);
22370
+ /**
22371
+ * One bindable value, derived from a cap's `runtimeState` schema — never
22372
+ * hand-listed. The editor renders from this, so a cap that ships a new
22373
+ * state field becomes bindable with no UI change.
22374
+ */
22375
+ var OsdSourceOptionSchema = zod.z.object({
22376
+ deviceId: zod.z.number().int(),
22377
+ deviceName: zod.z.string(),
22378
+ capName: zod.z.string(),
22379
+ valuePath: zod.z.string(),
22380
+ label: zod.z.string(),
22381
+ valueType: OsdSourceValueTypeEnum,
22382
+ /** Present for `enum`; the editor offers these as `valueMap` keys. */
22383
+ enumValues: zod.z.array(zod.z.string()).readonly().optional()
22384
+ });
22385
+ var osdManagerCapability = {
22386
+ name: "osd-manager",
22387
+ scope: "system",
22388
+ mode: "singleton",
22389
+ methods: {
22390
+ /**
22391
+ * The camera's slots, each with its binding. `supported: false` when
22392
+ * the camera publishes no `osd` cap — the page then says so instead
22393
+ * of rendering an empty list that reads as "no overlays configured".
22394
+ */
22395
+ getDeviceOsd: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.object({
22396
+ supported: zod.z.boolean(),
22397
+ slots: zod.z.array(OsdSlotViewSchema)
22398
+ }), { auth: "admin" }),
22399
+ /**
22400
+ * Every value bindable on this camera: its own state leaves first,
22401
+ * then every other device's. Derived from the cap definitions, so it
22402
+ * cannot drift from what the resolver can actually read.
22403
+ */
22404
+ getSourceCatalog: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.object({ sources: zod.z.array(OsdSourceOptionSchema) }), { auth: "admin" }),
22405
+ /**
22406
+ * The condition ids this gate can answer, alongside the FULL notification
22407
+ * condition catalog. Both, in one call, on purpose: an editor that showed
22408
+ * the catalog without the supported set would offer conditions that
22409
+ * `setSlotBinding` then rejects.
22410
+ */
22411
+ getConditionSupport: method(zod.z.object({}), zod.z.object({
22412
+ supported: zod.z.array(zod.z.string()),
22413
+ catalog: zod.z.array(NcConditionDescriptorSchema)
22414
+ }), { auth: "admin" }),
22415
+ /**
22416
+ * Persist a binding and render it immediately, returning the slot as
22417
+ * it now stands. Throws when the binding names an unsupported
22418
+ * condition, an unknown cap, or a value path that cap does not have.
22419
+ */
22420
+ setSlotBinding: method(zod.z.object({
22421
+ deviceId: zod.z.number().int(),
22422
+ slotId: zod.z.string().min(1),
22423
+ binding: OsdSlotBindingSchema
22424
+ }), zod.z.object({
22425
+ slot: OsdSlotViewSchema,
22426
+ render: OsdRenderResultSchema
22427
+ }), {
22428
+ kind: "mutation",
22429
+ auth: "admin"
22430
+ }),
22431
+ /** Forget the binding. The slot keeps whatever text it last carried. */
22432
+ clearSlotBinding: method(zod.z.object({
22433
+ deviceId: zod.z.number().int(),
22434
+ slotId: zod.z.string().min(1)
22435
+ }), zod.z.object({ success: zod.z.literal(true) }), {
22436
+ kind: "mutation",
22437
+ auth: "admin"
22438
+ }),
22439
+ /**
22440
+ * Render without writing. `binding` overrides the stored one so an
22441
+ * editor can preview an unsaved change. Mutation kind only to carry
22442
+ * the binding object safely; no side effects.
22443
+ */
22444
+ previewSlot: method(zod.z.object({
22445
+ deviceId: zod.z.number().int(),
22446
+ slotId: zod.z.string().min(1),
22447
+ binding: OsdSlotBindingSchema.optional()
22448
+ }), OsdRenderResultSchema, {
22449
+ kind: "mutation",
22450
+ auth: "admin"
22451
+ }),
22452
+ /** Force a render pass over one camera now, instead of at the next tick. */
22453
+ renderDevice: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.object({ results: zod.z.array(OsdRenderResultSchema) }), {
22454
+ kind: "mutation",
22455
+ auth: "admin"
22456
+ })
22457
+ }
22458
+ };
22459
+ /**
22069
22460
  * Feeder connectivity / power status — mirrors the HA petkit device-status
22070
22461
  * enum: `normal` (online, mains), `offline` (not reaching PetKit cloud),
22071
22462
  * `on_batteries` (running on battery backup). `null` until first reported.
@@ -25749,6 +26140,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
25749
26140
  numericSensorCapability,
25750
26141
  oauthIntegrationCapability,
25751
26142
  osdCapability,
26143
+ osdManagerCapability,
25752
26144
  petFeederCapability,
25753
26145
  pipelineAnalyticsCapability,
25754
26146
  pipelineExecutorCapability,
@@ -28665,6 +29057,48 @@ var METHOD_ACCESS_MAP = Object.freeze({
28665
29057
  addonId: null,
28666
29058
  access: "create"
28667
29059
  },
29060
+ "osdManager.clearSlotBinding": {
29061
+ capName: "osd-manager",
29062
+ capScope: "system",
29063
+ addonId: null,
29064
+ access: "delete"
29065
+ },
29066
+ "osdManager.getConditionSupport": {
29067
+ capName: "osd-manager",
29068
+ capScope: "system",
29069
+ addonId: null,
29070
+ access: "view"
29071
+ },
29072
+ "osdManager.getDeviceOsd": {
29073
+ capName: "osd-manager",
29074
+ capScope: "system",
29075
+ addonId: null,
29076
+ access: "view"
29077
+ },
29078
+ "osdManager.getSourceCatalog": {
29079
+ capName: "osd-manager",
29080
+ capScope: "system",
29081
+ addonId: null,
29082
+ access: "view"
29083
+ },
29084
+ "osdManager.previewSlot": {
29085
+ capName: "osd-manager",
29086
+ capScope: "system",
29087
+ addonId: null,
29088
+ access: "create"
29089
+ },
29090
+ "osdManager.renderDevice": {
29091
+ capName: "osd-manager",
29092
+ capScope: "system",
29093
+ addonId: null,
29094
+ access: "create"
29095
+ },
29096
+ "osdManager.setSlotBinding": {
29097
+ capName: "osd-manager",
29098
+ capScope: "system",
29099
+ addonId: null,
29100
+ access: "create"
29101
+ },
28668
29102
  "petFeeder.callPet": {
28669
29103
  capName: "pet-feeder",
28670
29104
  capScope: "device",
@@ -28827,6 +29261,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
28827
29261
  addonId: null,
28828
29262
  access: "view"
28829
29263
  },
29264
+ "pipelineAnalytics.getTrainingExportSummary": {
29265
+ capName: "pipeline-analytics",
29266
+ capScope: "device",
29267
+ addonId: null,
29268
+ access: "view"
29269
+ },
29270
+ "pipelineAnalytics.getTrainingExportUrl": {
29271
+ capName: "pipeline-analytics",
29272
+ capScope: "device",
29273
+ addonId: null,
29274
+ access: "view"
29275
+ },
28830
29276
  "pipelineAnalytics.listEventKinds": {
28831
29277
  capName: "pipeline-analytics",
28832
29278
  capScope: "device",
@@ -30303,6 +30749,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
30303
30749
  addonId: null,
30304
30750
  access: "view"
30305
30751
  },
30752
+ "streamBroker.getDeviceAudioMute": {
30753
+ capName: "stream-broker",
30754
+ capScope: "system",
30755
+ addonId: null,
30756
+ access: "view"
30757
+ },
30306
30758
  "streamBroker.getPreBufferInfo": {
30307
30759
  capName: "stream-broker",
30308
30760
  capScope: "system",
@@ -30423,6 +30875,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
30423
30875
  addonId: null,
30424
30876
  access: "create"
30425
30877
  },
30878
+ "streamBroker.setDeviceAudioMute": {
30879
+ capName: "stream-broker",
30880
+ capScope: "system",
30881
+ addonId: null,
30882
+ access: "create"
30883
+ },
30426
30884
  "streamBroker.setPreBufferDuration": {
30427
30885
  capName: "stream-broker",
30428
30886
  capScope: "system",
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-CV6XTApk.js");
3
+ const require_dist = require("./dist-Cis_iV-u.js");
4
4
  const require_model_download_service = require("./model-download-service-Cpc6SWzV.js");
5
5
  const require_manifest_python_deps = require("./manifest-python-deps-d4acYXVV.js");
6
6
  const require_resource_monitor = require("./resource-monitor-DNNomR-i.js");
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { $ as procedureAuthKey, Ct as asJsonObject$1, Dt as emitDownForOwnedCaps, Et as createEvent, Ft as readinessKey, H as kebabToCamel, It as resolveCapMount, K as logLevelAtMost, L as isArrayOutputSchema, Lt as scopeKey, Nt as parseJsonObject, P as extractNestedAddonId, Pt as parseJsonUnknown$1, R as isCollectionArrayMethod, Tt as asString$1, U as lifecycleJobSchema, V as isVoidInput, X as objectInputDeclaresAddonId, bt as ReadinessRegistry, c as METHOD_ACCESS_MAP, ft as errMsg$1, gt as DEVICE_STATUS_METHOD, h as addonSettingsCapability, ht as DEVICE_SETTINGS_CONTRIBUTION_METHODS, kt as expandCapMethods, l as RUNTIME_DEFAULTS, mt as DATAPLANE_SECRET_HEADER$1, q as looseSchema, t as ALL_CAPABILITY_DEFINITIONS, wt as asNumber, xt as ReadinessTimeoutError, z as isObjectInput, zt as EventCategory$1 } from "./dist-BqJJWCS8.mjs";
2
+ import { $ as procedureAuthKey, Ct as asJsonObject$1, Dt as emitDownForOwnedCaps, Et as createEvent, Ft as readinessKey, H as kebabToCamel, It as resolveCapMount, K as logLevelAtMost, L as isArrayOutputSchema, Lt as scopeKey, Nt as parseJsonObject, P as extractNestedAddonId, Pt as parseJsonUnknown$1, R as isCollectionArrayMethod, Tt as asString$1, U as lifecycleJobSchema, V as isVoidInput, X as objectInputDeclaresAddonId, bt as ReadinessRegistry, c as METHOD_ACCESS_MAP, ft as errMsg$1, gt as DEVICE_STATUS_METHOD, h as addonSettingsCapability, ht as DEVICE_SETTINGS_CONTRIBUTION_METHODS, kt as expandCapMethods, l as RUNTIME_DEFAULTS, mt as DATAPLANE_SECRET_HEADER$1, q as looseSchema, t as ALL_CAPABILITY_DEFINITIONS, wt as asNumber, xt as ReadinessTimeoutError, z as isObjectInput, zt as EventCategory$1 } from "./dist-C5XpOjbI.mjs";
3
3
  import { a as downloadModel, c as getModelFilePath, d as contentTypeFor, f as createAuthenticatedFileServer, h as resolveFilePath, i as downloadFile, l as isModelDownloaded, m as parseTokenizedUrl, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, s as fetchJson, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-D8B-4ktF.mjs";
4
4
  import { $ as buildNativeCapProxy, A as createHubCapForwardService, B as AGENT_CAP_FWD_ACTION, C as brokerTransportLink, Ct as resolveAddonClass, D as localProviderLink, E as ipcParentLink, F as createUdsLogger, G as callWithServiceDiscovery, H as CapRouteResolver, I as createUdsLoggerWithControl, J as UdsLocalTransportServer, K as createLocalTransport, L as LocalChildClient, M as createUdsEventBridge, N as createUdsEventBus, O as HUB_CAP_FWD_ACTION, P as udsChildLogToWorkerEntry, Q as encodeFrame, R as LocalChildRegistry, S as brokerCallForCap, St as runNpm, T as ipcChildLink, U as CapRouteError, V as AGENT_CAP_FWD_SERVICE, W as classifyCapRoute, X as localEndpointPath, Y as SocketChannel, Z as FrameDecoder, _ as createKernelHwAccel, _t as CapabilityHandle, a as getWorkerDeviceRegistry, b as __resetCapUsageRegistryForTests, bt as installManifestNativeDeps, c as setHubConnected, ct as NATIVE_PROVIDER_SERVICE_INFIX, d as getBrokerEventBus, dt as capBareAction, et as buildUdsNativeCapProxy, f as getMoleculerEventStats, ft as capServiceName, g as AddonDepsManager, gt as DeviceRegistry, h as subscribePassthrough, ht as serializeTypedArrays, i as createUdsAddonContext, it as mountNativeCapService, j as createParentUnownedCallHandler, k as HUB_CAP_FWD_SERVICE, l as EVENT_TOPIC_PREFIX, lt as capActionName, m as setNodeEventInterest, mt as deserializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as createAddonService, p as registerEventBusService, pt as parseCapAction, q as UdsLocalTransportClient, r as createAddonContext, s as getOrInitReadinessRegistryForClient, st as validateProviderRegistrations, t as installManifestPythonDeps, tt as createBrokerDeviceManagerApi, u as clusterEventTopic, ut as capActionSuffix, v as resolveHwAccel, vt as CapabilityUnavailableError, w as buildLinkChain, wt as createAddonDataPlaneFacility, x as getCapUsageRegistry, xt as resolveNpmInvocation, y as CapUsageRegistry, yt as copyBundledNativeModules, z as UDS_NO_ROUTE_PREFIX } from "./manifest-python-deps-CX5tGRqf.mjs";
5
5
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BkP504Vq.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.59",
3
+ "version": "1.2.60",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",