@camstack/addon-provider-unifi 0.2.39 → 0.2.42

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
@@ -13882,6 +13882,50 @@ var NodeProcessSchema = object({
13882
13882
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13883
13883
  uptimeSec: number()
13884
13884
  });
13885
+ /**
13886
+ * One retained container-memory reading.
13887
+ *
13888
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13889
+ * a second clock: that is what makes "processes sum to X, container says Y"
13890
+ * subtractable per point rather than an eyeballed comparison of two series
13891
+ * sampled at different instants.
13892
+ *
13893
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13894
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13895
+ * never coexisted, and a mean would smear away the peak this exists to find.
13896
+ */
13897
+ var ContainerMemoryPointSchema = object({
13898
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13899
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13900
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13901
+ currentBytes: number(),
13902
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13903
+ limitBytes: number().nullable(),
13904
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13905
+ anonBytes: number().nullable(),
13906
+ /** Page cache. Charged to the cgroup, owned by no process. */
13907
+ fileBytes: number().nullable(),
13908
+ /**
13909
+ * Shared memory — and the field that explained the largest single surprise.
13910
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13911
+ * hardware-decode session holding DRM objects is charged HERE and appears
13912
+ * nowhere in a `ps` scan.
13913
+ */
13914
+ shmemBytes: number().nullable(),
13915
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13916
+ slabBytes: number().nullable(),
13917
+ /**
13918
+ * Shrinkable i915 GEM object bytes, from debugfs.
13919
+ *
13920
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13921
+ * component of `currentBytes` and must not be subtracted from it; it says
13922
+ * what put the shmem there, where `shmemBytes` only says how much.
13923
+ *
13924
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13925
+ * container today — and on any node with no Intel GPU.
13926
+ */
13927
+ gpuShmemBytes: number().nullable()
13928
+ }).extend({ atMs: number() });
13885
13929
  var DumpHeapSnapshotInputSchema = object({
13886
13930
  /** The addon whose runner should dump a heap snapshot. */
13887
13931
  addonId: string() });
@@ -13945,6 +13989,21 @@ var NodeLoadSeriesSchema = object({
13945
13989
  /** One entry per function seen in the window, heaviest-first. */
13946
13990
  series: array(LoadFunctionSeriesSchema).readonly(),
13947
13991
  /**
13992
+ * The CONTAINER's memory over the same window, oldest-first.
13993
+ *
13994
+ * Sits next to `series` rather than in a method of its own because the whole
13995
+ * question is a subtraction: the per-process rows in `series` sum to one
13996
+ * number and this one is another, and an operator who has to issue two calls
13997
+ * to compare them will compare two different instants. Same reader, same
13998
+ * `sinceMs`, same `bucketMs`, same timestamps.
13999
+ *
14000
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
14001
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
14002
+ * points at all. A zero here would be indistinguishable from a healthy
14003
+ * container and is precisely the lie this field exists to avoid.
14004
+ */
14005
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14006
+ /**
13948
14007
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13949
14008
  * reduction was needed — so a caller can always say what one point covers
13950
14009
  * without having to know whether it was reduced.
@@ -24900,6 +24959,33 @@ var intercomCapability = {
24900
24959
  deviceNative: true,
24901
24960
  mode: "singleton",
24902
24961
  deviceTypes: [DeviceType.Camera],
24962
+ /**
24963
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
24964
+ *
24965
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
24966
+ * cap has no configuration surface at all: all six methods open, feed and
24967
+ * close one live audio session against one `deviceId`. That is the same
24968
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
24969
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
24970
+ * `admin` because they change what the device IS.
24971
+ *
24972
+ * `protected` does not mean ungated: `protectedProcedure` runs the
24973
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
24974
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
24975
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
24976
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
24977
+ * camera 7.
24978
+ *
24979
+ * Every method was `auth: 'admin'` from the initial commit, which made the
24980
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
24981
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
24982
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
24983
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
24984
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
24985
+ * snapshots" since that same commit; the promise could not be kept. Recorded
24986
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
24987
+ * preset promises a cap no row of that preset can reach.
24988
+ */
24903
24989
  methods: {
24904
24990
  /**
24905
24991
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -24912,7 +24998,7 @@ var intercomCapability = {
24912
24998
  sdpOffer: string()
24913
24999
  }), {
24914
25000
  kind: "mutation",
24915
- auth: "admin"
25001
+ auth: "protected"
24916
25002
  }),
24917
25003
  handleAnswer: method(object({
24918
25004
  deviceId: number(),
@@ -24920,7 +25006,7 @@ var intercomCapability = {
24920
25006
  sdpAnswer: string()
24921
25007
  }), _void(), {
24922
25008
  kind: "mutation",
24923
- auth: "admin"
25009
+ auth: "protected"
24924
25010
  }),
24925
25011
  /** Close explicitly. Server also auto-closes on 30s idle. */
24926
25012
  stopSession: method(object({
@@ -24928,7 +25014,7 @@ var intercomCapability = {
24928
25014
  sessionId: string()
24929
25015
  }), _void(), {
24930
25016
  kind: "mutation",
24931
- auth: "admin"
25017
+ auth: "protected"
24932
25018
  }),
24933
25019
  /**
24934
25020
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -24941,7 +25027,7 @@ var intercomCapability = {
24941
25027
  */
24942
25028
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
24943
25029
  kind: "mutation",
24944
- auth: "admin"
25030
+ auth: "protected"
24945
25031
  }),
24946
25032
  /**
24947
25033
  * Push one chunk of talk-back audio onto the active talk session.
@@ -24976,12 +25062,12 @@ var intercomCapability = {
24976
25062
  sequenceNumber: number().int()
24977
25063
  }), object({ accepted: boolean() }), {
24978
25064
  kind: "mutation",
24979
- auth: "admin"
25065
+ auth: "protected"
24980
25066
  }),
24981
25067
  /** Close the raw-PCM talk session. Idempotent. */
24982
25068
  endTalkSession: method(object({ deviceId: number() }), _void(), {
24983
25069
  kind: "mutation",
24984
- auth: "admin"
25070
+ auth: "protected"
24985
25071
  })
24986
25072
  },
24987
25073
  events: { onStatusChanged: { data: object({
@@ -27657,10 +27743,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27657
27743
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
27658
27744
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
27659
27745
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
27660
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
27661
- * annotations that are not exposed here and must not be treated as an event
27662
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
27663
- * (`interfaces/recording-config.ts`).
27746
+ * rows) and are the ONLY event surface — the recorder has none. The in-RAM
27747
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
27748
+ * ever read them. Event<->footage joins are by time, padded with the shared
27749
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
27664
27750
  */
27665
27751
  var RecordingStatusSchema = object({
27666
27752
  deviceId: number(),
package/dist/addon.mjs CHANGED
@@ -13881,6 +13881,50 @@ var NodeProcessSchema = object({
13881
13881
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13882
13882
  uptimeSec: number()
13883
13883
  });
13884
+ /**
13885
+ * One retained container-memory reading.
13886
+ *
13887
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13888
+ * a second clock: that is what makes "processes sum to X, container says Y"
13889
+ * subtractable per point rather than an eyeballed comparison of two series
13890
+ * sampled at different instants.
13891
+ *
13892
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13893
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13894
+ * never coexisted, and a mean would smear away the peak this exists to find.
13895
+ */
13896
+ var ContainerMemoryPointSchema = object({
13897
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13898
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13899
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13900
+ currentBytes: number(),
13901
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13902
+ limitBytes: number().nullable(),
13903
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13904
+ anonBytes: number().nullable(),
13905
+ /** Page cache. Charged to the cgroup, owned by no process. */
13906
+ fileBytes: number().nullable(),
13907
+ /**
13908
+ * Shared memory — and the field that explained the largest single surprise.
13909
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13910
+ * hardware-decode session holding DRM objects is charged HERE and appears
13911
+ * nowhere in a `ps` scan.
13912
+ */
13913
+ shmemBytes: number().nullable(),
13914
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13915
+ slabBytes: number().nullable(),
13916
+ /**
13917
+ * Shrinkable i915 GEM object bytes, from debugfs.
13918
+ *
13919
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13920
+ * component of `currentBytes` and must not be subtracted from it; it says
13921
+ * what put the shmem there, where `shmemBytes` only says how much.
13922
+ *
13923
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13924
+ * container today — and on any node with no Intel GPU.
13925
+ */
13926
+ gpuShmemBytes: number().nullable()
13927
+ }).extend({ atMs: number() });
13884
13928
  var DumpHeapSnapshotInputSchema = object({
13885
13929
  /** The addon whose runner should dump a heap snapshot. */
13886
13930
  addonId: string() });
@@ -13944,6 +13988,21 @@ var NodeLoadSeriesSchema = object({
13944
13988
  /** One entry per function seen in the window, heaviest-first. */
13945
13989
  series: array(LoadFunctionSeriesSchema).readonly(),
13946
13990
  /**
13991
+ * The CONTAINER's memory over the same window, oldest-first.
13992
+ *
13993
+ * Sits next to `series` rather than in a method of its own because the whole
13994
+ * question is a subtraction: the per-process rows in `series` sum to one
13995
+ * number and this one is another, and an operator who has to issue two calls
13996
+ * to compare them will compare two different instants. Same reader, same
13997
+ * `sinceMs`, same `bucketMs`, same timestamps.
13998
+ *
13999
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
14000
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
14001
+ * points at all. A zero here would be indistinguishable from a healthy
14002
+ * container and is precisely the lie this field exists to avoid.
14003
+ */
14004
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14005
+ /**
13947
14006
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13948
14007
  * reduction was needed — so a caller can always say what one point covers
13949
14008
  * without having to know whether it was reduced.
@@ -24899,6 +24958,33 @@ var intercomCapability = {
24899
24958
  deviceNative: true,
24900
24959
  mode: "singleton",
24901
24960
  deviceTypes: [DeviceType.Camera],
24961
+ /**
24962
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
24963
+ *
24964
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
24965
+ * cap has no configuration surface at all: all six methods open, feed and
24966
+ * close one live audio session against one `deviceId`. That is the same
24967
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
24968
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
24969
+ * `admin` because they change what the device IS.
24970
+ *
24971
+ * `protected` does not mean ungated: `protectedProcedure` runs the
24972
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
24973
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
24974
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
24975
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
24976
+ * camera 7.
24977
+ *
24978
+ * Every method was `auth: 'admin'` from the initial commit, which made the
24979
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
24980
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
24981
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
24982
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
24983
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
24984
+ * snapshots" since that same commit; the promise could not be kept. Recorded
24985
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
24986
+ * preset promises a cap no row of that preset can reach.
24987
+ */
24902
24988
  methods: {
24903
24989
  /**
24904
24990
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -24911,7 +24997,7 @@ var intercomCapability = {
24911
24997
  sdpOffer: string()
24912
24998
  }), {
24913
24999
  kind: "mutation",
24914
- auth: "admin"
25000
+ auth: "protected"
24915
25001
  }),
24916
25002
  handleAnswer: method(object({
24917
25003
  deviceId: number(),
@@ -24919,7 +25005,7 @@ var intercomCapability = {
24919
25005
  sdpAnswer: string()
24920
25006
  }), _void(), {
24921
25007
  kind: "mutation",
24922
- auth: "admin"
25008
+ auth: "protected"
24923
25009
  }),
24924
25010
  /** Close explicitly. Server also auto-closes on 30s idle. */
24925
25011
  stopSession: method(object({
@@ -24927,7 +25013,7 @@ var intercomCapability = {
24927
25013
  sessionId: string()
24928
25014
  }), _void(), {
24929
25015
  kind: "mutation",
24930
- auth: "admin"
25016
+ auth: "protected"
24931
25017
  }),
24932
25018
  /**
24933
25019
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -24940,7 +25026,7 @@ var intercomCapability = {
24940
25026
  */
24941
25027
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
24942
25028
  kind: "mutation",
24943
- auth: "admin"
25029
+ auth: "protected"
24944
25030
  }),
24945
25031
  /**
24946
25032
  * Push one chunk of talk-back audio onto the active talk session.
@@ -24975,12 +25061,12 @@ var intercomCapability = {
24975
25061
  sequenceNumber: number().int()
24976
25062
  }), object({ accepted: boolean() }), {
24977
25063
  kind: "mutation",
24978
- auth: "admin"
25064
+ auth: "protected"
24979
25065
  }),
24980
25066
  /** Close the raw-PCM talk session. Idempotent. */
24981
25067
  endTalkSession: method(object({ deviceId: number() }), _void(), {
24982
25068
  kind: "mutation",
24983
- auth: "admin"
25069
+ auth: "protected"
24984
25070
  })
24985
25071
  },
24986
25072
  events: { onStatusChanged: { data: object({
@@ -27656,10 +27742,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27656
27742
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
27657
27743
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
27658
27744
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
27659
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
27660
- * annotations that are not exposed here and must not be treated as an event
27661
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
27662
- * (`interfaces/recording-config.ts`).
27745
+ * rows) and are the ONLY event surface — the recorder has none. The in-RAM
27746
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
27747
+ * ever read them. Event<->footage joins are by time, padded with the shared
27748
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
27663
27749
  */
27664
27750
  var RecordingStatusSchema = object({
27665
27751
  deviceId: number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.39",
3
+ "version": "0.2.42",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",