@camstack/addon-provider-hikvision 1.1.19 → 1.1.21

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/addon.js +579 -297
  2. package/dist/addon.mjs +579 -297
  3. package/package.json +4 -1
package/dist/addon.mjs CHANGED
@@ -4636,7 +4636,7 @@ function _instanceof(cls, params = {}) {
4636
4636
  return inst;
4637
4637
  }
4638
4638
  //#endregion
4639
- //#region ../types/dist/sleep-CZDdRBua.mjs
4639
+ //#region ../types/dist/sleep-DJaTV2D7.mjs
4640
4640
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4641
4641
  EventCategory["SystemBoot"] = "system.boot";
4642
4642
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -4822,6 +4822,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
4822
4822
  */
4823
4823
  EventCategory["PipelineCameraUpdated"] = "pipeline.camera-updated";
4824
4824
  /**
4825
+ * The cluster camera-source OWNER changed (`clusterRoles.ingestNode`).
4826
+ * Emitted by addon-pipeline-orchestrator whenever it (re)derives node
4827
+ * capabilities — at boot, on agent online/offline, and on an ingest-node
4828
+ * flip. Carries the resolved `ownerNodeId`. The stream-broker consumes it to
4829
+ * keep its ingest-owner-gate decision current WITHOUT a per-`ensureBroker`
4830
+ * cross-process `getIngestOwner` query (push the authority's decision instead
4831
+ * of polling it on the hot path). Idempotent state — re-emitted on every
4832
+ * topology change, so a dropped event self-heals on the next one (plus the
4833
+ * broker's long backstop reconcile query).
4834
+ */
4835
+ EventCategory["PipelineIngestOwnerChanged"] = "pipeline.ingest-owner-changed";
4836
+ /**
4825
4837
  * Periodic snapshot of per-node pipeline-runner load
4826
4838
  * (`RunnerLocalLoad`). Emitted ~1Hz by every runner so UI dashboards
4827
4839
  * subscribe instead of polling `pipelineRunner.getLocalLoad`.
@@ -5345,10 +5357,6 @@ function hydrateField(field, values) {
5345
5357
  };
5346
5358
  }
5347
5359
  const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
5348
- if (field.type === "password") return {
5349
- ...field,
5350
- value: ""
5351
- };
5352
5360
  const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
5353
5361
  return {
5354
5362
  ...field,
@@ -6736,6 +6744,9 @@ function method(input, output, options) {
6736
6744
  function event(data) {
6737
6745
  return { data };
6738
6746
  }
6747
+ var StaticDirOutputSchema$1 = object({ staticDir: string() });
6748
+ var VersionOutputSchema$1 = object({ version: string() });
6749
+ method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
6739
6750
  var StaticDirOutputSchema = object({ staticDir: string() });
6740
6751
  var VersionOutputSchema = object({ version: string() });
6741
6752
  method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
@@ -6905,6 +6916,36 @@ var ModelFormatsSchema = object({
6905
6916
  tflite: ModelFormatEntrySchema.optional(),
6906
6917
  pt: ModelFormatEntrySchema.optional()
6907
6918
  });
6919
+ /**
6920
+ * Variant-selector grouping axes. Shared by the full `ModelCatalogEntry` and by
6921
+ * the reduced `PipelineModelOption` returned in `pipeline.getSchema()` so the
6922
+ * grouped Family→Tier→Variant picker renders identically in the config UI and
6923
+ * in the pipeline/device steppers. The flat `id` stays the source of truth for
6924
+ * resolution/download/persistence; this is a presentation overlay resolved back
6925
+ * to an `id`.
6926
+ */
6927
+ var ModelVariantGroupSchema = object({
6928
+ /** Top-level family, e.g. `yolo26` (later `d-fine`, `rf-detr`). */
6929
+ family: string(),
6930
+ /** Size within the family, e.g. `n` | `s` | `m` | `l`. */
6931
+ tier: string(),
6932
+ /** Quantization axis. Omit ⇒ the fp32 base build. */
6933
+ precision: _enum(["fp32", "int8"]).optional(),
6934
+ /**
6935
+ * Speed-optimization axis. Omit ⇒ the standard build. `fast` marks a
6936
+ * latency-optimized export (e.g. ReLU-activation variant) — the slot the
6937
+ * future performance variants plug into.
6938
+ */
6939
+ optimization: _enum(["standard", "fast"]).optional(),
6940
+ /**
6941
+ * Input-resolution axis (square input side, px). Omit ⇒ the family's native
6942
+ * resolution (640 for yolo26). Reduced-input builds (320 / 256) are a big,
6943
+ * cheap latency lever — especially on Apple ANE and the Intel N100 — at a
6944
+ * small-object accuracy cost. Mirrors the model's `inputSize` but lifted onto
6945
+ * the group so the selector can offer it as a variant axis.
6946
+ */
6947
+ resolution: number().int().positive().optional()
6948
+ });
6908
6949
  var ModelCatalogEntrySchema = object({
6909
6950
  id: string(),
6910
6951
  name: string(),
@@ -6934,7 +6975,43 @@ var ModelCatalogEntrySchema = object({
6934
6975
  * Auxiliary files required at runtime (labels JSON, charset dict, etc.).
6935
6976
  * Downloaded into the same modelsDir alongside the model file.
6936
6977
  */
6937
- extraFiles: array(ModelExtraFileSchema).readonly().optional()
6978
+ extraFiles: array(ModelExtraFileSchema).readonly().optional(),
6979
+ /**
6980
+ * LEGACY entry — retained in the catalog so a persisted operator selection
6981
+ * still RESOLVES (and can be re-activated), but hidden from the selectable
6982
+ * model list and excluded from the auto format-default pick. Set on the
6983
+ * superseded / consolidated models (older lineages, redundant fp16 IRs) so
6984
+ * the active lineup stays the coherent curated ladder without deleting a
6985
+ * model anyone may still be pinned to. `resolveModelForFormat` keeps honoring
6986
+ * an explicit legacy id that has a build for the node's format.
6987
+ */
6988
+ legacy: boolean().optional(),
6989
+ /**
6990
+ * Measured quality/latency metadata — populated from the benchmark addon on
6991
+ * the real node classes. Absent = not yet measured (most entries today; the
6992
+ * catalog historically carried only `sizeMB`, a poor cross-architecture
6993
+ * speed proxy). `p95LatencyMs` is keyed by node class (e.g. `n100`, `mac`).
6994
+ */
6995
+ metrics: object({
6996
+ map50: number().optional(),
6997
+ p95LatencyMs: record(string(), number()).optional()
6998
+ }).optional(),
6999
+ /**
7000
+ * SPDX-ish license id of the model weights (e.g. `AGPL-3.0` for Ultralytics
7001
+ * YOLO26, `GPL-3.0` for YOLOv9, `Apache-2.0` for D-FINE/RF-DETR). Matters for
7002
+ * the retraining addon and any future commercial distribution.
7003
+ */
7004
+ license: string().optional(),
7005
+ /**
7006
+ * Variant-selector grouping. The UI groups models by `family` + `tier` and
7007
+ * offers `precision` / `optimization` as variant axes WITHIN a tier — so all
7008
+ * of a family's sizes and quantizations collapse into one grouped picker
7009
+ * instead of a flat list of `yolo26s`, `yolo26s-int8`, … Absent ⇒ ungrouped
7010
+ * (legacy / custom models) — never shown in the grouped selector. The flat
7011
+ * `id` stays the source of truth for resolution/download/persistence; grouping
7012
+ * is a presentation overlay resolved back to an `id`.
7013
+ */
7014
+ group: ModelVariantGroupSchema.optional()
6938
7015
  });
6939
7016
  var ConvertTargetSchema = discriminatedUnion("format", [object({
6940
7017
  format: literal("openvino"),
@@ -7170,8 +7247,8 @@ var RecordingModeSchema = _enum([
7170
7247
  "onAudioThreshold"
7171
7248
  ]);
7172
7249
  /**
7173
- * First-class, authoritative per-camera storage mode — the netta choice the UI
7174
- * reads directly (never inferred from `rules`):
7250
+ * First-class, authoritative per-camera storage mode — the explicit choice the
7251
+ * UI reads directly (never inferred from `rules`):
7175
7252
  * - `off` — not recording.
7176
7253
  * - `events` — record only around triggers (motion / audio threshold),
7177
7254
  * with pre/post-buffer.
@@ -8710,6 +8787,72 @@ function createRuntimeStateBridge(params) {
8710
8787
  getStatus
8711
8788
  };
8712
8789
  }
8790
+ /** Reject after `ms`; always clears its own timer. */
8791
+ async function withTimeout$1(promise, ms, label) {
8792
+ let timer;
8793
+ const timeout = new Promise((_resolve, reject) => {
8794
+ timer = setTimeout(() => reject(/* @__PURE__ */ new Error(`${label} timed out after ${String(ms)}ms`)), ms);
8795
+ });
8796
+ try {
8797
+ return await Promise.race([promise, timeout]);
8798
+ } finally {
8799
+ if (timer !== void 0) clearTimeout(timer);
8800
+ }
8801
+ }
8802
+ /**
8803
+ * Start the reachability poll loop. Returns a handle whose `stop()` clears the
8804
+ * timer and prevents any further ticks. Start on device activation, stop on
8805
+ * device teardown (`removeDevice`) so no timer leaks.
8806
+ */
8807
+ function startReachabilityPoll(options) {
8808
+ const intervalMs = options.intervalMs ?? 3e4;
8809
+ const failuresToOffline = options.failuresToOffline ?? 3;
8810
+ const probeTimeoutMs = options.probeTimeoutMs ?? 1e4;
8811
+ const runImmediately = options.runImmediately ?? true;
8812
+ let stopped = false;
8813
+ let running = false;
8814
+ let consecutiveFailures = 0;
8815
+ let timer;
8816
+ const tick = async () => {
8817
+ if (stopped) return;
8818
+ if (running) return;
8819
+ if (options.isEnabled && !options.isEnabled()) return;
8820
+ running = true;
8821
+ try {
8822
+ const reachable = await withTimeout$1(Promise.resolve().then(options.probe), probeTimeoutMs, "reachability probe");
8823
+ if (stopped) return;
8824
+ if (reachable) {
8825
+ consecutiveFailures = 0;
8826
+ options.setOnline(true);
8827
+ } else registerFailure("probe resolved unreachable");
8828
+ } catch (error) {
8829
+ if (stopped) return;
8830
+ registerFailure(error instanceof Error ? error.message : "probe threw");
8831
+ } finally {
8832
+ running = false;
8833
+ }
8834
+ };
8835
+ const registerFailure = (reason) => {
8836
+ consecutiveFailures += 1;
8837
+ options.logger?.debug("reachability probe failed", {
8838
+ reason,
8839
+ consecutiveFailures,
8840
+ failuresToOffline
8841
+ });
8842
+ if (consecutiveFailures >= failuresToOffline) options.setOnline(false);
8843
+ };
8844
+ timer = setInterval(() => {
8845
+ tick();
8846
+ }, intervalMs);
8847
+ if (typeof timer === "object" && timer !== null && "unref" in timer) timer.unref();
8848
+ if (runImmediately) tick();
8849
+ return { stop: () => {
8850
+ if (stopped) return;
8851
+ stopped = true;
8852
+ if (timer !== void 0) clearInterval(timer);
8853
+ timer = void 0;
8854
+ } };
8855
+ }
8713
8856
  /**
8714
8857
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
8715
8858
  * for every device, regardless of provider — the kernel needs a uniform
@@ -9373,26 +9516,13 @@ onBrightnessChanged: { data: object({
9373
9516
  */
9374
9517
  runtimeState: BrightnessStatusSchema
9375
9518
  };
9519
+ /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
9376
9520
  var StreamFormatSchema = _enum([
9377
9521
  "webrtc",
9378
9522
  "hls",
9379
9523
  "mjpeg",
9380
9524
  "rtsp"
9381
9525
  ]);
9382
- var StreamInfoSchema = object({
9383
- streamId: string(),
9384
- format: StreamFormatSchema,
9385
- url: string().nullable(),
9386
- active: boolean()
9387
- });
9388
- method(object({
9389
- streamId: string(),
9390
- sourceUrl: string(),
9391
- codec: string().optional()
9392
- }), _void(), { kind: "mutation" }), method(object({ streamId: string() }), _void(), { kind: "mutation" }), method(object({
9393
- streamId: string(),
9394
- format: StreamFormatSchema
9395
- }), string().nullable()), method(_void(), array(StreamInfoSchema));
9396
9526
  var RtspRestreamEntrySchema = object({
9397
9527
  brokerId: string(),
9398
9528
  url: string(),
@@ -10260,37 +10390,7 @@ var consumablesCapability = {
10260
10390
  scope: "device",
10261
10391
  deviceNative: true,
10262
10392
  mode: "singleton",
10263
- deviceTypes: [
10264
- DeviceType.Camera,
10265
- DeviceType.Hub,
10266
- DeviceType.Light,
10267
- DeviceType.Siren,
10268
- DeviceType.Switch,
10269
- DeviceType.Sensor,
10270
- DeviceType.Thermostat,
10271
- DeviceType.Button,
10272
- DeviceType.EventEmitter,
10273
- DeviceType.Update,
10274
- DeviceType.Generic,
10275
- DeviceType.Notifier,
10276
- DeviceType.Script,
10277
- DeviceType.Automation,
10278
- DeviceType.Lock,
10279
- DeviceType.Cover,
10280
- DeviceType.Valve,
10281
- DeviceType.Humidifier,
10282
- DeviceType.WaterHeater,
10283
- DeviceType.Fan,
10284
- DeviceType.MediaPlayer,
10285
- DeviceType.AlarmPanel,
10286
- DeviceType.Control,
10287
- DeviceType.Presence,
10288
- DeviceType.Weather,
10289
- DeviceType.Vacuum,
10290
- DeviceType.LawnMower,
10291
- DeviceType.Container,
10292
- DeviceType.Image
10293
- ],
10393
+ deviceTypes: Object.values(DeviceType),
10294
10394
  deviceConfig: { ui: {
10295
10395
  kind: "widget",
10296
10396
  widgetId: "host/consumables-panel",
@@ -11748,7 +11848,7 @@ var BoundingBoxSchema = object({
11748
11848
  w: number(),
11749
11849
  h: number()
11750
11850
  });
11751
- var SpatialDetectionSchema = object({
11851
+ object({
11752
11852
  class: string(),
11753
11853
  originalClass: string(),
11754
11854
  score: number(),
@@ -11883,7 +11983,6 @@ var PipelineDefaultStepSchema = lazy(() => object({
11883
11983
  enabled: boolean(),
11884
11984
  modelId: string(),
11885
11985
  children: array(PipelineDefaultStepSchema).readonly(),
11886
- engine: PipelineEngineChoiceSchema.optional(),
11887
11986
  group: string().optional(),
11888
11987
  settings: record(string(), unknown()).optional()
11889
11988
  }));
@@ -11908,7 +12007,9 @@ var PipelineModelOptionSchema = object({
11908
12007
  formats: record(string(), object({
11909
12008
  downloaded: boolean(),
11910
12009
  sizeMB: number()
11911
- }))
12010
+ })),
12011
+ group: ModelVariantGroupSchema.optional(),
12012
+ legacy: boolean().optional()
11912
12013
  });
11913
12014
  var ConfigFieldBridge = custom();
11914
12015
  var PipelineAddonSchemaSchema = object({
@@ -11938,11 +12039,6 @@ var PipelineSchemaSchema = object({
11938
12039
  selectedEngine: PipelineEngineChoiceSchema,
11939
12040
  slots: array(PipelineSlotSchemaSchema).readonly()
11940
12041
  });
11941
- var DetectorOutputSchema = object({
11942
- detections: array(SpatialDetectionSchema).readonly(),
11943
- inferenceMs: number(),
11944
- modelId: string()
11945
- });
11946
12042
  var EngineProvisioningSchema = object({
11947
12043
  runtimeId: _enum([
11948
12044
  "onnx",
@@ -11959,15 +12055,42 @@ var EngineProvisioningSchema = object({
11959
12055
  ]),
11960
12056
  progress: number().optional(),
11961
12057
  error: string().optional(),
11962
- nextRetryAt: number().optional()
12058
+ nextRetryAt: number().optional(),
12059
+ /**
12060
+ * Gate A (config-correctness gate at engine change): human-readable
12061
+ * config issues surfaced EAGERLY when the node's engine changes — model
12062
+ * substitutions ("chose X, running Y") and zero-build steps ("no model
12063
+ * has a <format> build"). Additive/optional: informational only, never
12064
+ * enforced here — `assertEngineReady` (readiness) still gates inference.
12065
+ * Absent/empty when the node-default tree resolves cleanly.
12066
+ */
12067
+ configIssues: array(string()).optional()
11963
12068
  });
11964
12069
  var PipelineStepInputSchema = lazy(() => object({
11965
12070
  addonId: string(),
11966
- modelId: string(),
12071
+ modelId: string().optional(),
11967
12072
  enabled: boolean().default(true),
11968
12073
  children: array(PipelineStepInputSchema).optional(),
11969
12074
  settings: record(string(), unknown()).optional()
11970
12075
  }));
12076
+ var ModelSubstitutionSchema = object({
12077
+ addonId: string(),
12078
+ chosen: string(),
12079
+ running: string(),
12080
+ format: string()
12081
+ });
12082
+ var PipelineValidationIssueSchema = object({
12083
+ addonId: string(),
12084
+ kind: _enum(["unknown-addon", "no-format-build"]),
12085
+ detail: string()
12086
+ });
12087
+ var PipelineValidationResultSchema = object({
12088
+ ok: boolean(),
12089
+ issues: array(PipelineValidationIssueSchema).readonly(),
12090
+ substitutions: array(ModelSubstitutionSchema).readonly(),
12091
+ /** The node's `currentEngine.format` this validation ran against. */
12092
+ format: string()
12093
+ });
11971
12094
  var ReferenceImageEntrySchema = object({
11972
12095
  filename: string(),
11973
12096
  stepIds: array(string()).readonly().optional()
@@ -12038,7 +12161,13 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
12038
12161
  })) }), object({ success: literal(true) }), {
12039
12162
  kind: "mutation",
12040
12163
  auth: "admin"
12041
- }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
12164
+ }), method(object({ nodeId: string() }), object({
12165
+ success: literal(true),
12166
+ clearedDevices: number()
12167
+ }), {
12168
+ kind: "mutation",
12169
+ auth: "admin"
12170
+ }), method(_void(), PipelineSchemaSchema), method(_void(), array(PipelineDefaultStepSchema).readonly().nullable()), method(_void(), PipelineConfigBridge), method(_void(), ConfigUISchemaBridge), method(object({ steps: array(PipelineStepInputSchema) }), PipelineValidationResultSchema), method(_void(), array(PipelineTemplateSchema$1).readonly()), method(object({
12042
12171
  name: string(),
12043
12172
  steps: array(PipelineTemplateStepSchema).readonly(),
12044
12173
  engine: PipelineEngineChoiceSchema
@@ -12055,10 +12184,6 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
12055
12184
  modelId: string(),
12056
12185
  format: ModelFormatSchema$1
12057
12186
  }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
12058
- addonId: string(),
12059
- frame: FrameInputSchema,
12060
- config: record(string(), unknown()).optional()
12061
- }), DetectorOutputSchema), method(object({
12062
12187
  engine: PipelineEngineChoiceSchema.optional(),
12063
12188
  steps: array(PipelineStepInputSchema).min(1),
12064
12189
  frame: FrameInputSchema.optional(),
@@ -12331,6 +12456,13 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12331
12456
  kind: literal("remote-restream"),
12332
12457
  /** The camera's source-owner node (slice 1: always the hub). */
12333
12458
  ownerNodeId: string(),
12459
+ /**
12460
+ * The owner's LAN-reachable host, resolved by the orchestrator from the
12461
+ * per-node `reachableHost` override (Cluster UI). When present the runner
12462
+ * dials THIS host for the owner's restream, in preference to the
12463
+ * `CAMSTACK_HUB_URL`-derived default. Absent → auto-detect fallback.
12464
+ */
12465
+ ownerReachableHost: string().optional(),
12334
12466
  /** Operator override for the owner host the runner dials. */
12335
12467
  hubHostnameOverride: string().optional()
12336
12468
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
@@ -12339,13 +12471,11 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
12339
12471
  * specific runner instance via `attachCamera`. Carries everything the
12340
12472
  * runner needs to subscribe to the local broker and execute inference.
12341
12473
  *
12342
- * Stateless-pipeline model: the full pipeline content (`engine`, `steps`,
12343
- * optional `audio`) travels with the attach payload. The runner keeps it
12344
- * in RAM for the lifetime of the attach — on rebalance, edit, or
12345
- * restart the orchestrator re-sends the latest snapshot.
12346
- *
12347
- * `engine`/`steps`/`audio` are optional during the additive migration
12348
- * window; once orchestrator + UI are migrated they become required.
12474
+ * Stateless-pipeline model: the pipeline content (`steps`, optional
12475
+ * `audio`) travels with the attach payload. The runner keeps it in RAM
12476
+ * for the lifetime of the attach — on rebalance, edit, or restart the
12477
+ * orchestrator re-sends the latest snapshot. Engine is NOT carried: it is
12478
+ * node-local, resolved by the executing runner at dispatch time.
12349
12479
  */
12350
12480
  var RunnerCameraConfigSchema = object({
12351
12481
  deviceId: number(),
@@ -12396,14 +12526,11 @@ var RunnerCameraConfigSchema = object({
12396
12526
  */
12397
12527
  motionSources: MotionSourcesSchema.default(["analyzer"]),
12398
12528
  pipelineEnabled: boolean().default(true),
12399
- /** Engine choice for video steps (runtime+backend+format). */
12400
- engine: PipelineEngineChoiceSchema.optional(),
12401
12529
  /** Ordered tree of video steps. Absent → runner skips video detection. */
12402
12530
  steps: array(PipelineStepInputSchema).readonly().optional(),
12403
12531
  /** Audio classification branch. `enabled:false` disables, null skips. */
12404
12532
  audio: object({
12405
- engine: PipelineEngineChoiceSchema,
12406
- modelId: string(),
12533
+ modelId: string().optional(),
12407
12534
  enabled: boolean()
12408
12535
  }).nullable().optional(),
12409
12536
  /**
@@ -15421,7 +15548,9 @@ var AddonPageDeclarationSchema$1 = object({
15421
15548
  icon: string(),
15422
15549
  path: string(),
15423
15550
  remoteName: string(),
15424
- bundle: string()
15551
+ bundle: string(),
15552
+ section: string().optional(),
15553
+ sectionLabel: string().optional()
15425
15554
  });
15426
15555
  var AddonPageInfoSchema = object({
15427
15556
  addonId: string(),
@@ -15461,7 +15590,18 @@ var AddonPageDeclarationSchema = object({
15461
15590
  * the static-file route can compute an mtime-based cache-buster URL
15462
15591
  * without a separate filesystem stat.
15463
15592
  */
15464
- bundle: string()
15593
+ bundle: string(),
15594
+ /**
15595
+ * Sidebar section this page docks into. Well-known ids: `'detection'`,
15596
+ * `'cluster'`, `'administration'` — the page renders inside that group.
15597
+ * Any OTHER string creates (or joins) a custom section rendered after
15598
+ * the built-in groups; its label comes from `sectionLabel` (first
15599
+ * declaration wins), falling back to the id. Absent → the legacy
15600
+ * "Addon Pages" group.
15601
+ */
15602
+ section: string().optional(),
15603
+ /** Display label for a CUSTOM `section` id (ignored for well-known ids). */
15604
+ sectionLabel: string().optional()
15465
15605
  });
15466
15606
  method(_void(), array(AddonPageDeclarationSchema).readonly());
15467
15607
  var AddonHttpRouteSchema = object({
@@ -15677,6 +15817,17 @@ var WidgetMetadataSchema = object({
15677
15817
  deviceContext: boolean().default(false),
15678
15818
  integrationContext: boolean().default(false)
15679
15819
  }),
15820
+ /**
15821
+ * Loadable BEFORE authentication. The normal widget registry listing
15822
+ * (`addon-widgets.listWidgets`) is auth-gated, so a pre-auth surface
15823
+ * (the login page) cannot discover a widget through it. A widget that
15824
+ * declares `preAuth: true` marks itself as safe to mount on a pre-auth
15825
+ * screen — it is surfaced through the PUBLIC `auth.listLoginMethods`
15826
+ * login-method contribution channel (see `login-method.cap.ts`) rather
15827
+ * than the authenticated registry, and its bundle is served by the
15828
+ * public `/api/addon-widgets/:addonId/*` static route. Defaults false.
15829
+ */
15830
+ preAuth: boolean().optional().default(false),
15680
15831
  /** Dashboard placement HINTS (operator can override per instance). */
15681
15832
  defaultSize: WidgetSizeEnum.default("md"),
15682
15833
  allowedSizes: array(WidgetSizeEnum).readonly().default([
@@ -15978,6 +16129,66 @@ method(object({
15978
16129
  password: string()
15979
16130
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
15980
16131
  /**
16132
+ * `login-method` — collection cap through which auth addons contribute
16133
+ * their pre-auth login surfaces to the login page. This is the SINGLE,
16134
+ * generic mechanism that supersedes the dead `auth.listProviders` reader:
16135
+ * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
16136
+ * `login-method` provider and the PUBLIC `auth.listLoginMethods`
16137
+ * procedure aggregates them for the unauthenticated login page.
16138
+ *
16139
+ * A contribution is a discriminated union on `kind`:
16140
+ *
16141
+ * - `redirect` — a declarative button. The login page renders a generic
16142
+ * button that navigates to `startUrl` (an addon-owned HTTP route).
16143
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
16144
+ * ZERO shell-side JS. A future SSO addon plugs in the same way — the
16145
+ * login page needs NO change.
16146
+ *
16147
+ * - `widget` — a Module-Federation widget the login page mounts (via
16148
+ * `loadRemoteBundle`) for an in-page ceremony. Covers the passkey
16149
+ * login ceremony, which must run `@simplewebauthn/browser` INSIDE the
16150
+ * addon bundle. The referenced widget also declares `preAuth: true` in
16151
+ * its `addon-widgets-source` catalog entry. `auth.listLoginMethods`
16152
+ * stamps a public `bundleUrl` from `addonId` + `bundle`.
16153
+ *
16154
+ * Every contribution carries a `stage`:
16155
+ * - `primary` — shown on the first credentials screen (OIDC /
16156
+ * magic-link buttons; a future usernameless passkey).
16157
+ * - `second-factor` — shown AFTER the password leg, gated on the
16158
+ * returned `factors` (passkey-as-2FA today).
16159
+ *
16160
+ * `mount: skip` — the cap is read server-side by the core auth router
16161
+ * (`registry.getCollection('login-method')`), never mounted as its own
16162
+ * tRPC router.
16163
+ */
16164
+ /** When a login method renders in the two-phase login flow. */
16165
+ var LoginStageEnum = _enum(["primary", "second-factor"]);
16166
+ /** One login-method contribution — redirect button OR pre-auth widget. */
16167
+ var LoginMethodContributionSchema = discriminatedUnion("kind", [object({
16168
+ kind: literal("redirect"),
16169
+ /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
16170
+ id: string(),
16171
+ /** Operator-facing button label. */
16172
+ label: string(),
16173
+ /** lucide-react icon name. */
16174
+ icon: string().optional(),
16175
+ /** Addon-owned HTTP route the button navigates to (GET). */
16176
+ startUrl: string(),
16177
+ stage: LoginStageEnum
16178
+ }), object({
16179
+ kind: literal("widget"),
16180
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
16181
+ id: string(),
16182
+ /** Owning addon id — drives the public bundle URL + the MF namespace. */
16183
+ addonId: string(),
16184
+ /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
16185
+ bundle: string(),
16186
+ /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
16187
+ remote: WidgetRemoteSchema,
16188
+ stage: LoginStageEnum
16189
+ })]);
16190
+ method(_void(), array(LoginMethodContributionSchema).readonly());
16191
+ /**
15981
16192
  * Orchestrator-side destination metadata. The orchestrator computes
15982
16193
  * `id = <addonId>:<subId>` from its provider lookup so consumers
15983
16194
  * (admin UI, restore flow) see one canonical key.
@@ -18278,11 +18489,11 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18278
18489
  timestamp: number()
18279
18490
  });
18280
18491
  var CameraPipelineConfigSchema = object({
18281
- engine: PipelineEngineChoiceSchema,
18492
+ engine: PipelineEngineChoiceSchema.optional(),
18282
18493
  steps: array(PipelineStepInputSchema).readonly(),
18283
18494
  audio: object({
18284
- engine: PipelineEngineChoiceSchema,
18285
- modelId: string(),
18495
+ engine: PipelineEngineChoiceSchema.optional(),
18496
+ modelId: string().optional(),
18286
18497
  enabled: boolean(),
18287
18498
  settings: record(string(), unknown()).readonly().optional()
18288
18499
  }).nullable().optional()
@@ -18297,7 +18508,7 @@ var PipelineTemplateSchema = object({
18297
18508
  });
18298
18509
  var AgentAddonConfigSchema = object({
18299
18510
  enabled: boolean(),
18300
- modelId: string(),
18511
+ modelId: string().optional(),
18301
18512
  settings: record(string(), unknown()).readonly()
18302
18513
  });
18303
18514
  var AgentPipelineSettingsSchema = object({
@@ -18307,12 +18518,25 @@ var AgentPipelineSettingsSchema = object({
18307
18518
  detectWeight: number().positive().optional(),
18308
18519
  /** Node is eligible to run the detection pipeline (decode + inference). */
18309
18520
  detect: boolean().optional(),
18310
- /** Node is eligible to host decoder sessions. */
18521
+ /**
18522
+ * DEPRECATED AND IGNORED. Decode is always co-located with its frame
18523
+ * consumer, so decode eligibility IS detect eligibility. Kept optional in
18524
+ * the schema ONLY so persisted stores written before the removal still
18525
+ * parse — no code reads it and no write path emits it.
18526
+ */
18311
18527
  decode: boolean().optional(),
18312
18528
  /** Node is eligible to run audio-analyzer sessions. */
18313
18529
  audio: boolean().optional(),
18314
18530
  /** Node is eligible to be the ingest / source-owner (serve the restream). */
18315
- ingest: boolean().optional()
18531
+ ingest: boolean().optional(),
18532
+ /**
18533
+ * Operator override for the LAN host a cross-node decoder dials to reach
18534
+ * THIS node's restream (Cluster UI). Absent → auto-detect: a remote runner
18535
+ * falls back to its `CAMSTACK_HUB_URL`-derived host (the Moleculer address
18536
+ * it already uses to reach the hub). Set this only when the auto-detected
18537
+ * address is wrong (multi-homed host, NAT, custom interface).
18538
+ */
18539
+ reachableHost: string().optional()
18316
18540
  });
18317
18541
  var CameraPipelineForAgentSchema = object({
18318
18542
  steps: array(PipelineStepInputSchema).readonly(),
@@ -18360,25 +18584,6 @@ var PipelineAssignmentSchema = object({
18360
18584
  assignedAt: number()
18361
18585
  });
18362
18586
  /**
18363
- * Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
18364
- * the decoder-node placement domain (`balanceDecoder` decision: manual pin
18365
- * → co-located with pipeline → capacity).
18366
- */
18367
- var DecoderAssignmentSchema = object({
18368
- deviceId: number(),
18369
- /** Moleculer node id of the decoder provider currently responsible for this camera. */
18370
- decoderNodeId: string(),
18371
- /** True when the assignment was set manually via `assignDecoder`, false when chosen by the balancer. */
18372
- pinned: boolean(),
18373
- /** Why this assignment was made — useful for debugging the decoder balancer. */
18374
- reason: _enum([
18375
- "manual",
18376
- "co-located",
18377
- "capacity",
18378
- "hardware-affinity"
18379
- ])
18380
- });
18381
- /**
18382
18587
  * Per-agent load summary surfaced to the load balancer + dashboards.
18383
18588
  * Aggregated from each runner's `getLocalLoad` cap call.
18384
18589
  */
@@ -18418,6 +18623,15 @@ var GlobalMetricsSchema = object({
18418
18623
  * capability providers.
18419
18624
  */
18420
18625
  var CapabilityBindingsSchema = record(string(), string());
18626
+ /**
18627
+ * The cluster's single camera-source owner (`clusterRoles.ingestNode`) plus
18628
+ * its LAN-reachable host, if one is registered. See `getIngestOwner`.
18629
+ */
18630
+ var IngestOwnerSchema = object({
18631
+ ownerNodeId: string(),
18632
+ reachableHost: string().optional(),
18633
+ configIssue: string().optional()
18634
+ });
18421
18635
  /** Source block — always present; derives from the stream catalog. */
18422
18636
  var CameraSourceStatusSchema = object({ streams: array(object({
18423
18637
  camStreamId: string(),
@@ -18432,6 +18646,14 @@ var CameraAssignmentStatusSchema = object({
18432
18646
  detectionNodeId: string().nullable(),
18433
18647
  decoderNodeId: string().nullable(),
18434
18648
  audioNodeId: string().nullable(),
18649
+ /**
18650
+ * The node that OWNS this camera's physical source pull (dials the RTSP and
18651
+ * hosts the broker/restream) — the cluster ingest owner today
18652
+ * (`clusterRoles.ingestNode`), per-camera once source assignment lands. Lets
18653
+ * the UI show WHERE a camera is sourced without SSH/logs, and is the node the
18654
+ * broker block below was read from (pinned). Nullable only pre-wiring.
18655
+ */
18656
+ sourceNodeId: string().nullable(),
18435
18657
  pinned: object({
18436
18658
  detection: boolean(),
18437
18659
  decoder: boolean(),
@@ -18564,16 +18786,7 @@ method(object({
18564
18786
  }), object({ success: literal(true) }), {
18565
18787
  kind: "mutation",
18566
18788
  auth: "admin"
18567
- }), method(object({
18568
- deviceId: number(),
18569
- nodeId: string()
18570
- }), _void(), {
18571
- kind: "mutation",
18572
- auth: "admin"
18573
- }), method(object({ deviceId: number() }), _void(), {
18574
- kind: "mutation",
18575
- auth: "admin"
18576
- }), method(_void(), array(DecoderAssignmentSchema).readonly()), method(object({
18789
+ }), method(_void(), IngestOwnerSchema), method(object({
18577
18790
  deviceId: number(),
18578
18791
  nodeId: string()
18579
18792
  }), object({ success: literal(true) }), {
@@ -18594,10 +18807,7 @@ method(object({
18594
18807
  nodeId: string(),
18595
18808
  pinned: boolean(),
18596
18809
  assignedAt: number()
18597
- }))), method(object({
18598
- deviceId: number(),
18599
- pipelineNodeId: string().optional()
18600
- }), DecoderAssignmentSchema), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
18810
+ }))), method(object({ agentNodeId: string() }), AgentPipelineSettingsSchema.nullable()), method(_void(), array(object({
18601
18811
  nodeId: string(),
18602
18812
  settings: AgentPipelineSettingsSchema
18603
18813
  })).readonly()), method(object({
@@ -18627,12 +18837,26 @@ method(object({
18627
18837
  }), method(object({
18628
18838
  agentNodeId: string(),
18629
18839
  detect: boolean().nullable().optional(),
18630
- decode: boolean().nullable().optional(),
18631
18840
  audio: boolean().nullable().optional(),
18632
18841
  ingest: boolean().nullable().optional()
18633
18842
  }), object({ success: literal(true) }), {
18634
18843
  kind: "mutation",
18635
18844
  auth: "admin"
18845
+ }), method(object({
18846
+ agentNodeId: string(),
18847
+ reachableHost: string().nullable()
18848
+ }), object({ success: literal(true) }), {
18849
+ kind: "mutation",
18850
+ auth: "admin"
18851
+ }), method(object({ agentNodeId: string() }), object({
18852
+ success: literal(true),
18853
+ /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
18854
+ effectiveModelId: string().nullable(),
18855
+ /** Number of cameras whose node-scoped overrides were cleared. */
18856
+ clearedCameraOverrides: number()
18857
+ }), {
18858
+ kind: "mutation",
18859
+ auth: "admin"
18636
18860
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
18637
18861
  deviceId: number(),
18638
18862
  addonId: string(),
@@ -18677,22 +18901,131 @@ method(object({
18677
18901
  kind: "mutation",
18678
18902
  auth: "admin"
18679
18903
  });
18680
- var RegisteredStreamSchema = object({
18681
- streamId: string(),
18682
- label: string().optional(),
18683
- codec: string(),
18684
- type: _enum(["video", "audio"]),
18685
- sourceUrl: string()
18904
+ /**
18905
+ * server-management — per-NODE singleton capability for a node's ROOT
18906
+ * package lifecycle (runtime-updatable node packages, phase 2: hub + docker
18907
+ * agents).
18908
+ *
18909
+ * Each node's root package (`@camstack/server` on the hub, `@camstack/agent`
18910
+ * on agents) carries the whole software stack in its npm dep tree, so ONE
18911
+ * version describes the node. Updates install into
18912
+ * `<dataDir>/server-root/versions/<v>/` and apply on restart via the baked
18913
+ * starter (probation boot + auto-rollback to N-1).
18914
+ *
18915
+ * Providers:
18916
+ * - HUB: `ServerUpdateService` behind the `server-provided` mount
18917
+ * (`buildServerProviders` in trpc.router.ts) — the default target for
18918
+ * unpinned calls.
18919
+ * - AGENT: `AgentUpdateService` registered by the agent bootstrap under
18920
+ * the synthetic `agent-runtime` addonId and declared in the agent's
18921
+ * `$hub.registerNode` manifest.
18922
+ *
18923
+ * Node routing: singleton caps get the codegen/runtime-builder `nodeId`
18924
+ * injection on every method — `input.nodeId` (or `nodePin(nodeId)` from the
18925
+ * SDK) routes the call to that node's provider via the standard remote
18926
+ * proxy (`createCapabilityProxy` → `$agent-cap-fwd` → the agent's
18927
+ * in-process provider lookup). No `nodeId` → the hub's own provider.
18928
+ *
18929
+ * Spec: docs/superpowers/specs/2026-07-12-runtime-updatable-node-packages-design.md
18930
+ */
18931
+ /**
18932
+ * Where the running hub's code was loaded from:
18933
+ * - `workspace` — dev checkout (tsx / workspace dist); the starter defers to
18934
+ * plain resolution and runtime updates are refused.
18935
+ * - `baked` — the immutable image seed closure (no data-dir root active).
18936
+ * - `data-root` — the runtime-updatable `<dataDir>/server-root` closure.
18937
+ */
18938
+ var ServerBootModeSchema = _enum([
18939
+ "workspace",
18940
+ "baked",
18941
+ "data-root"
18942
+ ]);
18943
+ /**
18944
+ * Update lifecycle state:
18945
+ * - `idle` / `checking` / `staging` — steady / in-flight registry work.
18946
+ * - `pending-restart` — a version is staged and the node has NOT yet
18947
+ * restarted onto it (still running the OLD version).
18948
+ * - `awaiting-confirmation` — the node HAS restarted onto the staged version
18949
+ * (it is the active probation boot) and is waiting to confirm boot-health.
18950
+ * Apply/rollback are refused in this state and the node must NOT be
18951
+ * manually restarted, or the probation boot auto-rolls-back.
18952
+ */
18953
+ var ServerUpdateStateSchema = _enum([
18954
+ "idle",
18955
+ "checking",
18956
+ "staging",
18957
+ "pending-restart",
18958
+ "awaiting-confirmation"
18959
+ ]);
18960
+ var ServerRollbackInfoSchema = object({
18961
+ /** The version that failed (or was manually rolled back). */
18962
+ fromVersion: string(),
18963
+ /** The version rolled back to; null = the baked seed. */
18964
+ toVersion: string().nullable(),
18965
+ atMs: number(),
18966
+ reason: string()
18686
18967
  });
18687
- var ExposedResourceSchema = object({
18688
- streamId: string(),
18689
- format: string(),
18690
- value: string()
18968
+ var ServerPackageStatusSchema = object({
18969
+ /** Root package name (`@camstack/server` on the hub). */
18970
+ packageName: string(),
18971
+ /** Version of the code the running process ACTUALLY loaded. */
18972
+ runningVersion: string().nullable(),
18973
+ /** Node.js runtime version the node's process runs on (`process.versions.node`). */
18974
+ nodeRuntimeVersion: string().nullable(),
18975
+ /** Active data-dir root version; null when booted from seed/workspace. */
18976
+ activeVersion: string().nullable(),
18977
+ /** N-1 version kept for rollback; null when no previous version exists. */
18978
+ previousVersion: string().nullable(),
18979
+ /** Version of the immutable baked seed closure (image fallback). */
18980
+ seedVersion: string().nullable(),
18981
+ /** Latest registry version from the most recent check (null = never checked). */
18982
+ latestVersion: string().nullable(),
18983
+ updateAvailable: boolean(),
18984
+ bootMode: ServerBootModeSchema,
18985
+ updateState: ServerUpdateStateSchema,
18986
+ /** Version staged + awaiting its probation boot, when one is pending. */
18987
+ pendingVersion: string().nullable(),
18988
+ /** Set when the last freshly-activated version failed its boot health-check. */
18989
+ rolledBack: ServerRollbackInfoSchema.nullable(),
18990
+ /**
18991
+ * True when `server-root/state.json` EXISTS but is unreadable/corrupt — the
18992
+ * hub is running from the baked seed (or workspace) while installed data-dir
18993
+ * versions are being IGNORED. Surfaced as a warning in the UI.
18994
+ */
18995
+ stateFileCorrupt: boolean(),
18996
+ lastCheckedAtMs: number().nullable()
18997
+ });
18998
+ var ServerUpdateCheckResultSchema = object({
18999
+ packageName: string(),
19000
+ runningVersion: string().nullable(),
19001
+ latestVersion: string().nullable(),
19002
+ updateAvailable: boolean(),
19003
+ checkedAtMs: number(),
19004
+ /** Non-null when the registry lookup failed (offline, bad registry, …). */
19005
+ error: string().nullable()
19006
+ });
19007
+ var ServerUpdateActionResultSchema = object({
19008
+ accepted: boolean(),
19009
+ targetVersion: string().nullable(),
19010
+ /** True when a graceful restart was scheduled to apply the change. */
19011
+ restarting: boolean(),
19012
+ message: string()
19013
+ });
19014
+ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
19015
+ kind: "mutation",
19016
+ auth: "admin"
19017
+ }), method(object({
19018
+ /** Explicit target version; omitted = latest from the registry. */
19019
+ version: string().optional() }), ServerUpdateActionResultSchema, {
19020
+ kind: "mutation",
19021
+ auth: "admin"
19022
+ }), method(_void(), ServerUpdateActionResultSchema, {
19023
+ kind: "mutation",
19024
+ auth: "admin"
19025
+ }), method(_void(), ServerUpdateActionResultSchema, {
19026
+ kind: "mutation",
19027
+ auth: "admin"
18691
19028
  });
18692
- method(object({
18693
- deviceId: number(),
18694
- streams: array(RegisteredStreamSchema).readonly()
18695
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(ExposedResourceSchema).readonly());
18696
19029
  /**
18697
19030
  * Query filter for settings-store collections.
18698
19031
  */
@@ -18845,9 +19178,9 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
18845
19178
  /**
18846
19179
  * A single device snapshot returned as base64 JPEG/PNG.
18847
19180
  *
18848
- * Shared with the `snapshot-provider` collection cap the orchestrator
18849
- * receives the same shape from each native provider and from the
18850
- * broker-based fallback.
19181
+ * The `SnapshotAddon` wrapper returns this shape whether the frame came from
19182
+ * the device-native provider (onboard capture) or from the stream-broker
19183
+ * prebuffer fallback.
18851
19184
  */
18852
19185
  var SnapshotImageSchema = object({
18853
19186
  base64: string(),
@@ -18922,10 +19255,6 @@ var snapshotCapability = {
18922
19255
  kind: "poll"
18923
19256
  }
18924
19257
  };
18925
- method(object({ deviceId: number() }), boolean()), method(object({
18926
- deviceId: number(),
18927
- streamId: string().optional()
18928
- }), SnapshotImageSchema.nullable());
18929
19258
  /**
18930
19259
  * `sso-bridge` — internal hub-only cap that lets SSO-style auth
18931
19260
  * providers (OIDC, SAML, magic-link, …) mint an HMAC-signed token
@@ -19286,9 +19615,10 @@ method(object({
19286
19615
  auth: "admin"
19287
19616
  });
19288
19617
  /**
19289
- * Optional client-side hints sent at session creation to help the
19290
- * provider pick the best native source. All fields are optional —
19291
- * a viewer that knows nothing still gets a sane default.
19618
+ * Optional client-side hints sent at session creation to help the provider
19619
+ * pick the best native source. All fields optional — a viewer that knows
19620
+ * nothing still gets a sane default. (Relocated from the retired `webrtc`
19621
+ * collection cap; this `webrtc-session` cap is the live signaling surface.)
19292
19622
  */
19293
19623
  var webrtcClientHintsSchema = object({
19294
19624
  viewportWidth: number().int().positive().optional(),
@@ -19299,22 +19629,6 @@ var webrtcClientHintsSchema = object({
19299
19629
  /** Hard tier override; takes precedence over scoring when registered. */
19300
19630
  prefersTier: string().optional()
19301
19631
  }).partial();
19302
- method(object({
19303
- streamId: string(),
19304
- sdpOffer: string()
19305
- }), string(), { kind: "mutation" }), method(object({ streamId: string() }), boolean()), method(object({
19306
- streamId: string(),
19307
- codec: string()
19308
- }), _void(), { kind: "mutation" }), method(object({ streamId: string() }), _void(), { kind: "mutation" }), method(object({
19309
- streamId: string(),
19310
- hints: webrtcClientHintsSchema.optional()
19311
- }), object({
19312
- sessionId: string(),
19313
- sdpOffer: string()
19314
- }), { kind: "mutation" }), method(object({
19315
- sessionId: string(),
19316
- sdpAnswer: string()
19317
- }), _void(), { kind: "mutation" }), method(object({ sessionId: string() }), _void(), { kind: "mutation" }), method(object({ streamId: string() }), boolean());
19318
19632
  /**
19319
19633
  * Discriminated target for a WebRTC session. The client sends this
19320
19634
  * structured object instead of building / parsing brokerId strings;
@@ -20793,6 +21107,16 @@ var TopologyCategorySchema = object({
20793
21107
  healthy: number(),
20794
21108
  addons: array(TopologyCategoryAddonSchema).readonly()
20795
21109
  });
21110
+ /**
21111
+ * The node's runtime-updatable ROOT package (`@camstack/server` on the hub,
21112
+ * `@camstack/agent` on agents) as reported by its `registerNode` manifest —
21113
+ * version visibility for the Server management surface. Nullable: offline
21114
+ * rows and pre-phase-2 nodes report none.
21115
+ */
21116
+ var TopologyRootPackageSchema = object({
21117
+ name: string(),
21118
+ version: string()
21119
+ });
20796
21120
  var TopologyNodeSchema = object({
20797
21121
  id: string(),
20798
21122
  name: string(),
@@ -20816,7 +21140,8 @@ var TopologyNodeSchema = object({
20816
21140
  status: string()
20817
21141
  })).readonly(),
20818
21142
  processes: array(TopologyProcessSchema).readonly(),
20819
- categories: array(TopologyCategorySchema).readonly()
21143
+ categories: array(TopologyCategorySchema).readonly(),
21144
+ rootPackage: TopologyRootPackageSchema.nullable()
20820
21145
  });
20821
21146
  var CapUsageEdgeSchema = object({
20822
21147
  callerAddonId: string(),
@@ -23940,6 +24265,12 @@ Object.freeze({
23940
24265
  addonId: null,
23941
24266
  access: "create"
23942
24267
  },
24268
+ "loginMethod.getLoginMethods": {
24269
+ capName: "login-method",
24270
+ capScope: "system",
24271
+ addonId: null,
24272
+ access: "view"
24273
+ },
23943
24274
  "mediaPlayer.next": {
23944
24275
  capName: "media-player",
23945
24276
  capScope: "device",
@@ -24570,23 +24901,23 @@ Object.freeze({
24570
24901
  addonId: null,
24571
24902
  access: "create"
24572
24903
  },
24573
- "pipelineExecutor.deleteModel": {
24904
+ "pipelineExecutor.clearDeviceOverrides": {
24574
24905
  capName: "pipeline-executor",
24575
24906
  capScope: "system",
24576
24907
  addonId: null,
24577
24908
  access: "delete"
24578
24909
  },
24579
- "pipelineExecutor.deleteTemplate": {
24910
+ "pipelineExecutor.deleteModel": {
24580
24911
  capName: "pipeline-executor",
24581
24912
  capScope: "system",
24582
24913
  addonId: null,
24583
24914
  access: "delete"
24584
24915
  },
24585
- "pipelineExecutor.detect": {
24916
+ "pipelineExecutor.deleteTemplate": {
24586
24917
  capName: "pipeline-executor",
24587
24918
  capScope: "system",
24588
24919
  addonId: null,
24589
- access: "view"
24920
+ access: "delete"
24590
24921
  },
24591
24922
  "pipelineExecutor.downloadModel": {
24592
24923
  capName: "pipeline-executor",
@@ -24780,13 +25111,13 @@ Object.freeze({
24780
25111
  addonId: null,
24781
25112
  access: "create"
24782
25113
  },
24783
- "pipelineOrchestrator.assignAudio": {
24784
- capName: "pipeline-orchestrator",
25114
+ "pipelineExecutor.validatePipeline": {
25115
+ capName: "pipeline-executor",
24785
25116
  capScope: "system",
24786
25117
  addonId: null,
24787
- access: "create"
25118
+ access: "view"
24788
25119
  },
24789
- "pipelineOrchestrator.assignDecoder": {
25120
+ "pipelineOrchestrator.assignAudio": {
24790
25121
  capName: "pipeline-orchestrator",
24791
25122
  capScope: "system",
24792
25123
  addonId: null,
@@ -24870,19 +25201,13 @@ Object.freeze({
24870
25201
  addonId: null,
24871
25202
  access: "view"
24872
25203
  },
24873
- "pipelineOrchestrator.getDecoderAssignment": {
24874
- capName: "pipeline-orchestrator",
24875
- capScope: "system",
24876
- addonId: null,
24877
- access: "view"
24878
- },
24879
- "pipelineOrchestrator.getDecoderAssignments": {
25204
+ "pipelineOrchestrator.getGlobalMetrics": {
24880
25205
  capName: "pipeline-orchestrator",
24881
25206
  capScope: "system",
24882
25207
  addonId: null,
24883
25208
  access: "view"
24884
25209
  },
24885
- "pipelineOrchestrator.getGlobalMetrics": {
25210
+ "pipelineOrchestrator.getIngestOwner": {
24886
25211
  capName: "pipeline-orchestrator",
24887
25212
  capScope: "system",
24888
25213
  addonId: null,
@@ -24924,6 +25249,12 @@ Object.freeze({
24924
25249
  addonId: null,
24925
25250
  access: "delete"
24926
25251
  },
25252
+ "pipelineOrchestrator.resetNodePipelineDefaults": {
25253
+ capName: "pipeline-orchestrator",
25254
+ capScope: "system",
25255
+ addonId: null,
25256
+ access: "delete"
25257
+ },
24927
25258
  "pipelineOrchestrator.resolvePipeline": {
24928
25259
  capName: "pipeline-orchestrator",
24929
25260
  capScope: "system",
@@ -24960,37 +25291,37 @@ Object.freeze({
24960
25291
  addonId: null,
24961
25292
  access: "create"
24962
25293
  },
24963
- "pipelineOrchestrator.setCameraPipelineForAgent": {
25294
+ "pipelineOrchestrator.setAgentReachableHost": {
24964
25295
  capName: "pipeline-orchestrator",
24965
25296
  capScope: "system",
24966
25297
  addonId: null,
24967
25298
  access: "create"
24968
25299
  },
24969
- "pipelineOrchestrator.setCameraStepOverride": {
25300
+ "pipelineOrchestrator.setCameraPipelineForAgent": {
24970
25301
  capName: "pipeline-orchestrator",
24971
25302
  capScope: "system",
24972
25303
  addonId: null,
24973
25304
  access: "create"
24974
25305
  },
24975
- "pipelineOrchestrator.setCameraStepToggle": {
25306
+ "pipelineOrchestrator.setCameraStepOverride": {
24976
25307
  capName: "pipeline-orchestrator",
24977
25308
  capScope: "system",
24978
25309
  addonId: null,
24979
25310
  access: "create"
24980
25311
  },
24981
- "pipelineOrchestrator.setCapabilityBinding": {
25312
+ "pipelineOrchestrator.setCameraStepToggle": {
24982
25313
  capName: "pipeline-orchestrator",
24983
25314
  capScope: "system",
24984
25315
  addonId: null,
24985
25316
  access: "create"
24986
25317
  },
24987
- "pipelineOrchestrator.unassignAudio": {
25318
+ "pipelineOrchestrator.setCapabilityBinding": {
24988
25319
  capName: "pipeline-orchestrator",
24989
25320
  capScope: "system",
24990
25321
  addonId: null,
24991
25322
  access: "create"
24992
25323
  },
24993
- "pipelineOrchestrator.unassignDecoder": {
25324
+ "pipelineOrchestrator.unassignAudio": {
24994
25325
  capName: "pipeline-orchestrator",
24995
25326
  capScope: "system",
24996
25327
  addonId: null,
@@ -25290,33 +25621,45 @@ Object.freeze({
25290
25621
  addonId: null,
25291
25622
  access: "create"
25292
25623
  },
25293
- "restreamer.getExposedResources": {
25294
- capName: "restreamer",
25624
+ "scriptRunner.run": {
25625
+ capName: "script-runner",
25626
+ capScope: "device",
25627
+ addonId: null,
25628
+ access: "create"
25629
+ },
25630
+ "scriptRunner.stop": {
25631
+ capName: "script-runner",
25632
+ capScope: "device",
25633
+ addonId: null,
25634
+ access: "create"
25635
+ },
25636
+ "serverManagement.applyServerUpdate": {
25637
+ capName: "server-management",
25295
25638
  capScope: "system",
25296
25639
  addonId: null,
25297
- access: "view"
25640
+ access: "create"
25298
25641
  },
25299
- "restreamer.registerDevice": {
25300
- capName: "restreamer",
25642
+ "serverManagement.checkServerUpdate": {
25643
+ capName: "server-management",
25301
25644
  capScope: "system",
25302
25645
  addonId: null,
25303
25646
  access: "create"
25304
25647
  },
25305
- "restreamer.unregisterDevice": {
25306
- capName: "restreamer",
25648
+ "serverManagement.getServerPackageStatus": {
25649
+ capName: "server-management",
25307
25650
  capScope: "system",
25308
25651
  addonId: null,
25309
- access: "delete"
25652
+ access: "view"
25310
25653
  },
25311
- "scriptRunner.run": {
25312
- capName: "script-runner",
25313
- capScope: "device",
25654
+ "serverManagement.restartServer": {
25655
+ capName: "server-management",
25656
+ capScope: "system",
25314
25657
  addonId: null,
25315
25658
  access: "create"
25316
25659
  },
25317
- "scriptRunner.stop": {
25318
- capName: "script-runner",
25319
- capScope: "device",
25660
+ "serverManagement.rollbackServerUpdate": {
25661
+ capName: "server-management",
25662
+ capScope: "system",
25320
25663
  addonId: null,
25321
25664
  access: "create"
25322
25665
  },
@@ -25410,18 +25753,6 @@ Object.freeze({
25410
25753
  addonId: null,
25411
25754
  access: "create"
25412
25755
  },
25413
- "snapshotProvider.getSnapshot": {
25414
- capName: "snapshot-provider",
25415
- capScope: "system",
25416
- addonId: null,
25417
- access: "view"
25418
- },
25419
- "snapshotProvider.supportsDevice": {
25420
- capName: "snapshot-provider",
25421
- capScope: "system",
25422
- addonId: null,
25423
- access: "view"
25424
- },
25425
25756
  "ssoBridge.signBridgeToken": {
25426
25757
  capName: "sso-bridge",
25427
25758
  capScope: "system",
@@ -25848,30 +26179,6 @@ Object.freeze({
25848
26179
  addonId: null,
25849
26180
  access: "view"
25850
26181
  },
25851
- "streamingEngine.getStreamUrl": {
25852
- capName: "streaming-engine",
25853
- capScope: "system",
25854
- addonId: null,
25855
- access: "view"
25856
- },
25857
- "streamingEngine.listStreams": {
25858
- capName: "streaming-engine",
25859
- capScope: "system",
25860
- addonId: null,
25861
- access: "view"
25862
- },
25863
- "streamingEngine.registerStream": {
25864
- capName: "streaming-engine",
25865
- capScope: "system",
25866
- addonId: null,
25867
- access: "create"
25868
- },
25869
- "streamingEngine.unregisterStream": {
25870
- capName: "streaming-engine",
25871
- capScope: "system",
25872
- addonId: null,
25873
- access: "delete"
25874
- },
25875
26182
  "streamParams.getConfigSchema": {
25876
26183
  capName: "stream-params",
25877
26184
  capScope: "device",
@@ -26220,6 +26527,18 @@ Object.freeze({
26220
26527
  addonId: null,
26221
26528
  access: "view"
26222
26529
  },
26530
+ "viewerUi.getStaticDir": {
26531
+ capName: "viewer-ui",
26532
+ capScope: "system",
26533
+ addonId: null,
26534
+ access: "view"
26535
+ },
26536
+ "viewerUi.getVersion": {
26537
+ capName: "viewer-ui",
26538
+ capScope: "system",
26539
+ addonId: null,
26540
+ access: "view"
26541
+ },
26223
26542
  "waterHeater.setAway": {
26224
26543
  capName: "water-heater",
26225
26544
  capScope: "device",
@@ -26238,54 +26557,6 @@ Object.freeze({
26238
26557
  addonId: null,
26239
26558
  access: "create"
26240
26559
  },
26241
- "webrtc.closeSession": {
26242
- capName: "webrtc",
26243
- capScope: "system",
26244
- addonId: null,
26245
- access: "create"
26246
- },
26247
- "webrtc.createSession": {
26248
- capName: "webrtc",
26249
- capScope: "system",
26250
- addonId: null,
26251
- access: "create"
26252
- },
26253
- "webrtc.handleAnswer": {
26254
- capName: "webrtc",
26255
- capScope: "system",
26256
- addonId: null,
26257
- access: "create"
26258
- },
26259
- "webrtc.handleOffer": {
26260
- capName: "webrtc",
26261
- capScope: "system",
26262
- addonId: null,
26263
- access: "create"
26264
- },
26265
- "webrtc.hasAdaptiveBitrate": {
26266
- capName: "webrtc",
26267
- capScope: "system",
26268
- addonId: null,
26269
- access: "view"
26270
- },
26271
- "webrtc.registerStream": {
26272
- capName: "webrtc",
26273
- capScope: "system",
26274
- addonId: null,
26275
- access: "create"
26276
- },
26277
- "webrtc.supportsStream": {
26278
- capName: "webrtc",
26279
- capScope: "system",
26280
- addonId: null,
26281
- access: "view"
26282
- },
26283
- "webrtc.unregisterStream": {
26284
- capName: "webrtc",
26285
- capScope: "system",
26286
- addonId: null,
26287
- access: "delete"
26288
- },
26289
26560
  "webrtcSession.addIceCandidate": {
26290
26561
  capName: "webrtc-session",
26291
26562
  capScope: "device",
@@ -30351,6 +30622,10 @@ var HikvisionCamera = class HikvisionCamera extends BaseDevice {
30351
30622
  * universal overlay UI. */
30352
30623
  osdPollTimer = null;
30353
30624
  static OSD_POLL_INTERVAL_MS = 3e5;
30625
+ /** Control-plane reachability poll — drives `device.online` from ISAPI
30626
+ * `getDeviceInfo` liveness, decoupled from stream-broker video health.
30627
+ * Started in `onActivate`, stopped in `removeDevice`. */
30628
+ reachabilityPoll = null;
30354
30629
  constructor(ctx) {
30355
30630
  super(ctx, hikvisionCameraSchema, { type: DeviceType.Camera });
30356
30631
  this.registerNativeCapabilities();
@@ -30835,6 +31110,25 @@ var HikvisionCamera = class HikvisionCamera extends BaseDevice {
30835
31110
  if (this.osdPollTimer === null) this.osdPollTimer = setInterval(() => {
30836
31111
  this.refreshOsdSnapshot();
30837
31112
  }, HikvisionCamera.OSD_POLL_INTERVAL_MS);
31113
+ this.startReachabilityPolling();
31114
+ }
31115
+ /** Start the control-plane reachability poll: an ISAPI `getDeviceInfo`
31116
+ * round-trip every 30s drives `device.online`, with hysteresis. This
31117
+ * replaces the old stream-health→online mirror so an on-demand (idle)
31118
+ * camera that is reachable still reports ONLINE. Idempotent. */
31119
+ startReachabilityPolling() {
31120
+ if (this.reachabilityPoll) return;
31121
+ this.reachabilityPoll = startReachabilityPoll({
31122
+ probe: async () => {
31123
+ await this.ensureClient().getDeviceInfo();
31124
+ return true;
31125
+ },
31126
+ setOnline: (online) => {
31127
+ this.markOnline(online);
31128
+ },
31129
+ isEnabled: () => !this.disabled,
31130
+ logger: this.ctx.logger
31131
+ });
30838
31132
  }
30839
31133
  /** Single-flight OSD config fetch; updates the in-memory snapshot
30840
31134
  * consumed by the readonly OSD section in `getSettingsUISchema`. */
@@ -33227,6 +33521,8 @@ var HikvisionCamera = class HikvisionCamera extends BaseDevice {
33227
33521
  clearInterval(this.osdPollTimer);
33228
33522
  this.osdPollTimer = null;
33229
33523
  }
33524
+ this.reachabilityPoll?.stop();
33525
+ this.reachabilityPoll = null;
33230
33526
  await this.disconnectAll();
33231
33527
  for (const camStreamId of this.published.keys()) try {
33232
33528
  await this.ctx.api.streamBroker.retractCameraStream.mutate({
@@ -42589,21 +42885,7 @@ var HikvisionProviderAddon = class extends BaseDeviceProvider {
42589
42885
  throw new Error(`Hikvision: ${reason}`);
42590
42886
  }
42591
42887
  async onInitialize() {
42592
- const regs = await super.onInitialize();
42593
- this.subscribe({ category: EventCategory.DeviceStateChanged }, (event) => {
42594
- const data = event.data;
42595
- if (data.capName !== "camera-streams") return;
42596
- const deviceId = data.deviceId;
42597
- if (typeof deviceId !== "number") return;
42598
- const registry = this.ctx.kernel.deviceRegistry;
42599
- if (!registry) return;
42600
- if (registry.getAddonId(deviceId) !== this.addonId) return;
42601
- const device = registry.getById(deviceId);
42602
- if (!device) return;
42603
- const online = data.slice?.online === true;
42604
- if (device.online !== online) device.online = online;
42605
- });
42606
- return regs;
42888
+ return await super.onInitialize();
42607
42889
  }
42608
42890
  async supportsDiscovery() {
42609
42891
  return true;