@camstack/addon-provider-amcrest 0.2.40 → 0.2.43

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
@@ -13875,6 +13875,50 @@ var NodeProcessSchema = object({
13875
13875
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13876
13876
  uptimeSec: number()
13877
13877
  });
13878
+ /**
13879
+ * One retained container-memory reading.
13880
+ *
13881
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13882
+ * a second clock: that is what makes "processes sum to X, container says Y"
13883
+ * subtractable per point rather than an eyeballed comparison of two series
13884
+ * sampled at different instants.
13885
+ *
13886
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13887
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13888
+ * never coexisted, and a mean would smear away the peak this exists to find.
13889
+ */
13890
+ var ContainerMemoryPointSchema = object({
13891
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13892
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13893
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13894
+ currentBytes: number(),
13895
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13896
+ limitBytes: number().nullable(),
13897
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13898
+ anonBytes: number().nullable(),
13899
+ /** Page cache. Charged to the cgroup, owned by no process. */
13900
+ fileBytes: number().nullable(),
13901
+ /**
13902
+ * Shared memory — and the field that explained the largest single surprise.
13903
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13904
+ * hardware-decode session holding DRM objects is charged HERE and appears
13905
+ * nowhere in a `ps` scan.
13906
+ */
13907
+ shmemBytes: number().nullable(),
13908
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13909
+ slabBytes: number().nullable(),
13910
+ /**
13911
+ * Shrinkable i915 GEM object bytes, from debugfs.
13912
+ *
13913
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13914
+ * component of `currentBytes` and must not be subtracted from it; it says
13915
+ * what put the shmem there, where `shmemBytes` only says how much.
13916
+ *
13917
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13918
+ * container today — and on any node with no Intel GPU.
13919
+ */
13920
+ gpuShmemBytes: number().nullable()
13921
+ }).extend({ atMs: number() });
13878
13922
  var DumpHeapSnapshotInputSchema = object({
13879
13923
  /** The addon whose runner should dump a heap snapshot. */
13880
13924
  addonId: string() });
@@ -13938,6 +13982,21 @@ var NodeLoadSeriesSchema = object({
13938
13982
  /** One entry per function seen in the window, heaviest-first. */
13939
13983
  series: array(LoadFunctionSeriesSchema).readonly(),
13940
13984
  /**
13985
+ * The CONTAINER's memory over the same window, oldest-first.
13986
+ *
13987
+ * Sits next to `series` rather than in a method of its own because the whole
13988
+ * question is a subtraction: the per-process rows in `series` sum to one
13989
+ * number and this one is another, and an operator who has to issue two calls
13990
+ * to compare them will compare two different instants. Same reader, same
13991
+ * `sinceMs`, same `bucketMs`, same timestamps.
13992
+ *
13993
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
13994
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
13995
+ * points at all. A zero here would be indistinguishable from a healthy
13996
+ * container and is precisely the lie this field exists to avoid.
13997
+ */
13998
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
13999
+ /**
13941
14000
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13942
14001
  * reduction was needed — so a caller can always say what one point covers
13943
14002
  * without having to know whether it was reduced.
@@ -24980,6 +25039,33 @@ var intercomCapability = {
24980
25039
  deviceNative: true,
24981
25040
  mode: "singleton",
24982
25041
  deviceTypes: [DeviceType.Camera],
25042
+ /**
25043
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25044
+ *
25045
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25046
+ * cap has no configuration surface at all: all six methods open, feed and
25047
+ * close one live audio session against one `deviceId`. That is the same
25048
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25049
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25050
+ * `admin` because they change what the device IS.
25051
+ *
25052
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25053
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25054
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25055
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25056
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25057
+ * camera 7.
25058
+ *
25059
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25060
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25061
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25062
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25063
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25064
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25065
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25066
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25067
+ * preset promises a cap no row of that preset can reach.
25068
+ */
24983
25069
  methods: {
24984
25070
  /**
24985
25071
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -24992,7 +25078,7 @@ var intercomCapability = {
24992
25078
  sdpOffer: string()
24993
25079
  }), {
24994
25080
  kind: "mutation",
24995
- auth: "admin"
25081
+ auth: "protected"
24996
25082
  }),
24997
25083
  handleAnswer: method(object({
24998
25084
  deviceId: number(),
@@ -25000,7 +25086,7 @@ var intercomCapability = {
25000
25086
  sdpAnswer: string()
25001
25087
  }), _void(), {
25002
25088
  kind: "mutation",
25003
- auth: "admin"
25089
+ auth: "protected"
25004
25090
  }),
25005
25091
  /** Close explicitly. Server also auto-closes on 30s idle. */
25006
25092
  stopSession: method(object({
@@ -25008,7 +25094,7 @@ var intercomCapability = {
25008
25094
  sessionId: string()
25009
25095
  }), _void(), {
25010
25096
  kind: "mutation",
25011
- auth: "admin"
25097
+ auth: "protected"
25012
25098
  }),
25013
25099
  /**
25014
25100
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25021,7 +25107,7 @@ var intercomCapability = {
25021
25107
  */
25022
25108
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25023
25109
  kind: "mutation",
25024
- auth: "admin"
25110
+ auth: "protected"
25025
25111
  }),
25026
25112
  /**
25027
25113
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25056,12 +25142,12 @@ var intercomCapability = {
25056
25142
  sequenceNumber: number().int()
25057
25143
  }), object({ accepted: boolean() }), {
25058
25144
  kind: "mutation",
25059
- auth: "admin"
25145
+ auth: "protected"
25060
25146
  }),
25061
25147
  /** Close the raw-PCM talk session. Idempotent. */
25062
25148
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25063
25149
  kind: "mutation",
25064
- auth: "admin"
25150
+ auth: "protected"
25065
25151
  })
25066
25152
  },
25067
25153
  events: { onStatusChanged: { data: object({
@@ -27825,10 +27911,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27825
27911
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
27826
27912
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
27827
27913
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
27828
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
27829
- * annotations that are not exposed here and must not be treated as an event
27830
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
27831
- * (`interfaces/recording-config.ts`).
27914
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
27915
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
27916
+ * ever read them. Event<->footage joins are by time, padded with the shared
27917
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
27832
27918
  */
27833
27919
  var RecordingStatusSchema = object({
27834
27920
  deviceId: number(),
package/dist/addon.mjs CHANGED
@@ -13876,6 +13876,50 @@ var NodeProcessSchema = object({
13876
13876
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13877
13877
  uptimeSec: number()
13878
13878
  });
13879
+ /**
13880
+ * One retained container-memory reading.
13881
+ *
13882
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13883
+ * a second clock: that is what makes "processes sum to X, container says Y"
13884
+ * subtractable per point rather than an eyeballed comparison of two series
13885
+ * sampled at different instants.
13886
+ *
13887
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13888
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13889
+ * never coexisted, and a mean would smear away the peak this exists to find.
13890
+ */
13891
+ var ContainerMemoryPointSchema = object({
13892
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13893
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13894
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13895
+ currentBytes: number(),
13896
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13897
+ limitBytes: number().nullable(),
13898
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13899
+ anonBytes: number().nullable(),
13900
+ /** Page cache. Charged to the cgroup, owned by no process. */
13901
+ fileBytes: number().nullable(),
13902
+ /**
13903
+ * Shared memory — and the field that explained the largest single surprise.
13904
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13905
+ * hardware-decode session holding DRM objects is charged HERE and appears
13906
+ * nowhere in a `ps` scan.
13907
+ */
13908
+ shmemBytes: number().nullable(),
13909
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13910
+ slabBytes: number().nullable(),
13911
+ /**
13912
+ * Shrinkable i915 GEM object bytes, from debugfs.
13913
+ *
13914
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13915
+ * component of `currentBytes` and must not be subtracted from it; it says
13916
+ * what put the shmem there, where `shmemBytes` only says how much.
13917
+ *
13918
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13919
+ * container today — and on any node with no Intel GPU.
13920
+ */
13921
+ gpuShmemBytes: number().nullable()
13922
+ }).extend({ atMs: number() });
13879
13923
  var DumpHeapSnapshotInputSchema = object({
13880
13924
  /** The addon whose runner should dump a heap snapshot. */
13881
13925
  addonId: string() });
@@ -13939,6 +13983,21 @@ var NodeLoadSeriesSchema = object({
13939
13983
  /** One entry per function seen in the window, heaviest-first. */
13940
13984
  series: array(LoadFunctionSeriesSchema).readonly(),
13941
13985
  /**
13986
+ * The CONTAINER's memory over the same window, oldest-first.
13987
+ *
13988
+ * Sits next to `series` rather than in a method of its own because the whole
13989
+ * question is a subtraction: the per-process rows in `series` sum to one
13990
+ * number and this one is another, and an operator who has to issue two calls
13991
+ * to compare them will compare two different instants. Same reader, same
13992
+ * `sinceMs`, same `bucketMs`, same timestamps.
13993
+ *
13994
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
13995
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
13996
+ * points at all. A zero here would be indistinguishable from a healthy
13997
+ * container and is precisely the lie this field exists to avoid.
13998
+ */
13999
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14000
+ /**
13942
14001
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13943
14002
  * reduction was needed — so a caller can always say what one point covers
13944
14003
  * without having to know whether it was reduced.
@@ -24981,6 +25040,33 @@ var intercomCapability = {
24981
25040
  deviceNative: true,
24982
25041
  mode: "singleton",
24983
25042
  deviceTypes: [DeviceType.Camera],
25043
+ /**
25044
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25045
+ *
25046
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25047
+ * cap has no configuration surface at all: all six methods open, feed and
25048
+ * close one live audio session against one `deviceId`. That is the same
25049
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25050
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25051
+ * `admin` because they change what the device IS.
25052
+ *
25053
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25054
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25055
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25056
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25057
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25058
+ * camera 7.
25059
+ *
25060
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25061
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25062
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25063
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25064
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25065
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25066
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25067
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25068
+ * preset promises a cap no row of that preset can reach.
25069
+ */
24984
25070
  methods: {
24985
25071
  /**
24986
25072
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -24993,7 +25079,7 @@ var intercomCapability = {
24993
25079
  sdpOffer: string()
24994
25080
  }), {
24995
25081
  kind: "mutation",
24996
- auth: "admin"
25082
+ auth: "protected"
24997
25083
  }),
24998
25084
  handleAnswer: method(object({
24999
25085
  deviceId: number(),
@@ -25001,7 +25087,7 @@ var intercomCapability = {
25001
25087
  sdpAnswer: string()
25002
25088
  }), _void(), {
25003
25089
  kind: "mutation",
25004
- auth: "admin"
25090
+ auth: "protected"
25005
25091
  }),
25006
25092
  /** Close explicitly. Server also auto-closes on 30s idle. */
25007
25093
  stopSession: method(object({
@@ -25009,7 +25095,7 @@ var intercomCapability = {
25009
25095
  sessionId: string()
25010
25096
  }), _void(), {
25011
25097
  kind: "mutation",
25012
- auth: "admin"
25098
+ auth: "protected"
25013
25099
  }),
25014
25100
  /**
25015
25101
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25022,7 +25108,7 @@ var intercomCapability = {
25022
25108
  */
25023
25109
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25024
25110
  kind: "mutation",
25025
- auth: "admin"
25111
+ auth: "protected"
25026
25112
  }),
25027
25113
  /**
25028
25114
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25057,12 +25143,12 @@ var intercomCapability = {
25057
25143
  sequenceNumber: number().int()
25058
25144
  }), object({ accepted: boolean() }), {
25059
25145
  kind: "mutation",
25060
- auth: "admin"
25146
+ auth: "protected"
25061
25147
  }),
25062
25148
  /** Close the raw-PCM talk session. Idempotent. */
25063
25149
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25064
25150
  kind: "mutation",
25065
- auth: "admin"
25151
+ auth: "protected"
25066
25152
  })
25067
25153
  },
25068
25154
  events: { onStatusChanged: { data: object({
@@ -27826,10 +27912,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27826
27912
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
27827
27913
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
27828
27914
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
27829
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
27830
- * annotations that are not exposed here and must not be treated as an event
27831
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
27832
- * (`interfaces/recording-config.ts`).
27915
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
27916
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
27917
+ * ever read them. Event<->footage joins are by time, padded with the shared
27918
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
27833
27919
  */
27834
27920
  var RecordingStatusSchema = object({
27835
27921
  deviceId: number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-amcrest",
3
- "version": "0.2.40",
3
+ "version": "0.2.43",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",