@camstack/addon-provider-petkit 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
@@ -15001,6 +15001,50 @@ var NodeProcessSchema = object({
15001
15001
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
15002
15002
  uptimeSec: number()
15003
15003
  });
15004
+ /**
15005
+ * One retained container-memory reading.
15006
+ *
15007
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
15008
+ * a second clock: that is what makes "processes sum to X, container says Y"
15009
+ * subtractable per point rather than an eyeballed comparison of two series
15010
+ * sampled at different instants.
15011
+ *
15012
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
15013
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
15014
+ * never coexisted, and a mean would smear away the peak this exists to find.
15015
+ */
15016
+ var ContainerMemoryPointSchema = object({
15017
+ /** Which hierarchy answered, so a reading is never ambiguous. */
15018
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
15019
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
15020
+ currentBytes: number(),
15021
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
15022
+ limitBytes: number().nullable(),
15023
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
15024
+ anonBytes: number().nullable(),
15025
+ /** Page cache. Charged to the cgroup, owned by no process. */
15026
+ fileBytes: number().nullable(),
15027
+ /**
15028
+ * Shared memory — and the field that explained the largest single surprise.
15029
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
15030
+ * hardware-decode session holding DRM objects is charged HERE and appears
15031
+ * nowhere in a `ps` scan.
15032
+ */
15033
+ shmemBytes: number().nullable(),
15034
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
15035
+ slabBytes: number().nullable(),
15036
+ /**
15037
+ * Shrinkable i915 GEM object bytes, from debugfs.
15038
+ *
15039
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
15040
+ * component of `currentBytes` and must not be subtracted from it; it says
15041
+ * what put the shmem there, where `shmemBytes` only says how much.
15042
+ *
15043
+ * `null` wherever debugfs is not mounted — which is inside every camstack
15044
+ * container today — and on any node with no Intel GPU.
15045
+ */
15046
+ gpuShmemBytes: number().nullable()
15047
+ }).extend({ atMs: number() });
15004
15048
  var DumpHeapSnapshotInputSchema = object({
15005
15049
  /** The addon whose runner should dump a heap snapshot. */
15006
15050
  addonId: string() });
@@ -15064,6 +15108,21 @@ var NodeLoadSeriesSchema = object({
15064
15108
  /** One entry per function seen in the window, heaviest-first. */
15065
15109
  series: array(LoadFunctionSeriesSchema).readonly(),
15066
15110
  /**
15111
+ * The CONTAINER's memory over the same window, oldest-first.
15112
+ *
15113
+ * Sits next to `series` rather than in a method of its own because the whole
15114
+ * question is a subtraction: the per-process rows in `series` sum to one
15115
+ * number and this one is another, and an operator who has to issue two calls
15116
+ * to compare them will compare two different instants. Same reader, same
15117
+ * `sinceMs`, same `bucketMs`, same timestamps.
15118
+ *
15119
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
15120
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
15121
+ * points at all. A zero here would be indistinguishable from a healthy
15122
+ * container and is precisely the lie this field exists to avoid.
15123
+ */
15124
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
15125
+ /**
15067
15126
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
15068
15127
  * reduction was needed — so a caller can always say what one point covers
15069
15128
  * without having to know whether it was reduced.
@@ -26010,6 +26069,33 @@ var intercomCapability = {
26010
26069
  deviceNative: true,
26011
26070
  mode: "singleton",
26012
26071
  deviceTypes: [DeviceType.Camera],
26072
+ /**
26073
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
26074
+ *
26075
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
26076
+ * cap has no configuration surface at all: all six methods open, feed and
26077
+ * close one live audio session against one `deviceId`. That is the same
26078
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
26079
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
26080
+ * `admin` because they change what the device IS.
26081
+ *
26082
+ * `protected` does not mean ungated: `protectedProcedure` runs the
26083
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
26084
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
26085
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
26086
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
26087
+ * camera 7.
26088
+ *
26089
+ * Every method was `auth: 'admin'` from the initial commit, which made the
26090
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
26091
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
26092
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
26093
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
26094
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
26095
+ * snapshots" since that same commit; the promise could not be kept. Recorded
26096
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
26097
+ * preset promises a cap no row of that preset can reach.
26098
+ */
26013
26099
  methods: {
26014
26100
  /**
26015
26101
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -26022,7 +26108,7 @@ var intercomCapability = {
26022
26108
  sdpOffer: string()
26023
26109
  }), {
26024
26110
  kind: "mutation",
26025
- auth: "admin"
26111
+ auth: "protected"
26026
26112
  }),
26027
26113
  handleAnswer: method(object({
26028
26114
  deviceId: number(),
@@ -26030,7 +26116,7 @@ var intercomCapability = {
26030
26116
  sdpAnswer: string()
26031
26117
  }), _void(), {
26032
26118
  kind: "mutation",
26033
- auth: "admin"
26119
+ auth: "protected"
26034
26120
  }),
26035
26121
  /** Close explicitly. Server also auto-closes on 30s idle. */
26036
26122
  stopSession: method(object({
@@ -26038,7 +26124,7 @@ var intercomCapability = {
26038
26124
  sessionId: string()
26039
26125
  }), _void(), {
26040
26126
  kind: "mutation",
26041
- auth: "admin"
26127
+ auth: "protected"
26042
26128
  }),
26043
26129
  /**
26044
26130
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -26051,7 +26137,7 @@ var intercomCapability = {
26051
26137
  */
26052
26138
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
26053
26139
  kind: "mutation",
26054
- auth: "admin"
26140
+ auth: "protected"
26055
26141
  }),
26056
26142
  /**
26057
26143
  * Push one chunk of talk-back audio onto the active talk session.
@@ -26086,12 +26172,12 @@ var intercomCapability = {
26086
26172
  sequenceNumber: number().int()
26087
26173
  }), object({ accepted: boolean() }), {
26088
26174
  kind: "mutation",
26089
- auth: "admin"
26175
+ auth: "protected"
26090
26176
  }),
26091
26177
  /** Close the raw-PCM talk session. Idempotent. */
26092
26178
  endTalkSession: method(object({ deviceId: number() }), _void(), {
26093
26179
  kind: "mutation",
26094
- auth: "admin"
26180
+ auth: "protected"
26095
26181
  })
26096
26182
  },
26097
26183
  events: { onStatusChanged: { data: object({
@@ -28767,10 +28853,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
28767
28853
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
28768
28854
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
28769
28855
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
28770
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
28771
- * annotations that are not exposed here and must not be treated as an event
28772
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
28773
- * (`interfaces/recording-config.ts`).
28856
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
28857
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
28858
+ * ever read them. Event<->footage joins are by time, padded with the shared
28859
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
28774
28860
  */
28775
28861
  var RecordingStatusSchema = object({
28776
28862
  deviceId: number(),
package/dist/addon.mjs CHANGED
@@ -15000,6 +15000,50 @@ var NodeProcessSchema = object({
15000
15000
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
15001
15001
  uptimeSec: number()
15002
15002
  });
15003
+ /**
15004
+ * One retained container-memory reading.
15005
+ *
15006
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
15007
+ * a second clock: that is what makes "processes sum to X, container says Y"
15008
+ * subtractable per point rather than an eyeballed comparison of two series
15009
+ * sampled at different instants.
15010
+ *
15011
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
15012
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
15013
+ * never coexisted, and a mean would smear away the peak this exists to find.
15014
+ */
15015
+ var ContainerMemoryPointSchema = object({
15016
+ /** Which hierarchy answered, so a reading is never ambiguous. */
15017
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
15018
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
15019
+ currentBytes: number(),
15020
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
15021
+ limitBytes: number().nullable(),
15022
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
15023
+ anonBytes: number().nullable(),
15024
+ /** Page cache. Charged to the cgroup, owned by no process. */
15025
+ fileBytes: number().nullable(),
15026
+ /**
15027
+ * Shared memory — and the field that explained the largest single surprise.
15028
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
15029
+ * hardware-decode session holding DRM objects is charged HERE and appears
15030
+ * nowhere in a `ps` scan.
15031
+ */
15032
+ shmemBytes: number().nullable(),
15033
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
15034
+ slabBytes: number().nullable(),
15035
+ /**
15036
+ * Shrinkable i915 GEM object bytes, from debugfs.
15037
+ *
15038
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
15039
+ * component of `currentBytes` and must not be subtracted from it; it says
15040
+ * what put the shmem there, where `shmemBytes` only says how much.
15041
+ *
15042
+ * `null` wherever debugfs is not mounted — which is inside every camstack
15043
+ * container today — and on any node with no Intel GPU.
15044
+ */
15045
+ gpuShmemBytes: number().nullable()
15046
+ }).extend({ atMs: number() });
15003
15047
  var DumpHeapSnapshotInputSchema = object({
15004
15048
  /** The addon whose runner should dump a heap snapshot. */
15005
15049
  addonId: string() });
@@ -15063,6 +15107,21 @@ var NodeLoadSeriesSchema = object({
15063
15107
  /** One entry per function seen in the window, heaviest-first. */
15064
15108
  series: array(LoadFunctionSeriesSchema).readonly(),
15065
15109
  /**
15110
+ * The CONTAINER's memory over the same window, oldest-first.
15111
+ *
15112
+ * Sits next to `series` rather than in a method of its own because the whole
15113
+ * question is a subtraction: the per-process rows in `series` sum to one
15114
+ * number and this one is another, and an operator who has to issue two calls
15115
+ * to compare them will compare two different instants. Same reader, same
15116
+ * `sinceMs`, same `bucketMs`, same timestamps.
15117
+ *
15118
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
15119
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
15120
+ * points at all. A zero here would be indistinguishable from a healthy
15121
+ * container and is precisely the lie this field exists to avoid.
15122
+ */
15123
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
15124
+ /**
15066
15125
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
15067
15126
  * reduction was needed — so a caller can always say what one point covers
15068
15127
  * without having to know whether it was reduced.
@@ -26009,6 +26068,33 @@ var intercomCapability = {
26009
26068
  deviceNative: true,
26010
26069
  mode: "singleton",
26011
26070
  deviceTypes: [DeviceType.Camera],
26071
+ /**
26072
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
26073
+ *
26074
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
26075
+ * cap has no configuration surface at all: all six methods open, feed and
26076
+ * close one live audio session against one `deviceId`. That is the same
26077
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
26078
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
26079
+ * `admin` because they change what the device IS.
26080
+ *
26081
+ * `protected` does not mean ungated: `protectedProcedure` runs the
26082
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
26083
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
26084
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
26085
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
26086
+ * camera 7.
26087
+ *
26088
+ * Every method was `auth: 'admin'` from the initial commit, which made the
26089
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
26090
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
26091
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
26092
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
26093
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
26094
+ * snapshots" since that same commit; the promise could not be kept. Recorded
26095
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
26096
+ * preset promises a cap no row of that preset can reach.
26097
+ */
26012
26098
  methods: {
26013
26099
  /**
26014
26100
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -26021,7 +26107,7 @@ var intercomCapability = {
26021
26107
  sdpOffer: string()
26022
26108
  }), {
26023
26109
  kind: "mutation",
26024
- auth: "admin"
26110
+ auth: "protected"
26025
26111
  }),
26026
26112
  handleAnswer: method(object({
26027
26113
  deviceId: number(),
@@ -26029,7 +26115,7 @@ var intercomCapability = {
26029
26115
  sdpAnswer: string()
26030
26116
  }), _void(), {
26031
26117
  kind: "mutation",
26032
- auth: "admin"
26118
+ auth: "protected"
26033
26119
  }),
26034
26120
  /** Close explicitly. Server also auto-closes on 30s idle. */
26035
26121
  stopSession: method(object({
@@ -26037,7 +26123,7 @@ var intercomCapability = {
26037
26123
  sessionId: string()
26038
26124
  }), _void(), {
26039
26125
  kind: "mutation",
26040
- auth: "admin"
26126
+ auth: "protected"
26041
26127
  }),
26042
26128
  /**
26043
26129
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -26050,7 +26136,7 @@ var intercomCapability = {
26050
26136
  */
26051
26137
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
26052
26138
  kind: "mutation",
26053
- auth: "admin"
26139
+ auth: "protected"
26054
26140
  }),
26055
26141
  /**
26056
26142
  * Push one chunk of talk-back audio onto the active talk session.
@@ -26085,12 +26171,12 @@ var intercomCapability = {
26085
26171
  sequenceNumber: number().int()
26086
26172
  }), object({ accepted: boolean() }), {
26087
26173
  kind: "mutation",
26088
- auth: "admin"
26174
+ auth: "protected"
26089
26175
  }),
26090
26176
  /** Close the raw-PCM talk session. Idempotent. */
26091
26177
  endTalkSession: method(object({ deviceId: number() }), _void(), {
26092
26178
  kind: "mutation",
26093
- auth: "admin"
26179
+ auth: "protected"
26094
26180
  })
26095
26181
  },
26096
26182
  events: { onStatusChanged: { data: object({
@@ -28766,10 +28852,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
28766
28852
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
28767
28853
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
28768
28854
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
28769
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
28770
- * annotations that are not exposed here and must not be treated as an event
28771
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
28772
- * (`interfaces/recording-config.ts`).
28855
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
28856
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
28857
+ * ever read them. Event<->footage joins are by time, padded with the shared
28858
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
28773
28859
  */
28774
28860
  var RecordingStatusSchema = object({
28775
28861
  deviceId: number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.39",
3
+ "version": "0.2.42",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",