@camstack/addon-decoder-ffmpeg 1.2.34 → 1.2.36

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.
Files changed (3) hide show
  1. package/dist/index.js +255 -25
  2. package/dist/index.mjs +255 -25
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  let node_crypto = require("node:crypto");
6
6
  let node_child_process = require("node:child_process");
7
- //#region ../types/dist/event-category-CIa_iT6b.mjs
7
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
8
8
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
9
9
  EventCategory["SystemBoot"] = "system.boot";
10
10
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -441,7 +441,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
441
441
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
442
442
  /**
443
443
  * Periodic per-node process-tree snapshot (camstack-related pids
444
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
444
+ * with root / managed / system classification). Emitted ~0.2 Hz by
445
445
  * the metrics-provider addon. Drives the Cluster → Processes tab
446
446
  * without polling `metricsProvider.listNodeProcesses`.
447
447
  */
@@ -11164,6 +11164,19 @@ var SettingsRecordSchema = object({
11164
11164
  data: record(string(), unknown())
11165
11165
  });
11166
11166
  /**
11167
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11168
+ * optional.
11169
+ *
11170
+ * A separate schema rather than loosening the shared one: every other method
11171
+ * on this cap addresses a row BY its id, and making that field optional
11172
+ * everywhere would turn a forgotten key into a silently generated one on
11173
+ * `update` and `delete` as well.
11174
+ */
11175
+ var BulkRecordSchema = object({
11176
+ id: string().optional(),
11177
+ data: record(string(), unknown())
11178
+ });
11179
+ /**
11167
11180
  * Column declaration for a structured (SQL-backed) collection.
11168
11181
  *
11169
11182
  * Logical types — the backend translates each to the matching SQLite
@@ -11220,6 +11233,10 @@ method(object({
11220
11233
  collection: string(),
11221
11234
  record: SettingsRecordSchema
11222
11235
  }), _void(), { kind: "mutation" }), method(object({
11236
+ namespace: string().optional(),
11237
+ collection: string(),
11238
+ records: array(BulkRecordSchema).readonly()
11239
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11223
11240
  namespace: string().optional(),
11224
11241
  collection: string(),
11225
11242
  id: string(),
@@ -11328,6 +11345,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11328
11345
  }), _void(), {
11329
11346
  kind: "mutation",
11330
11347
  auth: "admin"
11348
+ }), method(object({
11349
+ namespace: string().optional(),
11350
+ collection: string(),
11351
+ records: array(BulkRecordSchema).readonly()
11352
+ }), object({ inserted: number().int() }), {
11353
+ kind: "mutation",
11354
+ auth: "admin"
11331
11355
  }), method(object({
11332
11356
  namespace: string().optional(),
11333
11357
  collection: string(),
@@ -13189,6 +13213,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13189
13213
  limit: number().optional(),
13190
13214
  tags: record(string(), string()).optional()
13191
13215
  }), array(LogEntrySchema).readonly());
13216
+ var LoadContributionSchema = object({
13217
+ role: _enum([
13218
+ "decode",
13219
+ "transcode",
13220
+ "recording",
13221
+ "streaming",
13222
+ "detection"
13223
+ ]),
13224
+ /**
13225
+ * The NUMERIC device id — the same value every log line carries as
13226
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13227
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13228
+ * contributor that cannot name its camera must not emit the entry at all,
13229
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13230
+ * and would quietly turn one camera's cost into everybody's.
13231
+ */
13232
+ deviceId: number().int().positive().nullable(),
13233
+ attribution: _enum([
13234
+ "measured",
13235
+ "accounted",
13236
+ "unattributable"
13237
+ ]),
13238
+ /**
13239
+ * What ONE entry is, in the contributor's own words — `615/high`,
13240
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13241
+ * family and inventing a common one would lose the only information that
13242
+ * makes two entries for the same camera distinguishable.
13243
+ */
13244
+ unit: string(),
13245
+ /**
13246
+ * The OS process this cost lives in, when there is one. Present so a
13247
+ * consumer can (a) tell two generations of the same unit apart across a
13248
+ * restart, and (b) subtract claimed processes from the node's process
13249
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13250
+ * process of its own.
13251
+ */
13252
+ pid: number().int().positive().optional(),
13253
+ /**
13254
+ * When this generation started. The pid's incarnation marker: a consumer
13255
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13256
+ * window when this changes, because the counter restarted from zero in a new
13257
+ * process.
13258
+ */
13259
+ startedAtMs: number().optional(),
13260
+ /**
13261
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13262
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13263
+ * contribution is asked for.
13264
+ *
13265
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13266
+ * needs a sampler, and a new per-node sampler is the defect half of
13267
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13268
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13269
+ *
13270
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13271
+ * an entry with no process.
13272
+ */
13273
+ cpuSeconds: number().optional(),
13274
+ /** Resident bytes of this unit's process, same source and same rules. */
13275
+ rssBytes: number().optional()
13276
+ });
13277
+ method(_void(), array(LoadContributionSchema).readonly());
13192
13278
  /**
13193
13279
  * `login-method` — collection cap through which auth addons contribute
13194
13280
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13392,8 +13478,7 @@ var NodeProcessSchema = object({
13392
13478
  classification: _enum([
13393
13479
  "root",
13394
13480
  "managed",
13395
- "system",
13396
- "ghost"
13481
+ "system"
13397
13482
  ]),
13398
13483
  /** `$process` addon binding when `managed`, else null. */
13399
13484
  addonId: string().nullable(),
@@ -13401,22 +13486,39 @@ var NodeProcessSchema = object({
13401
13486
  nodeId: string().nullable(),
13402
13487
  /** Truncated command line. */
13403
13488
  command: string(),
13489
+ /**
13490
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13491
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13492
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13493
+ */
13404
13494
  cpuPercent: number(),
13405
13495
  memoryRssBytes: number(),
13496
+ /**
13497
+ * Instantaneous CPU% of the process's own threads over the last
13498
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13499
+ *
13500
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13501
+ * boot), the pid was recycled, or this node is not Linux.
13502
+ */
13503
+ cpuMainPercent: number().nullable(),
13504
+ /**
13505
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13506
+ *
13507
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13508
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13509
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13510
+ * "allocating too much".
13511
+ *
13512
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13513
+ * (background compilation runs there too), so it is reported as
13514
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13515
+ * meaning as on `cpuMainPercent`.
13516
+ */
13517
+ cpuGcPercent: number().nullable(),
13518
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13519
+ threadCount: number().nullable(),
13406
13520
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13407
- uptimeSec: number(),
13408
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13409
- orphaned: boolean()
13410
- });
13411
- var KillProcessInputSchema = object({
13412
- pid: number(),
13413
- /** Force = SIGKILL. Default is SIGTERM. */
13414
- force: boolean().optional()
13415
- });
13416
- var KillProcessResultSchema = object({
13417
- success: boolean(),
13418
- reason: string().optional(),
13419
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13521
+ uptimeSec: number()
13420
13522
  });
13421
13523
  var DumpHeapSnapshotInputSchema = object({
13422
13524
  /** The addon whose runner should dump a heap snapshot. */
@@ -13429,6 +13531,104 @@ var DumpHeapSnapshotResultSchema = object({
13429
13531
  pid: number().optional(),
13430
13532
  reason: string().optional()
13431
13533
  });
13534
+ /**
13535
+ * One point of one function's series.
13536
+ *
13537
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13538
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13539
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13540
+ * Either would give us a tool built to find peaks that does not show peaks.
13541
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13542
+ * into the bucket, and a mean stays derivable where it is wanted.
13543
+ *
13544
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13545
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13546
+ * caller cannot tell which it received — which is what "one reader" means.
13547
+ */
13548
+ var LoadPointSchema = object({
13549
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13550
+ atMs: number(),
13551
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13552
+ samples: number().int(),
13553
+ /**
13554
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13555
+ * of every snapshot in it reported a thread split. A partial sum is a
13556
+ * smaller number that looks exactly as real as a complete one.
13557
+ */
13558
+ cpuMainPercent: number().nullable(),
13559
+ cpuMainPercentMin: number().nullable(),
13560
+ cpuGcPercent: number().nullable(),
13561
+ cpuGcPercentMin: number().nullable(),
13562
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13563
+ cpuLifetimePercent: number(),
13564
+ cpuLifetimePercentMin: number(),
13565
+ memoryRssBytes: number(),
13566
+ memoryRssBytesMin: number(),
13567
+ processCount: number().int(),
13568
+ processCountMin: number().int()
13569
+ });
13570
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13571
+ var LoadFunctionSeriesSchema = object({
13572
+ key: string(),
13573
+ kind: _enum([
13574
+ "addon",
13575
+ "root",
13576
+ "unattributed"
13577
+ ]),
13578
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13579
+ points: array(LoadPointSchema).readonly()
13580
+ });
13581
+ var NodeLoadSeriesSchema = object({
13582
+ nodeId: string(),
13583
+ /** One entry per function seen in the window, heaviest-first. */
13584
+ series: array(LoadFunctionSeriesSchema).readonly(),
13585
+ /**
13586
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13587
+ * reduction was needed — so a caller can always say what one point covers
13588
+ * without having to know whether it was reduced.
13589
+ */
13590
+ bucketMs: number(),
13591
+ /** Raw snapshots that went into this answer, across both tiers. */
13592
+ retainedSamples: number(),
13593
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13594
+ oldestAtMs: number().nullable(),
13595
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13596
+ cadenceMs: number(),
13597
+ /**
13598
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13599
+ * alone — an agent (which holds no table), or a store that refused.
13600
+ * Reported because "the last hour" and "the last six hours" are different
13601
+ * questions and an operator must not have to guess which was answered.
13602
+ */
13603
+ durable: boolean()
13604
+ });
13605
+ var GetLoadSeriesInputSchema = object({
13606
+ /**
13607
+ * The node whose series is wanted.
13608
+ *
13609
+ * NOT named `nodeId`: the generated cap router strips a top-level
13610
+ * `nodeId` from every method input and uses it to ROUTE the call to
13611
+ * that node's provider (`generated-cap-routers.ts`). A series target
13612
+ * called `nodeId` would silently become a routing pin and never reach
13613
+ * the provider. The hub holds every node it hears from, so the
13614
+ * ordinary call is unpinned — answered by the hub, for any node.
13615
+ */
13616
+ forNodeId: string(),
13617
+ /**
13618
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13619
+ * holds and receives only what it is missing, so seeding a live chart
13620
+ * from this method cannot double a point already drawn.
13621
+ */
13622
+ sinceMs: number().optional(),
13623
+ /**
13624
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13625
+ * preserving min and max per bucket.
13626
+ *
13627
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13628
+ * long one, which is why a chart passes its own pixel width.
13629
+ */
13630
+ maxPoints: number().int().positive().optional()
13631
+ });
13432
13632
  var SystemMetricsSchema = object({
13433
13633
  cpuPercent: number(),
13434
13634
  memoryPercent: number(),
@@ -13439,10 +13639,7 @@ var SystemMetricsSchema = object({
13439
13639
  gpuPercent: number().optional(),
13440
13640
  gpuMemoryPercent: number().optional()
13441
13641
  });
13442
- method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
13443
- kind: "mutation",
13444
- auth: "admin"
13445
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13642
+ method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13446
13643
  kind: "mutation",
13447
13644
  auth: "admin"
13448
13645
  });
@@ -26745,6 +26942,15 @@ var LoggingSettingsPatchSchema = object({
26745
26942
  * authority over the whole hierarchy and answers for every layer, so the
26746
26943
  * layer selector needs a name the transport does not already own.
26747
26944
  */
26945
+ /**
26946
+ * One contribution, plus WHO reported it.
26947
+ *
26948
+ * The addon and node are added by the hub as it enumerates providers, never by
26949
+ * the contributor: an addon reporting its own identity could report somebody
26950
+ * else's, and the whole point of this surface is that no claim is made by
26951
+ * anyone but its owner.
26952
+ */
26953
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
26748
26954
  var GetLoggingSettingsInputSchema = object({
26749
26955
  scopeNodeId: string().optional(),
26750
26956
  /**
@@ -26803,7 +27009,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26803
27009
  }), method(_void(), SiteLocationStatusSchema, {
26804
27010
  kind: "mutation",
26805
27011
  auth: "admin"
26806
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27012
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26807
27013
  kind: "mutation",
26808
27014
  auth: "admin"
26809
27015
  });
@@ -28419,6 +28625,12 @@ Object.freeze({
28419
28625
  addonId: null,
28420
28626
  access: "create"
28421
28627
  },
28628
+ "dataStoreProvider.insertMany": {
28629
+ capName: "data-store-provider",
28630
+ capScope: "system",
28631
+ addonId: null,
28632
+ access: "create"
28633
+ },
28422
28634
  "dataStoreProvider.isEmpty": {
28423
28635
  capName: "data-store-provider",
28424
28636
  capScope: "system",
@@ -29733,6 +29945,12 @@ Object.freeze({
29733
29945
  addonId: null,
29734
29946
  access: "create"
29735
29947
  },
29948
+ "loadContribution.list": {
29949
+ capName: "load-contribution",
29950
+ capScope: "system",
29951
+ addonId: null,
29952
+ access: "view"
29953
+ },
29736
29954
  "localNetwork.downloadCa": {
29737
29955
  capName: "local-network",
29738
29956
  capScope: "system",
@@ -30033,17 +30251,17 @@ Object.freeze({
30033
30251
  addonId: null,
30034
30252
  access: "view"
30035
30253
  },
30036
- "metricsProvider.getProcessStats": {
30254
+ "metricsProvider.getLoadSeries": {
30037
30255
  capName: "metrics-provider",
30038
30256
  capScope: "system",
30039
30257
  addonId: null,
30040
30258
  access: "view"
30041
30259
  },
30042
- "metricsProvider.killProcess": {
30260
+ "metricsProvider.getProcessStats": {
30043
30261
  capName: "metrics-provider",
30044
30262
  capScope: "system",
30045
30263
  addonId: null,
30046
- access: "create"
30264
+ access: "view"
30047
30265
  },
30048
30266
  "metricsProvider.listAddonInstances": {
30049
30267
  capName: "metrics-provider",
@@ -32055,6 +32273,12 @@ Object.freeze({
32055
32273
  addonId: null,
32056
32274
  access: "create"
32057
32275
  },
32276
+ "settingsStore.insertMany": {
32277
+ capName: "settings-store",
32278
+ capScope: "system",
32279
+ addonId: null,
32280
+ access: "create"
32281
+ },
32058
32282
  "settingsStore.isEmpty": {
32059
32283
  capName: "settings-store",
32060
32284
  capScope: "system",
@@ -32667,6 +32891,12 @@ Object.freeze({
32667
32891
  addonId: null,
32668
32892
  access: "create"
32669
32893
  },
32894
+ "system.getLoadContributions": {
32895
+ capName: "system",
32896
+ capScope: "system",
32897
+ addonId: null,
32898
+ access: "view"
32899
+ },
32670
32900
  "system.getLoggingSettings": {
32671
32901
  capName: "system",
32672
32902
  capScope: "system",
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { spawn } from "node:child_process";
3
- //#region ../types/dist/event-category-CIa_iT6b.mjs
3
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -437,7 +437,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
437
437
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
438
438
  /**
439
439
  * Periodic per-node process-tree snapshot (camstack-related pids
440
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
440
+ * with root / managed / system classification). Emitted ~0.2 Hz by
441
441
  * the metrics-provider addon. Drives the Cluster → Processes tab
442
442
  * without polling `metricsProvider.listNodeProcesses`.
443
443
  */
@@ -11160,6 +11160,19 @@ var SettingsRecordSchema = object({
11160
11160
  data: record(string(), unknown())
11161
11161
  });
11162
11162
  /**
11163
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11164
+ * optional.
11165
+ *
11166
+ * A separate schema rather than loosening the shared one: every other method
11167
+ * on this cap addresses a row BY its id, and making that field optional
11168
+ * everywhere would turn a forgotten key into a silently generated one on
11169
+ * `update` and `delete` as well.
11170
+ */
11171
+ var BulkRecordSchema = object({
11172
+ id: string().optional(),
11173
+ data: record(string(), unknown())
11174
+ });
11175
+ /**
11163
11176
  * Column declaration for a structured (SQL-backed) collection.
11164
11177
  *
11165
11178
  * Logical types — the backend translates each to the matching SQLite
@@ -11216,6 +11229,10 @@ method(object({
11216
11229
  collection: string(),
11217
11230
  record: SettingsRecordSchema
11218
11231
  }), _void(), { kind: "mutation" }), method(object({
11232
+ namespace: string().optional(),
11233
+ collection: string(),
11234
+ records: array(BulkRecordSchema).readonly()
11235
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11219
11236
  namespace: string().optional(),
11220
11237
  collection: string(),
11221
11238
  id: string(),
@@ -11324,6 +11341,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11324
11341
  }), _void(), {
11325
11342
  kind: "mutation",
11326
11343
  auth: "admin"
11344
+ }), method(object({
11345
+ namespace: string().optional(),
11346
+ collection: string(),
11347
+ records: array(BulkRecordSchema).readonly()
11348
+ }), object({ inserted: number().int() }), {
11349
+ kind: "mutation",
11350
+ auth: "admin"
11327
11351
  }), method(object({
11328
11352
  namespace: string().optional(),
11329
11353
  collection: string(),
@@ -13185,6 +13209,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13185
13209
  limit: number().optional(),
13186
13210
  tags: record(string(), string()).optional()
13187
13211
  }), array(LogEntrySchema).readonly());
13212
+ var LoadContributionSchema = object({
13213
+ role: _enum([
13214
+ "decode",
13215
+ "transcode",
13216
+ "recording",
13217
+ "streaming",
13218
+ "detection"
13219
+ ]),
13220
+ /**
13221
+ * The NUMERIC device id — the same value every log line carries as
13222
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13223
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13224
+ * contributor that cannot name its camera must not emit the entry at all,
13225
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13226
+ * and would quietly turn one camera's cost into everybody's.
13227
+ */
13228
+ deviceId: number().int().positive().nullable(),
13229
+ attribution: _enum([
13230
+ "measured",
13231
+ "accounted",
13232
+ "unattributable"
13233
+ ]),
13234
+ /**
13235
+ * What ONE entry is, in the contributor's own words — `615/high`,
13236
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13237
+ * family and inventing a common one would lose the only information that
13238
+ * makes two entries for the same camera distinguishable.
13239
+ */
13240
+ unit: string(),
13241
+ /**
13242
+ * The OS process this cost lives in, when there is one. Present so a
13243
+ * consumer can (a) tell two generations of the same unit apart across a
13244
+ * restart, and (b) subtract claimed processes from the node's process
13245
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13246
+ * process of its own.
13247
+ */
13248
+ pid: number().int().positive().optional(),
13249
+ /**
13250
+ * When this generation started. The pid's incarnation marker: a consumer
13251
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13252
+ * window when this changes, because the counter restarted from zero in a new
13253
+ * process.
13254
+ */
13255
+ startedAtMs: number().optional(),
13256
+ /**
13257
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13258
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13259
+ * contribution is asked for.
13260
+ *
13261
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13262
+ * needs a sampler, and a new per-node sampler is the defect half of
13263
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13264
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13265
+ *
13266
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13267
+ * an entry with no process.
13268
+ */
13269
+ cpuSeconds: number().optional(),
13270
+ /** Resident bytes of this unit's process, same source and same rules. */
13271
+ rssBytes: number().optional()
13272
+ });
13273
+ method(_void(), array(LoadContributionSchema).readonly());
13188
13274
  /**
13189
13275
  * `login-method` — collection cap through which auth addons contribute
13190
13276
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13388,8 +13474,7 @@ var NodeProcessSchema = object({
13388
13474
  classification: _enum([
13389
13475
  "root",
13390
13476
  "managed",
13391
- "system",
13392
- "ghost"
13477
+ "system"
13393
13478
  ]),
13394
13479
  /** `$process` addon binding when `managed`, else null. */
13395
13480
  addonId: string().nullable(),
@@ -13397,22 +13482,39 @@ var NodeProcessSchema = object({
13397
13482
  nodeId: string().nullable(),
13398
13483
  /** Truncated command line. */
13399
13484
  command: string(),
13485
+ /**
13486
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13487
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13488
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13489
+ */
13400
13490
  cpuPercent: number(),
13401
13491
  memoryRssBytes: number(),
13492
+ /**
13493
+ * Instantaneous CPU% of the process's own threads over the last
13494
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13495
+ *
13496
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13497
+ * boot), the pid was recycled, or this node is not Linux.
13498
+ */
13499
+ cpuMainPercent: number().nullable(),
13500
+ /**
13501
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13502
+ *
13503
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13504
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13505
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13506
+ * "allocating too much".
13507
+ *
13508
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13509
+ * (background compilation runs there too), so it is reported as
13510
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13511
+ * meaning as on `cpuMainPercent`.
13512
+ */
13513
+ cpuGcPercent: number().nullable(),
13514
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13515
+ threadCount: number().nullable(),
13402
13516
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13403
- uptimeSec: number(),
13404
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13405
- orphaned: boolean()
13406
- });
13407
- var KillProcessInputSchema = object({
13408
- pid: number(),
13409
- /** Force = SIGKILL. Default is SIGTERM. */
13410
- force: boolean().optional()
13411
- });
13412
- var KillProcessResultSchema = object({
13413
- success: boolean(),
13414
- reason: string().optional(),
13415
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13517
+ uptimeSec: number()
13416
13518
  });
13417
13519
  var DumpHeapSnapshotInputSchema = object({
13418
13520
  /** The addon whose runner should dump a heap snapshot. */
@@ -13425,6 +13527,104 @@ var DumpHeapSnapshotResultSchema = object({
13425
13527
  pid: number().optional(),
13426
13528
  reason: string().optional()
13427
13529
  });
13530
+ /**
13531
+ * One point of one function's series.
13532
+ *
13533
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13534
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13535
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13536
+ * Either would give us a tool built to find peaks that does not show peaks.
13537
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13538
+ * into the bucket, and a mean stays derivable where it is wanted.
13539
+ *
13540
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13541
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13542
+ * caller cannot tell which it received — which is what "one reader" means.
13543
+ */
13544
+ var LoadPointSchema = object({
13545
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13546
+ atMs: number(),
13547
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13548
+ samples: number().int(),
13549
+ /**
13550
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13551
+ * of every snapshot in it reported a thread split. A partial sum is a
13552
+ * smaller number that looks exactly as real as a complete one.
13553
+ */
13554
+ cpuMainPercent: number().nullable(),
13555
+ cpuMainPercentMin: number().nullable(),
13556
+ cpuGcPercent: number().nullable(),
13557
+ cpuGcPercentMin: number().nullable(),
13558
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13559
+ cpuLifetimePercent: number(),
13560
+ cpuLifetimePercentMin: number(),
13561
+ memoryRssBytes: number(),
13562
+ memoryRssBytesMin: number(),
13563
+ processCount: number().int(),
13564
+ processCountMin: number().int()
13565
+ });
13566
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13567
+ var LoadFunctionSeriesSchema = object({
13568
+ key: string(),
13569
+ kind: _enum([
13570
+ "addon",
13571
+ "root",
13572
+ "unattributed"
13573
+ ]),
13574
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13575
+ points: array(LoadPointSchema).readonly()
13576
+ });
13577
+ var NodeLoadSeriesSchema = object({
13578
+ nodeId: string(),
13579
+ /** One entry per function seen in the window, heaviest-first. */
13580
+ series: array(LoadFunctionSeriesSchema).readonly(),
13581
+ /**
13582
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13583
+ * reduction was needed — so a caller can always say what one point covers
13584
+ * without having to know whether it was reduced.
13585
+ */
13586
+ bucketMs: number(),
13587
+ /** Raw snapshots that went into this answer, across both tiers. */
13588
+ retainedSamples: number(),
13589
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13590
+ oldestAtMs: number().nullable(),
13591
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13592
+ cadenceMs: number(),
13593
+ /**
13594
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13595
+ * alone — an agent (which holds no table), or a store that refused.
13596
+ * Reported because "the last hour" and "the last six hours" are different
13597
+ * questions and an operator must not have to guess which was answered.
13598
+ */
13599
+ durable: boolean()
13600
+ });
13601
+ var GetLoadSeriesInputSchema = object({
13602
+ /**
13603
+ * The node whose series is wanted.
13604
+ *
13605
+ * NOT named `nodeId`: the generated cap router strips a top-level
13606
+ * `nodeId` from every method input and uses it to ROUTE the call to
13607
+ * that node's provider (`generated-cap-routers.ts`). A series target
13608
+ * called `nodeId` would silently become a routing pin and never reach
13609
+ * the provider. The hub holds every node it hears from, so the
13610
+ * ordinary call is unpinned — answered by the hub, for any node.
13611
+ */
13612
+ forNodeId: string(),
13613
+ /**
13614
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13615
+ * holds and receives only what it is missing, so seeding a live chart
13616
+ * from this method cannot double a point already drawn.
13617
+ */
13618
+ sinceMs: number().optional(),
13619
+ /**
13620
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13621
+ * preserving min and max per bucket.
13622
+ *
13623
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13624
+ * long one, which is why a chart passes its own pixel width.
13625
+ */
13626
+ maxPoints: number().int().positive().optional()
13627
+ });
13428
13628
  var SystemMetricsSchema = object({
13429
13629
  cpuPercent: number(),
13430
13630
  memoryPercent: number(),
@@ -13435,10 +13635,7 @@ var SystemMetricsSchema = object({
13435
13635
  gpuPercent: number().optional(),
13436
13636
  gpuMemoryPercent: number().optional()
13437
13637
  });
13438
- method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
13439
- kind: "mutation",
13440
- auth: "admin"
13441
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13638
+ method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13442
13639
  kind: "mutation",
13443
13640
  auth: "admin"
13444
13641
  });
@@ -26741,6 +26938,15 @@ var LoggingSettingsPatchSchema = object({
26741
26938
  * authority over the whole hierarchy and answers for every layer, so the
26742
26939
  * layer selector needs a name the transport does not already own.
26743
26940
  */
26941
+ /**
26942
+ * One contribution, plus WHO reported it.
26943
+ *
26944
+ * The addon and node are added by the hub as it enumerates providers, never by
26945
+ * the contributor: an addon reporting its own identity could report somebody
26946
+ * else's, and the whole point of this surface is that no claim is made by
26947
+ * anyone but its owner.
26948
+ */
26949
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
26744
26950
  var GetLoggingSettingsInputSchema = object({
26745
26951
  scopeNodeId: string().optional(),
26746
26952
  /**
@@ -26799,7 +27005,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26799
27005
  }), method(_void(), SiteLocationStatusSchema, {
26800
27006
  kind: "mutation",
26801
27007
  auth: "admin"
26802
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27008
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26803
27009
  kind: "mutation",
26804
27010
  auth: "admin"
26805
27011
  });
@@ -28415,6 +28621,12 @@ Object.freeze({
28415
28621
  addonId: null,
28416
28622
  access: "create"
28417
28623
  },
28624
+ "dataStoreProvider.insertMany": {
28625
+ capName: "data-store-provider",
28626
+ capScope: "system",
28627
+ addonId: null,
28628
+ access: "create"
28629
+ },
28418
28630
  "dataStoreProvider.isEmpty": {
28419
28631
  capName: "data-store-provider",
28420
28632
  capScope: "system",
@@ -29729,6 +29941,12 @@ Object.freeze({
29729
29941
  addonId: null,
29730
29942
  access: "create"
29731
29943
  },
29944
+ "loadContribution.list": {
29945
+ capName: "load-contribution",
29946
+ capScope: "system",
29947
+ addonId: null,
29948
+ access: "view"
29949
+ },
29732
29950
  "localNetwork.downloadCa": {
29733
29951
  capName: "local-network",
29734
29952
  capScope: "system",
@@ -30029,17 +30247,17 @@ Object.freeze({
30029
30247
  addonId: null,
30030
30248
  access: "view"
30031
30249
  },
30032
- "metricsProvider.getProcessStats": {
30250
+ "metricsProvider.getLoadSeries": {
30033
30251
  capName: "metrics-provider",
30034
30252
  capScope: "system",
30035
30253
  addonId: null,
30036
30254
  access: "view"
30037
30255
  },
30038
- "metricsProvider.killProcess": {
30256
+ "metricsProvider.getProcessStats": {
30039
30257
  capName: "metrics-provider",
30040
30258
  capScope: "system",
30041
30259
  addonId: null,
30042
- access: "create"
30260
+ access: "view"
30043
30261
  },
30044
30262
  "metricsProvider.listAddonInstances": {
30045
30263
  capName: "metrics-provider",
@@ -32051,6 +32269,12 @@ Object.freeze({
32051
32269
  addonId: null,
32052
32270
  access: "create"
32053
32271
  },
32272
+ "settingsStore.insertMany": {
32273
+ capName: "settings-store",
32274
+ capScope: "system",
32275
+ addonId: null,
32276
+ access: "create"
32277
+ },
32054
32278
  "settingsStore.isEmpty": {
32055
32279
  capName: "settings-store",
32056
32280
  capScope: "system",
@@ -32663,6 +32887,12 @@ Object.freeze({
32663
32887
  addonId: null,
32664
32888
  access: "create"
32665
32889
  },
32890
+ "system.getLoadContributions": {
32891
+ capName: "system",
32892
+ capScope: "system",
32893
+ addonId: null,
32894
+ access: "view"
32895
+ },
32666
32896
  "system.getLoggingSettings": {
32667
32897
  capName: "system",
32668
32898
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-ffmpeg",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
4
4
  "description": "Standalone ffmpeg-subprocess decoder fallback addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",