@camstack/addon-terminal 0.1.44 → 0.1.47

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
@@ -13926,6 +13926,50 @@ var NodeProcessSchema = object({
13926
13926
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13927
13927
  uptimeSec: number()
13928
13928
  });
13929
+ /**
13930
+ * One retained container-memory reading.
13931
+ *
13932
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13933
+ * a second clock: that is what makes "processes sum to X, container says Y"
13934
+ * subtractable per point rather than an eyeballed comparison of two series
13935
+ * sampled at different instants.
13936
+ *
13937
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13938
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13939
+ * never coexisted, and a mean would smear away the peak this exists to find.
13940
+ */
13941
+ var ContainerMemoryPointSchema = object({
13942
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13943
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13944
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13945
+ currentBytes: number(),
13946
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13947
+ limitBytes: number().nullable(),
13948
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13949
+ anonBytes: number().nullable(),
13950
+ /** Page cache. Charged to the cgroup, owned by no process. */
13951
+ fileBytes: number().nullable(),
13952
+ /**
13953
+ * Shared memory — and the field that explained the largest single surprise.
13954
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13955
+ * hardware-decode session holding DRM objects is charged HERE and appears
13956
+ * nowhere in a `ps` scan.
13957
+ */
13958
+ shmemBytes: number().nullable(),
13959
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13960
+ slabBytes: number().nullable(),
13961
+ /**
13962
+ * Shrinkable i915 GEM object bytes, from debugfs.
13963
+ *
13964
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13965
+ * component of `currentBytes` and must not be subtracted from it; it says
13966
+ * what put the shmem there, where `shmemBytes` only says how much.
13967
+ *
13968
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13969
+ * container today — and on any node with no Intel GPU.
13970
+ */
13971
+ gpuShmemBytes: number().nullable()
13972
+ }).extend({ atMs: number() });
13929
13973
  var DumpHeapSnapshotInputSchema = object({
13930
13974
  /** The addon whose runner should dump a heap snapshot. */
13931
13975
  addonId: string() });
@@ -13989,6 +14033,21 @@ var NodeLoadSeriesSchema = object({
13989
14033
  /** One entry per function seen in the window, heaviest-first. */
13990
14034
  series: array(LoadFunctionSeriesSchema).readonly(),
13991
14035
  /**
14036
+ * The CONTAINER's memory over the same window, oldest-first.
14037
+ *
14038
+ * Sits next to `series` rather than in a method of its own because the whole
14039
+ * question is a subtraction: the per-process rows in `series` sum to one
14040
+ * number and this one is another, and an operator who has to issue two calls
14041
+ * to compare them will compare two different instants. Same reader, same
14042
+ * `sinceMs`, same `bucketMs`, same timestamps.
14043
+ *
14044
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
14045
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
14046
+ * points at all. A zero here would be indistinguishable from a healthy
14047
+ * container and is precisely the lie this field exists to avoid.
14048
+ */
14049
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14050
+ /**
13992
14051
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13993
14052
  * reduction was needed — so a caller can always say what one point covers
13994
14053
  * without having to know whether it was reduced.
@@ -25075,6 +25134,33 @@ var intercomCapability = {
25075
25134
  deviceNative: true,
25076
25135
  mode: "singleton",
25077
25136
  deviceTypes: [DeviceType.Camera],
25137
+ /**
25138
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25139
+ *
25140
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25141
+ * cap has no configuration surface at all: all six methods open, feed and
25142
+ * close one live audio session against one `deviceId`. That is the same
25143
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25144
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25145
+ * `admin` because they change what the device IS.
25146
+ *
25147
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25148
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25149
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25150
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25151
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25152
+ * camera 7.
25153
+ *
25154
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25155
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25156
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25157
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25158
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25159
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25160
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25161
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25162
+ * preset promises a cap no row of that preset can reach.
25163
+ */
25078
25164
  methods: {
25079
25165
  /**
25080
25166
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25087,7 +25173,7 @@ var intercomCapability = {
25087
25173
  sdpOffer: string()
25088
25174
  }), {
25089
25175
  kind: "mutation",
25090
- auth: "admin"
25176
+ auth: "protected"
25091
25177
  }),
25092
25178
  handleAnswer: method(object({
25093
25179
  deviceId: number(),
@@ -25095,7 +25181,7 @@ var intercomCapability = {
25095
25181
  sdpAnswer: string()
25096
25182
  }), _void(), {
25097
25183
  kind: "mutation",
25098
- auth: "admin"
25184
+ auth: "protected"
25099
25185
  }),
25100
25186
  /** Close explicitly. Server also auto-closes on 30s idle. */
25101
25187
  stopSession: method(object({
@@ -25103,7 +25189,7 @@ var intercomCapability = {
25103
25189
  sessionId: string()
25104
25190
  }), _void(), {
25105
25191
  kind: "mutation",
25106
- auth: "admin"
25192
+ auth: "protected"
25107
25193
  }),
25108
25194
  /**
25109
25195
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25116,7 +25202,7 @@ var intercomCapability = {
25116
25202
  */
25117
25203
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25118
25204
  kind: "mutation",
25119
- auth: "admin"
25205
+ auth: "protected"
25120
25206
  }),
25121
25207
  /**
25122
25208
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25151,12 +25237,12 @@ var intercomCapability = {
25151
25237
  sequenceNumber: number().int()
25152
25238
  }), object({ accepted: boolean() }), {
25153
25239
  kind: "mutation",
25154
- auth: "admin"
25240
+ auth: "protected"
25155
25241
  }),
25156
25242
  /** Close the raw-PCM talk session. Idempotent. */
25157
25243
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25158
25244
  kind: "mutation",
25159
- auth: "admin"
25245
+ auth: "protected"
25160
25246
  })
25161
25247
  },
25162
25248
  events: { onStatusChanged: { data: object({
@@ -27832,10 +27918,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27832
27918
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
27833
27919
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
27834
27920
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
27835
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
27836
- * annotations that are not exposed here and must not be treated as an event
27837
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
27838
- * (`interfaces/recording-config.ts`).
27921
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
27922
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
27923
+ * ever read them. Event<->footage joins are by time, padded with the shared
27924
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
27839
27925
  */
27840
27926
  var RecordingStatusSchema = object({
27841
27927
  deviceId: number(),
package/dist/addon.mjs CHANGED
@@ -13903,6 +13903,50 @@ var NodeProcessSchema = object({
13903
13903
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13904
13904
  uptimeSec: number()
13905
13905
  });
13906
+ /**
13907
+ * One retained container-memory reading.
13908
+ *
13909
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13910
+ * a second clock: that is what makes "processes sum to X, container says Y"
13911
+ * subtractable per point rather than an eyeballed comparison of two series
13912
+ * sampled at different instants.
13913
+ *
13914
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13915
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13916
+ * never coexisted, and a mean would smear away the peak this exists to find.
13917
+ */
13918
+ var ContainerMemoryPointSchema = object({
13919
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13920
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13921
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13922
+ currentBytes: number(),
13923
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13924
+ limitBytes: number().nullable(),
13925
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13926
+ anonBytes: number().nullable(),
13927
+ /** Page cache. Charged to the cgroup, owned by no process. */
13928
+ fileBytes: number().nullable(),
13929
+ /**
13930
+ * Shared memory — and the field that explained the largest single surprise.
13931
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13932
+ * hardware-decode session holding DRM objects is charged HERE and appears
13933
+ * nowhere in a `ps` scan.
13934
+ */
13935
+ shmemBytes: number().nullable(),
13936
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13937
+ slabBytes: number().nullable(),
13938
+ /**
13939
+ * Shrinkable i915 GEM object bytes, from debugfs.
13940
+ *
13941
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13942
+ * component of `currentBytes` and must not be subtracted from it; it says
13943
+ * what put the shmem there, where `shmemBytes` only says how much.
13944
+ *
13945
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13946
+ * container today — and on any node with no Intel GPU.
13947
+ */
13948
+ gpuShmemBytes: number().nullable()
13949
+ }).extend({ atMs: number() });
13906
13950
  var DumpHeapSnapshotInputSchema = object({
13907
13951
  /** The addon whose runner should dump a heap snapshot. */
13908
13952
  addonId: string() });
@@ -13966,6 +14010,21 @@ var NodeLoadSeriesSchema = object({
13966
14010
  /** One entry per function seen in the window, heaviest-first. */
13967
14011
  series: array(LoadFunctionSeriesSchema).readonly(),
13968
14012
  /**
14013
+ * The CONTAINER's memory over the same window, oldest-first.
14014
+ *
14015
+ * Sits next to `series` rather than in a method of its own because the whole
14016
+ * question is a subtraction: the per-process rows in `series` sum to one
14017
+ * number and this one is another, and an operator who has to issue two calls
14018
+ * to compare them will compare two different instants. Same reader, same
14019
+ * `sinceMs`, same `bucketMs`, same timestamps.
14020
+ *
14021
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
14022
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
14023
+ * points at all. A zero here would be indistinguishable from a healthy
14024
+ * container and is precisely the lie this field exists to avoid.
14025
+ */
14026
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
14027
+ /**
13969
14028
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13970
14029
  * reduction was needed — so a caller can always say what one point covers
13971
14030
  * without having to know whether it was reduced.
@@ -25052,6 +25111,33 @@ var intercomCapability = {
25052
25111
  deviceNative: true,
25053
25112
  mode: "singleton",
25054
25113
  deviceTypes: [DeviceType.Camera],
25114
+ /**
25115
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25116
+ *
25117
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25118
+ * cap has no configuration surface at all: all six methods open, feed and
25119
+ * close one live audio session against one `deviceId`. That is the same
25120
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25121
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25122
+ * `admin` because they change what the device IS.
25123
+ *
25124
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25125
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25126
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25127
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25128
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25129
+ * camera 7.
25130
+ *
25131
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25132
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25133
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25134
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25135
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25136
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25137
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25138
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25139
+ * preset promises a cap no row of that preset can reach.
25140
+ */
25055
25141
  methods: {
25056
25142
  /**
25057
25143
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25064,7 +25150,7 @@ var intercomCapability = {
25064
25150
  sdpOffer: string()
25065
25151
  }), {
25066
25152
  kind: "mutation",
25067
- auth: "admin"
25153
+ auth: "protected"
25068
25154
  }),
25069
25155
  handleAnswer: method(object({
25070
25156
  deviceId: number(),
@@ -25072,7 +25158,7 @@ var intercomCapability = {
25072
25158
  sdpAnswer: string()
25073
25159
  }), _void(), {
25074
25160
  kind: "mutation",
25075
- auth: "admin"
25161
+ auth: "protected"
25076
25162
  }),
25077
25163
  /** Close explicitly. Server also auto-closes on 30s idle. */
25078
25164
  stopSession: method(object({
@@ -25080,7 +25166,7 @@ var intercomCapability = {
25080
25166
  sessionId: string()
25081
25167
  }), _void(), {
25082
25168
  kind: "mutation",
25083
- auth: "admin"
25169
+ auth: "protected"
25084
25170
  }),
25085
25171
  /**
25086
25172
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25093,7 +25179,7 @@ var intercomCapability = {
25093
25179
  */
25094
25180
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25095
25181
  kind: "mutation",
25096
- auth: "admin"
25182
+ auth: "protected"
25097
25183
  }),
25098
25184
  /**
25099
25185
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25128,12 +25214,12 @@ var intercomCapability = {
25128
25214
  sequenceNumber: number().int()
25129
25215
  }), object({ accepted: boolean() }), {
25130
25216
  kind: "mutation",
25131
- auth: "admin"
25217
+ auth: "protected"
25132
25218
  }),
25133
25219
  /** Close the raw-PCM talk session. Idempotent. */
25134
25220
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25135
25221
  kind: "mutation",
25136
- auth: "admin"
25222
+ auth: "protected"
25137
25223
  })
25138
25224
  },
25139
25225
  events: { onStatusChanged: { data: object({
@@ -27809,10 +27895,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27809
27895
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
27810
27896
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
27811
27897
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
27812
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
27813
- * annotations that are not exposed here and must not be treated as an event
27814
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
27815
- * (`interfaces/recording-config.ts`).
27898
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
27899
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
27900
+ * ever read them. Event<->footage joins are by time, padded with the shared
27901
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
27816
27902
  */
27817
27903
  var RecordingStatusSchema = object({
27818
27904
  deviceId: number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.44",
3
+ "version": "0.1.47",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",