@camstack/addon-provider-tuya 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
@@ -14719,6 +14719,50 @@ var NodeProcessSchema = object({
14719
14719
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
14720
14720
  uptimeSec: number()
14721
14721
  });
14722
+ /**
14723
+ * One retained container-memory reading.
14724
+ *
14725
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
14726
+ * a second clock: that is what makes "processes sum to X, container says Y"
14727
+ * subtractable per point rather than an eyeballed comparison of two series
14728
+ * sampled at different instants.
14729
+ *
14730
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
14731
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
14732
+ * never coexisted, and a mean would smear away the peak this exists to find.
14733
+ */
14734
+ var ContainerMemoryPointSchema = object({
14735
+ /** Which hierarchy answered, so a reading is never ambiguous. */
14736
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
14737
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
14738
+ currentBytes: number(),
14739
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
14740
+ limitBytes: number().nullable(),
14741
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
14742
+ anonBytes: number().nullable(),
14743
+ /** Page cache. Charged to the cgroup, owned by no process. */
14744
+ fileBytes: number().nullable(),
14745
+ /**
14746
+ * Shared memory — and the field that explained the largest single surprise.
14747
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
14748
+ * hardware-decode session holding DRM objects is charged HERE and appears
14749
+ * nowhere in a `ps` scan.
14750
+ */
14751
+ shmemBytes: number().nullable(),
14752
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
14753
+ slabBytes: number().nullable(),
14754
+ /**
14755
+ * Shrinkable i915 GEM object bytes, from debugfs.
14756
+ *
14757
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
14758
+ * component of `currentBytes` and must not be subtracted from it; it says
14759
+ * what put the shmem there, where `shmemBytes` only says how much.
14760
+ *
14761
+ * `null` wherever debugfs is not mounted — which is inside every camstack
14762
+ * container today — and on any node with no Intel GPU.
14763
+ */
14764
+ gpuShmemBytes: number().nullable()
14765
+ }).extend({ atMs: number() });
14722
14766
  var DumpHeapSnapshotInputSchema = object({
14723
14767
  /** The addon whose runner should dump a heap snapshot. */
14724
14768
  addonId: string() });
@@ -14782,6 +14826,21 @@ var NodeLoadSeriesSchema = object({
14782
14826
  /** One entry per function seen in the window, heaviest-first. */
14783
14827
  series: array(LoadFunctionSeriesSchema).readonly(),
14784
14828
  /**
14829
+ * The CONTAINER's memory over the same window, oldest-first.
14830
+ *
14831
+ * Sits next to `series` rather than in a method of its own because the whole
14832
+ * question is a subtraction: the per-process rows in `series` sum to one
14833
+ * number and this one is another, and an operator who has to issue two calls
14834
+ * to compare them will compare two different instants. Same reader, same
14835
+ * `sinceMs`, same `bucketMs`, same timestamps.
14836
+ *
14837
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
14838
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
14839
+ * points at all. A zero here would be indistinguishable from a healthy
14840
+ * container and is precisely the lie this field exists to avoid.
14841
+ */
14842
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14843
+ /**
14785
14844
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
14786
14845
  * reduction was needed — so a caller can always say what one point covers
14787
14846
  * without having to know whether it was reduced.
@@ -25728,6 +25787,33 @@ var intercomCapability = {
25728
25787
  deviceNative: true,
25729
25788
  mode: "singleton",
25730
25789
  deviceTypes: [DeviceType.Camera],
25790
+ /**
25791
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25792
+ *
25793
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25794
+ * cap has no configuration surface at all: all six methods open, feed and
25795
+ * close one live audio session against one `deviceId`. That is the same
25796
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25797
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25798
+ * `admin` because they change what the device IS.
25799
+ *
25800
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25801
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25802
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25803
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25804
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25805
+ * camera 7.
25806
+ *
25807
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25808
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25809
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25810
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25811
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25812
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25813
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25814
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25815
+ * preset promises a cap no row of that preset can reach.
25816
+ */
25731
25817
  methods: {
25732
25818
  /**
25733
25819
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25740,7 +25826,7 @@ var intercomCapability = {
25740
25826
  sdpOffer: string()
25741
25827
  }), {
25742
25828
  kind: "mutation",
25743
- auth: "admin"
25829
+ auth: "protected"
25744
25830
  }),
25745
25831
  handleAnswer: method(object({
25746
25832
  deviceId: number(),
@@ -25748,7 +25834,7 @@ var intercomCapability = {
25748
25834
  sdpAnswer: string()
25749
25835
  }), _void(), {
25750
25836
  kind: "mutation",
25751
- auth: "admin"
25837
+ auth: "protected"
25752
25838
  }),
25753
25839
  /** Close explicitly. Server also auto-closes on 30s idle. */
25754
25840
  stopSession: method(object({
@@ -25756,7 +25842,7 @@ var intercomCapability = {
25756
25842
  sessionId: string()
25757
25843
  }), _void(), {
25758
25844
  kind: "mutation",
25759
- auth: "admin"
25845
+ auth: "protected"
25760
25846
  }),
25761
25847
  /**
25762
25848
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25769,7 +25855,7 @@ var intercomCapability = {
25769
25855
  */
25770
25856
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25771
25857
  kind: "mutation",
25772
- auth: "admin"
25858
+ auth: "protected"
25773
25859
  }),
25774
25860
  /**
25775
25861
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25804,12 +25890,12 @@ var intercomCapability = {
25804
25890
  sequenceNumber: number().int()
25805
25891
  }), object({ accepted: boolean() }), {
25806
25892
  kind: "mutation",
25807
- auth: "admin"
25893
+ auth: "protected"
25808
25894
  }),
25809
25895
  /** Close the raw-PCM talk session. Idempotent. */
25810
25896
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25811
25897
  kind: "mutation",
25812
- auth: "admin"
25898
+ auth: "protected"
25813
25899
  })
25814
25900
  },
25815
25901
  events: { onStatusChanged: { data: object({
@@ -28485,10 +28571,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
28485
28571
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
28486
28572
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
28487
28573
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
28488
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
28489
- * annotations that are not exposed here and must not be treated as an event
28490
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
28491
- * (`interfaces/recording-config.ts`).
28574
+ * rows) and are the ONLY event surface — the recorder has none. The in-RAM
28575
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
28576
+ * ever read them. Event<->footage joins are by time, padded with the shared
28577
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
28492
28578
  */
28493
28579
  var RecordingStatusSchema = object({
28494
28580
  deviceId: number(),
package/dist/addon.mjs CHANGED
@@ -14718,6 +14718,50 @@ var NodeProcessSchema = object({
14718
14718
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
14719
14719
  uptimeSec: number()
14720
14720
  });
14721
+ /**
14722
+ * One retained container-memory reading.
14723
+ *
14724
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
14725
+ * a second clock: that is what makes "processes sum to X, container says Y"
14726
+ * subtractable per point rather than an eyeballed comparison of two series
14727
+ * sampled at different instants.
14728
+ *
14729
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
14730
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
14731
+ * never coexisted, and a mean would smear away the peak this exists to find.
14732
+ */
14733
+ var ContainerMemoryPointSchema = object({
14734
+ /** Which hierarchy answered, so a reading is never ambiguous. */
14735
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
14736
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
14737
+ currentBytes: number(),
14738
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
14739
+ limitBytes: number().nullable(),
14740
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
14741
+ anonBytes: number().nullable(),
14742
+ /** Page cache. Charged to the cgroup, owned by no process. */
14743
+ fileBytes: number().nullable(),
14744
+ /**
14745
+ * Shared memory — and the field that explained the largest single surprise.
14746
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
14747
+ * hardware-decode session holding DRM objects is charged HERE and appears
14748
+ * nowhere in a `ps` scan.
14749
+ */
14750
+ shmemBytes: number().nullable(),
14751
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
14752
+ slabBytes: number().nullable(),
14753
+ /**
14754
+ * Shrinkable i915 GEM object bytes, from debugfs.
14755
+ *
14756
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
14757
+ * component of `currentBytes` and must not be subtracted from it; it says
14758
+ * what put the shmem there, where `shmemBytes` only says how much.
14759
+ *
14760
+ * `null` wherever debugfs is not mounted — which is inside every camstack
14761
+ * container today — and on any node with no Intel GPU.
14762
+ */
14763
+ gpuShmemBytes: number().nullable()
14764
+ }).extend({ atMs: number() });
14721
14765
  var DumpHeapSnapshotInputSchema = object({
14722
14766
  /** The addon whose runner should dump a heap snapshot. */
14723
14767
  addonId: string() });
@@ -14781,6 +14825,21 @@ var NodeLoadSeriesSchema = object({
14781
14825
  /** One entry per function seen in the window, heaviest-first. */
14782
14826
  series: array(LoadFunctionSeriesSchema).readonly(),
14783
14827
  /**
14828
+ * The CONTAINER's memory over the same window, oldest-first.
14829
+ *
14830
+ * Sits next to `series` rather than in a method of its own because the whole
14831
+ * question is a subtraction: the per-process rows in `series` sum to one
14832
+ * number and this one is another, and an operator who has to issue two calls
14833
+ * to compare them will compare two different instants. Same reader, same
14834
+ * `sinceMs`, same `bucketMs`, same timestamps.
14835
+ *
14836
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
14837
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
14838
+ * points at all. A zero here would be indistinguishable from a healthy
14839
+ * container and is precisely the lie this field exists to avoid.
14840
+ */
14841
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14842
+ /**
14784
14843
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
14785
14844
  * reduction was needed — so a caller can always say what one point covers
14786
14845
  * without having to know whether it was reduced.
@@ -25727,6 +25786,33 @@ var intercomCapability = {
25727
25786
  deviceNative: true,
25728
25787
  mode: "singleton",
25729
25788
  deviceTypes: [DeviceType.Camera],
25789
+ /**
25790
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25791
+ *
25792
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25793
+ * cap has no configuration surface at all: all six methods open, feed and
25794
+ * close one live audio session against one `deviceId`. That is the same
25795
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25796
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25797
+ * `admin` because they change what the device IS.
25798
+ *
25799
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25800
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25801
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25802
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25803
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25804
+ * camera 7.
25805
+ *
25806
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25807
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25808
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25809
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25810
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25811
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25812
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25813
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25814
+ * preset promises a cap no row of that preset can reach.
25815
+ */
25730
25816
  methods: {
25731
25817
  /**
25732
25818
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25739,7 +25825,7 @@ var intercomCapability = {
25739
25825
  sdpOffer: string()
25740
25826
  }), {
25741
25827
  kind: "mutation",
25742
- auth: "admin"
25828
+ auth: "protected"
25743
25829
  }),
25744
25830
  handleAnswer: method(object({
25745
25831
  deviceId: number(),
@@ -25747,7 +25833,7 @@ var intercomCapability = {
25747
25833
  sdpAnswer: string()
25748
25834
  }), _void(), {
25749
25835
  kind: "mutation",
25750
- auth: "admin"
25836
+ auth: "protected"
25751
25837
  }),
25752
25838
  /** Close explicitly. Server also auto-closes on 30s idle. */
25753
25839
  stopSession: method(object({
@@ -25755,7 +25841,7 @@ var intercomCapability = {
25755
25841
  sessionId: string()
25756
25842
  }), _void(), {
25757
25843
  kind: "mutation",
25758
- auth: "admin"
25844
+ auth: "protected"
25759
25845
  }),
25760
25846
  /**
25761
25847
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25768,7 +25854,7 @@ var intercomCapability = {
25768
25854
  */
25769
25855
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25770
25856
  kind: "mutation",
25771
- auth: "admin"
25857
+ auth: "protected"
25772
25858
  }),
25773
25859
  /**
25774
25860
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25803,12 +25889,12 @@ var intercomCapability = {
25803
25889
  sequenceNumber: number().int()
25804
25890
  }), object({ accepted: boolean() }), {
25805
25891
  kind: "mutation",
25806
- auth: "admin"
25892
+ auth: "protected"
25807
25893
  }),
25808
25894
  /** Close the raw-PCM talk session. Idempotent. */
25809
25895
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25810
25896
  kind: "mutation",
25811
- auth: "admin"
25897
+ auth: "protected"
25812
25898
  })
25813
25899
  },
25814
25900
  events: { onStatusChanged: { data: object({
@@ -28484,10 +28570,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
28484
28570
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
28485
28571
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
28486
28572
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
28487
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
28488
- * annotations that are not exposed here and must not be treated as an event
28489
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
28490
- * (`interfaces/recording-config.ts`).
28573
+ * rows) and are the ONLY event surface — the recorder has none. The in-RAM
28574
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
28575
+ * ever read them. Event<->footage joins are by time, padded with the shared
28576
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
28491
28577
  */
28492
28578
  var RecordingStatusSchema = object({
28493
28579
  deviceId: number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.39",
3
+ "version": "0.2.42",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",