@camstack/addon-pipeline-orchestrator 1.2.678 → 1.2.680

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 (23) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/assets/viewer/.viewer-current-files.json +7 -7
  3. package/assets/viewer/.viewer-version +1 -1
  4. package/assets/viewer/_expo/static/js/web/{__common-5b85841d4b20f62da7b2fcdd19153836.js → __common-4b0e8e7d1610c7eb9d241a1dd8277efa.js} +3 -3
  5. package/assets/viewer/_expo/static/js/web/{index-7235749a43354ff5e4efd45a599be105.js → index-b82e54d11b06c09ac899aac34aed27a7.js} +1 -1
  6. package/assets/viewer/embed/assets/{MaskShapeCanvas-DI4BY7W2-CEMqjRJN.js → MaskShapeCanvas-DI4BY7W2-Cb-CQXln.js} +1 -1
  7. package/assets/viewer/embed/assets/{MotionZonesSettings-CiYjd-yl-D_6jvati.js → MotionZonesSettings-CiYjd-yl-m3SV5EsR.js} +1 -1
  8. package/assets/viewer/embed/assets/{PrivacyMaskSettings-BmRdUrPp-BIB4Ve84.js → PrivacyMaskSettings-BmRdUrPp-EEX8FXC1.js} +1 -1
  9. package/assets/viewer/embed/assets/{SceneMonitorEditor-J4Ix_0tu-C6Xky6hS.js → SceneMonitorEditor-J4Ix_0tu-CSaKW_fd.js} +1 -1
  10. package/assets/viewer/embed/assets/{index-BhAHkshc.js → index-Do4HR8G8.js} +20 -20
  11. package/assets/viewer/embed/index.html +1 -1
  12. package/assets/viewer/index.html +1 -1
  13. package/dist/_stub.js +2 -2
  14. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-PkgzkqZQ.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-BWnvPLO-.mjs} +2 -2
  15. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DdeKARA7.mjs +26 -0
  16. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-8zgS5KkE.mjs +26 -0
  17. package/dist/{hostInit-CwwBxk0T.mjs → hostInit-CnA8Kd3k.mjs} +2 -2
  18. package/dist/index.js +178 -181
  19. package/dist/index.mjs +178 -181
  20. package/dist/remoteEntry.js +1 -1
  21. package/package.json +2 -2
  22. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B_-LNNZA.mjs +0 -26
  23. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-2tr5LoMh.mjs +0 -26
package/dist/index.js CHANGED
@@ -833,7 +833,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
833
833
  return EventCategory;
834
834
  }({});
835
835
  //#endregion
836
- //#region ../types/dist/composed-stable-id-jnvhwGoH.mjs
836
+ //#region ../types/dist/composed-stable-id-DFNyOFzz.mjs
837
837
  /**
838
838
  import { errMsg } from '@camstack/types'
839
839
  * Extract a human-readable message from an unknown error value.
@@ -846,6 +846,7 @@ function errMsg$2(err) {
846
846
  }
847
847
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
848
848
  DeviceType["Camera"] = "camera";
849
+ /** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
849
850
  DeviceType["Hub"] = "hub";
850
851
  DeviceType["Light"] = "light";
851
852
  DeviceType["Siren"] = "siren";
@@ -6057,7 +6058,7 @@ var ZodIssueCode = {
6057
6058
  var ZodFirstPartyTypeKind;
6058
6059
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6059
6060
  //#endregion
6060
- //#region ../types/dist/sleep-Cw1uUXvl.mjs
6061
+ //#region ../types/dist/sleep-D_NpiLFP.mjs
6061
6062
  /**
6062
6063
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6063
6064
  * window to float samples (D455).
@@ -13819,10 +13820,6 @@ var CAMERA_CAP_VOCABULARY = {
13819
13820
  scope: "device",
13820
13821
  noun: t("Admin link", "Link di amministrazione")
13821
13822
  },
13822
- "device-discovery": {
13823
- scope: "device",
13824
- noun: t("Discovery", "Rilevamento dispositivi")
13825
- },
13826
13823
  "device-extension": {
13827
13824
  scope: "device",
13828
13825
  noun: t("Device extension", "Estensione del dispositivo")
@@ -15392,7 +15389,6 @@ var CAP_NAMES = Object.freeze([
15392
15389
  "device-admin-link",
15393
15390
  "device-adoption",
15394
15391
  "device-credentials",
15395
- "device-discovery",
15396
15392
  "device-export",
15397
15393
  "device-extension",
15398
15394
  "device-history",
@@ -16014,13 +16010,6 @@ Object.freeze({
16014
16010
  "valueType": "string"
16015
16011
  }
16016
16012
  ],
16017
- "device-discovery": [{
16018
- "path": "lastDiscoveryAt",
16019
- "valueType": "number"
16020
- }, {
16021
- "path": "lastError",
16022
- "valueType": "string"
16023
- }],
16024
16013
  "device-export": [
16025
16014
  {
16026
16015
  "path": "linkState",
@@ -17496,7 +17485,7 @@ function sleep(ms) {
17496
17485
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
17497
17486
  }
17498
17487
  //#endregion
17499
- //#region ../types/dist/implemented-methods-OitwyO1Y.mjs
17488
+ //#region ../types/dist/implemented-methods-M5aguGon.mjs
17500
17489
  /**
17501
17490
  * The ffmpeg build every CamStack node downloads, per platform and arch.
17502
17491
  *
@@ -44353,6 +44342,62 @@ var WeekdayKeySchema = _enum([
44353
44342
  "sat",
44354
44343
  "sun"
44355
44344
  ]);
44345
+ /**
44346
+ * Hold semantics — "for N seconds" on a leaf of the `when` tree (#498).
44347
+ *
44348
+ * ONE primitive, `for: { ms, mode, tolerance? }`, shared by `device-becomes`,
44349
+ * `device-is` and `expression`:
44350
+ *
44351
+ * - `held`: the condition stays true for `ms`;
44352
+ * - `stable`: the value does not move by more than `tolerance` (absolute, in
44353
+ * the field's base unit) for `ms` while the condition holds.
44354
+ *
44355
+ * {@link HoldCore} is the pure state machine (an input observation → a reading).
44356
+ * {@link HoldTracker} keys cores by a leaf path for the STATE leaves the tree
44357
+ * evaluator judges. {@link BecomesWatch} wraps a core with a timer for the
44358
+ * `device-becomes` EVENT leaf: the deadline is armed when the hold starts and
44359
+ * cancelled when it breaks, and the leaf fires ONCE per episode.
44360
+ *
44361
+ * Hold state is memory only. A hold that is already running when the watcher
44362
+ * first looks (a restart) is INHERITED: nobody knows when it began, so it never
44363
+ * fires for that episode and a state leaf reads it as unknown until the window
44364
+ * has elapsed from the moment the watcher started (D49: not-known is not false).
44365
+ */
44366
+ var HOLD_MAX_MS = 864e5;
44367
+ var HoldModeSchema = _enum(["held", "stable"]);
44368
+ var HoldSpecSchema = object({
44369
+ /** How long the condition (or the value) must hold. */
44370
+ ms: number$1().int().min(1).max(HOLD_MAX_MS),
44371
+ mode: HoldModeSchema,
44372
+ /** `stable` only: the largest move of the value that still counts as unchanged (absolute, base unit). */
44373
+ tolerance: number$1().min(0).optional()
44374
+ });
44375
+ /** What a trace says about a hold. */
44376
+ var HoldTraceSchema = object({
44377
+ phase: _enum([
44378
+ "pending",
44379
+ "cancelled",
44380
+ "fired",
44381
+ "reseeded"
44382
+ ]),
44383
+ ms: number$1().int(),
44384
+ mode: HoldModeSchema,
44385
+ /** When the hold started (ms epoch). */
44386
+ since: number$1().optional(),
44387
+ /** When it completes (ms epoch), for a pending hold. */
44388
+ deadline: number$1().optional()
44389
+ });
44390
+ /** The operators a `device-becomes` leaf may carry: a threshold or a range. */
44391
+ var BecomesOperatorSchema = _enum([
44392
+ "eq",
44393
+ "ne",
44394
+ "gt",
44395
+ "gte",
44396
+ "lt",
44397
+ "lte",
44398
+ "between",
44399
+ "outside"
44400
+ ]);
44356
44401
  /** How a state leaf compares a device field to a value. Derived from the
44357
44402
  * field's `kind` in `deviceManager.getWireableFields`, never hand-maintained. */
44358
44403
  var AutomationConditionOperatorSchema = _enum([
@@ -44376,18 +44421,52 @@ var DeviceBecomesLeafSchema = object({
44376
44421
  deviceId: number$1().int().nonnegative(),
44377
44422
  cap: string().min(1),
44378
44423
  fieldPath: string().min(1),
44379
- /** Fire when the field takes this value. Omit to fire on any change. */
44424
+ /** Fire when the field takes this value. Omit (with no `operator`) to fire on any change. */
44380
44425
  becomes: union([
44381
44426
  string(),
44382
44427
  number$1(),
44383
44428
  boolean()
44384
44429
  ]).optional(),
44385
- /** Only on a CHANGE of value, not on every re-report. */
44430
+ /**
44431
+ * A threshold or a range instead of an equality: "crosses above 3000", "enters
44432
+ * 18..24". The leaf fires on the TRANSITION into the predicate, never on a re-report.
44433
+ * `value` is in the field's base unit; `between` / `outside` take `[low, high]`.
44434
+ */
44435
+ operator: BecomesOperatorSchema.optional(),
44436
+ value: union([
44437
+ number$1(),
44438
+ string(),
44439
+ boolean(),
44440
+ array(number$1()).length(2)
44441
+ ]).optional(),
44442
+ /**
44443
+ * Hold: the transition (or, with no predicate, the new value) must stay for
44444
+ * `for.ms` before the leaf fires, ONCE per episode. See `hold.ts`.
44445
+ */
44446
+ for: HoldSpecSchema.optional(),
44447
+ /** @deprecated every leaf fires on a transition now; read as always on. */
44386
44448
  edge: boolean().optional(),
44387
- /** The new value must hold this long before it counts. */
44388
- forMs: number$1().int().min(0).max(864e5).optional(),
44449
+ /** @deprecated legacy `held` window — read through `holdOf` as `for: { ms, mode: 'held' }`. */
44450
+ forMs: number$1().int().min(0).max(HOLD_MAX_MS).optional(),
44389
44451
  /** Collapse a burst into one occurrence. */
44390
44452
  debounceMs: number$1().int().min(0).max(6e5).optional()
44453
+ }).superRefine((leaf, ctx) => {
44454
+ if (leaf.becomes !== void 0 && leaf.operator !== void 0) ctx.addIssue({
44455
+ code: "custom",
44456
+ message: "a leaf names `becomes` or `operator`, not both",
44457
+ path: ["operator"]
44458
+ });
44459
+ if (leaf.operator !== void 0 && leaf.value === void 0) ctx.addIssue({
44460
+ code: "custom",
44461
+ message: "an operator needs the value to compare to",
44462
+ path: ["value"]
44463
+ });
44464
+ const range = leaf.operator === "between" || leaf.operator === "outside";
44465
+ if (leaf.operator !== void 0 && range !== Array.isArray(leaf.value)) ctx.addIssue({
44466
+ code: "custom",
44467
+ message: range ? "a range takes [low, high]" : "only a range takes [low, high]",
44468
+ path: ["value"]
44469
+ });
44391
44470
  });
44392
44471
  var DeviceEventLeafSchema = object({
44393
44472
  kind: literal("device-event"),
@@ -44452,7 +44531,9 @@ var DeviceIsLeafSchema = object({
44452
44531
  QuantityValueSchema
44453
44532
  ]),
44454
44533
  /** The unit the person picked for `value` (display only; `value` is in the base unit). */
44455
- unit: string().min(1).optional()
44534
+ unit: string().min(1).optional(),
44535
+ /** The comparison must hold (`held`) or the value stay put (`stable`) this long. */
44536
+ for: HoldSpecSchema.optional()
44456
44537
  });
44457
44538
  /**
44458
44539
  * True when the camera currently has a PARKED object matching `subjects` in at
@@ -44475,7 +44556,9 @@ var StationaryPresentLeafSchema = object({
44475
44556
  var ExpressionLeafSchema = object({
44476
44557
  kind: literal("expression"),
44477
44558
  expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
44478
- bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), ExpressionBindingSourceSchema)
44559
+ bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), ExpressionBindingSourceSchema),
44560
+ /** The expression must stay true this long. An expression has no single value, so only `held`. */
44561
+ for: HoldSpecSchema.optional()
44479
44562
  }).superRefine((src, ctx) => {
44480
44563
  const err = validateExpressionSource(src);
44481
44564
  if (err !== null) ctx.addIssue({
@@ -44483,6 +44566,11 @@ var ExpressionLeafSchema = object({
44483
44566
  message: err,
44484
44567
  path: ["expr"]
44485
44568
  });
44569
+ if (src.for?.mode === "stable") ctx.addIssue({
44570
+ code: "custom",
44571
+ message: "an expression is held, not stable: it has no single value to keep still",
44572
+ path: ["for", "mode"]
44573
+ });
44486
44574
  });
44487
44575
  var AutomationWhenSchema = lazy(() => discriminatedUnion("kind", [
44488
44576
  object({
@@ -45242,7 +45330,9 @@ var AutomationTriggerTraceSchema = object({
45242
45330
  /** Why an event was rejected ("class person not in [dog]") or what fired. */
45243
45331
  reason: string(),
45244
45332
  /** deviceId, className, trackId, score … — only what the trigger exposes. */
45245
- vars: record(string(), TraceValueSchema)
45333
+ vars: record(string(), TraceValueSchema),
45334
+ /** A hold (`for`) this occurrence went through: pending, cancelled, fired or re-seeded. */
45335
+ hold: HoldTraceSchema.optional()
45246
45336
  });
45247
45337
  var AutomationConditionTraceNodeSchema = object({
45248
45338
  /** `when` for the root, `when.<i>` for its i-th child, … (`conditions…` on an old trace). */
@@ -45588,7 +45678,7 @@ object({
45588
45678
  * is irrelevant; the array is treated as a set by consumers. */
45589
45679
  hiddenChildIds: array(number$1()).readonly()
45590
45680
  });
45591
- DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Light, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Cover, DeviceType.Lock, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Generic, method(object({
45681
+ DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Cover, DeviceType.Lock, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Generic, method(object({
45592
45682
  deviceId: number$1().int().nonnegative(),
45593
45683
  childDeviceId: number$1().int().nonnegative(),
45594
45684
  hidden: boolean()
@@ -50283,7 +50373,7 @@ DeviceType.MediaPlayer, optionalMethod(deviceOnly, _void(), {
50283
50373
  kind: "mutation",
50284
50374
  auth: "protected"
50285
50375
  });
50286
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
50376
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
50287
50377
  var NUMBER = {
50288
50378
  kind: "fixed",
50289
50379
  result: ["number"]
@@ -51676,27 +51766,35 @@ var DeviceAdminLinkSchema = object({
51676
51766
  });
51677
51767
  method(object({ deviceId: number$1().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" });
51678
51768
  /**
51679
- * device-discovery — device-scoped capability for parents that host /
51680
- * enumerate child devices (Reolink Hub / NVR, ONVIF gateway, future
51681
- * integrations). The parent advertises a list of discoverable children,
51682
- * and the operator promotes a subset to real devices via `adoptDevice`.
51683
- * Child lifecycle (kernel device create/remove, parent reference) is
51684
- * owned by the framework so a single shared `<DiscoveryPanel />` can
51685
- * drive any integration.
51686
- *
51687
- * Boundaries:
51688
- * - The cap exposes ENUMERATION + ADOPT/RELEASE only. The protocol
51689
- * used to discover children (CGI poll, mDNS, push from hub, ...)
51690
- * is the integration's business; results land in `runtimeState`
51691
- * so the panel can render without a fresh round-trip.
51692
- * - `childNativeId` is integration-defined and must be stable across
51693
- * reboots so re-discovery doesn't duplicate adopted children.
51694
- * - `adoptDevice` returns the new `deviceId` so the UI can navigate
51695
- * directly to the freshly-created child's settings page.
51696
- */
51697
- /**
51698
- * Status enum for a discovered device. Mirrors the Reolink simpleEvent
51699
- * lifecycle (`online` / `sleeping` / `offline`) — generic enough for
51769
+ * `device-adoption` — generic discovery + adoption surface,
51770
+ * system-scoped collection (one provider per integration addon), routed
51771
+ * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
51772
+ * pin model as `connection-test`. The admin UI keeps using
51773
+ * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
51774
+ * successor to `ha-discovery`:
51775
+ * keyed by `integrationId` (the addon resolves integrationId → broker
51776
+ * internally) rather than a connection-specific `brokerId`, and it
51777
+ * OWNS the shared `DiscoveredChildDevice` candidate type
51778
+ * (declared below) so a single shared adoption modal renders any integration's
51779
+ * candidate tree.
51780
+ *
51781
+ * UI flow (Integrations page → integration detail):
51782
+ * 1. `listCandidates({integrationId, page, pageSize, filter})` →
51783
+ * paginated candidate list, each row collapsed.
51784
+ * 2. User expands a row → `getCandidate({integrationId,
51785
+ * childNativeId})` returns the single candidate (with its nested
51786
+ * `children`) for the accordion render.
51787
+ * 3. User clicks "Adopt" on one or more candidates →
51788
+ * `adopt({integrationId, childNativeIds, perCandidate?})`
51789
+ * materialises one parent CamStack device per candidate plus its
51790
+ * accessory children. `perCandidate[childNativeId]` carries an
51791
+ * optional display-name override + a `hiddenChildIds` pre-hide set
51792
+ * (the parent's `accessories.hiddenChildIds` gates UI visibility).
51793
+ * 4. User clicks "Release" → `release({integrationId, camDeviceId})`
51794
+ * removes the parent + every child from the kernel registry.
51795
+ */
51796
+ /**
51797
+ * Status enum for a discovered device. Generic enough for
51700
51798
  * battery cams, awake cams, and unreachable cams alike.
51701
51799
  */
51702
51800
  var DiscoveredChildStatusSchema = _enum([
@@ -51713,12 +51811,12 @@ var DiscoveredChildDeviceSchema = lazy(() => object({
51713
51811
  /** DeviceType the child should be created with on adopt. */
51714
51812
  type: _enum(DeviceType),
51715
51813
  status: DiscoveredChildStatusSchema,
51716
- /** Free-form integration-specific metadata surfaced in the panel. */
51814
+ /** Free-form integration-specific metadata surfaced in the adoption modal. */
51717
51815
  metadata: object({
51718
51816
  model: string().optional(),
51719
51817
  serialNumber: string().optional(),
51720
51818
  uid: string().optional(),
51721
- /** Reolink: 0-based channel index inside the parent NVR/Hub. */
51819
+ /** Reolink: 0-based channel index inside the parent NVR. */
51722
51820
  rtspChannel: number$1().int().nonnegative().optional(),
51723
51821
  isBattery: boolean().optional(),
51724
51822
  isDoorbell: boolean().optional(),
@@ -51734,86 +51832,24 @@ var DiscoveredChildDeviceSchema = lazy(() => object({
51734
51832
  }).default({}),
51735
51833
  /**
51736
51834
  * `true` when the framework already created a child device for this
51737
- * `childNativeId` under the current parent. The panel uses it to
51835
+ * `childNativeId` under the current parent. The adoption modal uses it to
51738
51836
  * gate the Add/Remove button and surface the existing `deviceId`.
51739
51837
  */
51740
51838
  alreadyAdopted: boolean(),
51741
51839
  /** When `alreadyAdopted=true`, the framework-assigned child device id. */
51742
51840
  adoptedDeviceId: number$1().int().nonnegative().nullable(),
51743
- /** Capability names the candidate advertises — integrations populate, Hubs omit. */
51841
+ /** Capability names the candidate advertises — integrations populate, flat enumerations omit. */
51744
51842
  capabilities: array(string()).readonly().optional(),
51745
- /** Feature flags the candidate advertises — integrations populate, Hubs omit. */
51843
+ /** Feature flags the candidate advertises — integrations populate, flat enumerations omit. */
51746
51844
  features: array(string()).readonly().optional(),
51747
51845
  /** Upstream-system identity + rendering hints for the candidate. */
51748
51846
  sourceInfo: SourceInfoSchema.optional(),
51749
- /** Nested entity-children for accordion preview — integrations populate, Hubs omit. */
51847
+ /** Nested entity-children for accordion preview — integrations populate, flat enumerations omit. */
51750
51848
  children: array(DiscoveredChildDeviceSchema).readonly().optional(),
51751
51849
  /** `childNativeId` of the gateway candidate in the same list this device sits behind. */
51752
51850
  parentStableId: string().optional()
51753
51851
  }));
51754
51852
  /**
51755
- * Status block — populated by the integration after each
51756
- * `refreshDiscovery` (or push-driven update). The runtime-state slice
51757
- * is what the panel reads via the per-device proxy; `getStatus`
51758
- * returns the same payload via the codegen'd auto-injection.
51759
- */
51760
- var DeviceDiscoveryStatusSchema = object({
51761
- discovered: array(DiscoveredChildDeviceSchema),
51762
- /** Wall-clock ms of the last successful enumeration. */
51763
- lastDiscoveryAt: number$1().int().nonnegative().nullable(),
51764
- /** Last error surfaced from the source (rendered as a banner). */
51765
- lastError: string().nullable()
51766
- });
51767
- DeviceType.Hub, DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number$1().int().nonnegative() }), method(object({ deviceId: number$1().int().nonnegative() }), array(DiscoveredChildDeviceSchema).readonly()), method(object({ deviceId: number$1().int().nonnegative() }), array(DiscoveredChildDeviceSchema).readonly(), {
51768
- kind: "mutation",
51769
- auth: "admin"
51770
- }), method(object({
51771
- deviceId: number$1().int().nonnegative(),
51772
- childNativeId: string(),
51773
- /** Optional override for the child's display name. */
51774
- name: string().optional()
51775
- }), object({
51776
- deviceId: number$1().int().nonnegative(),
51777
- stableId: string()
51778
- }), {
51779
- kind: "mutation",
51780
- auth: "admin"
51781
- }), method(object({
51782
- deviceId: number$1().int().nonnegative(),
51783
- childDeviceId: number$1().int().nonnegative()
51784
- }), _void(), {
51785
- kind: "mutation",
51786
- auth: "admin"
51787
- });
51788
- /**
51789
- * `device-adoption` — generic discovery + adoption surface,
51790
- * system-scoped collection (one provider per integration addon), routed
51791
- * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
51792
- * pin model as `connection-test`. The admin UI keeps using
51793
- * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
51794
- * successor to `ha-discovery`:
51795
- * keyed by `integrationId` (the addon resolves integrationId → broker
51796
- * internally) rather than a connection-specific `brokerId`, and it
51797
- * REUSES the shared `DiscoveredChildDevice` candidate type from
51798
- * `device-discovery.cap.ts` so a single shared adoption panel renders
51799
- * any integration's candidate tree.
51800
- *
51801
- * UI flow (Integrations page → integration detail):
51802
- * 1. `listCandidates({integrationId, page, pageSize, filter})` →
51803
- * paginated candidate list, each row collapsed.
51804
- * 2. User expands a row → `getCandidate({integrationId,
51805
- * childNativeId})` returns the single candidate (with its nested
51806
- * `children`) for the accordion render.
51807
- * 3. User clicks "Adopt" on one or more candidates →
51808
- * `adopt({integrationId, childNativeIds, perCandidate?})`
51809
- * materialises one parent CamStack device per candidate plus its
51810
- * accessory children. `perCandidate[childNativeId]` carries an
51811
- * optional display-name override + a `hiddenChildIds` pre-hide set
51812
- * (the parent's `accessories.hiddenChildIds` gates UI visibility).
51813
- * 4. User clicks "Release" → `release({integrationId, camDeviceId})`
51814
- * removes the parent + every child from the kernel registry.
51815
- */
51816
- /**
51817
51853
  * Provider-declared discovery *granularity* filter (the keystone of the
51818
51854
  * single-entity-import design). A provider advertises which discovery
51819
51855
  * granularities it supports via `listCandidateFilters`; the operator picks
@@ -72937,7 +72973,7 @@ object({
72937
72973
  offSeconds: number$1().int(),
72938
72974
  lastFetchedAt: number$1()
72939
72975
  });
72940
- DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
72976
+ DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
72941
72977
  var deviceInput$1 = object({ deviceId: number$1().int().nonnegative() });
72942
72978
  systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "protected" }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
72943
72979
  kind: "mutation",
@@ -85548,41 +85584,6 @@ Object.freeze({
85548
85584
  access: "create",
85549
85585
  role: "admin"
85550
85586
  },
85551
- "deviceDiscovery.adoptDevice": {
85552
- capName: "device-discovery",
85553
- capScope: "device",
85554
- addonId: null,
85555
- access: "create",
85556
- role: "admin"
85557
- },
85558
- "deviceDiscovery.getStatus": {
85559
- capName: "device-discovery",
85560
- capScope: "device",
85561
- addonId: null,
85562
- access: "view",
85563
- role: "viewer"
85564
- },
85565
- "deviceDiscovery.listDiscovered": {
85566
- capName: "device-discovery",
85567
- capScope: "device",
85568
- addonId: null,
85569
- access: "view",
85570
- role: "viewer"
85571
- },
85572
- "deviceDiscovery.refreshDiscovery": {
85573
- capName: "device-discovery",
85574
- capScope: "device",
85575
- addonId: null,
85576
- access: "create",
85577
- role: "admin"
85578
- },
85579
- "deviceDiscovery.releaseDevice": {
85580
- capName: "device-discovery",
85581
- capScope: "device",
85582
- addonId: null,
85583
- access: "create",
85584
- role: "admin"
85585
- },
85586
85587
  "deviceExport.applyDeviceSettingsPatch": {
85587
85588
  capName: "device-export",
85588
85589
  capScope: "system",
@@ -94668,35 +94669,6 @@ Object.freeze({
94668
94669
  form: "single",
94669
94670
  optional: false
94670
94671
  }],
94671
- "deviceDiscovery.adoptDevice": [{
94672
- name: "deviceId",
94673
- form: "single",
94674
- optional: false
94675
- }],
94676
- "deviceDiscovery.getStatus": [{
94677
- name: "deviceId",
94678
- form: "single",
94679
- optional: false
94680
- }],
94681
- "deviceDiscovery.listDiscovered": [{
94682
- name: "deviceId",
94683
- form: "single",
94684
- optional: false
94685
- }],
94686
- "deviceDiscovery.refreshDiscovery": [{
94687
- name: "deviceId",
94688
- form: "single",
94689
- optional: false
94690
- }],
94691
- "deviceDiscovery.releaseDevice": [{
94692
- name: "childDeviceId",
94693
- form: "single",
94694
- optional: false
94695
- }, {
94696
- name: "deviceId",
94697
- form: "single",
94698
- optional: false
94699
- }],
94700
94672
  "deviceExport.applyDeviceSettingsPatch": [{
94701
94673
  name: "deviceId",
94702
94674
  form: "single",
@@ -100080,8 +100052,8 @@ async function readRawKeys(read, addonId, keys) {
100080
100052
  * `<addonId>:<deviceId>.cameraSettings` in `addon-device-settings`.
100081
100053
  *
100082
100054
  * Each entry is copied VERBATIM (the value of a row is the entry the map held), so a field the
100083
- * schema does not know yet survives byte for byte. The map key stays for a release (the purge is
100084
- * `retired-settings-keys.ts`, one release later), so a rolled-back build still reads it.
100055
+ * schema does not know yet survives byte for byte. The mover leaves the map key in place; the
100056
+ * catalogue's last step (`drop-moved-maps`) deletes it once all three movers are applied.
100085
100057
  *
100086
100058
  * A row that already exists is never overwritten: it was written by the build that reads rows,
100087
100059
  * and a seed never overwrites. A plan that has nothing left to copy is empty, so a second run is
@@ -100174,7 +100146,8 @@ var DROP_BINDINGS_MIGRATION_FLAG_ID = "pipeline-orchestrator/2026-11-03-drop-bin
100174
100146
  var NODE_BINDINGS_TO_NODE_ROWS_ID = "pipeline-orchestrator/2026-11-03-node-bindings-to-node-rows";
100175
100147
  var AGENT_SETTINGS_TO_NODE_ROWS_ID = "pipeline-orchestrator/2026-11-03-agent-settings-to-node-rows";
100176
100148
  var CAMERA_SETTINGS_TO_DEVICE_ROWS_ID = "pipeline-orchestrator/2026-11-03-camera-settings-to-device-rows";
100177
- /** The three id-keyed maps this version stopped reading; their keys stay one release. */
100149
+ var DROP_MOVED_MAPS_ID = "pipeline-orchestrator/2026-11-11-drop-moved-maps";
100150
+ /** The three id-keyed maps the movers copied into rows; nothing reads them. */
100178
100151
  var NODE_BINDINGS_FIELD = "nodeBindings";
100179
100152
  var AGENT_SETTINGS_FIELD = "agentSettings";
100180
100153
  var CAMERA_SETTINGS_FIELD = "cameraSettings";
@@ -100256,6 +100229,30 @@ var ADDON_MIGRATIONS = [
100256
100229
  fixtureMark: "a step toggle and a step setting of one camera"
100257
100230
  },
100258
100231
  plan: (ports) => planBlobToDeviceRows(PIPELINE_ORCHESTRATOR_ID, CAMERA_SETTINGS_FIELD, ports)
100232
+ },
100233
+ {
100234
+ meta: {
100235
+ id: DROP_MOVED_MAPS_ID,
100236
+ owner: PIPELINE_ORCHESTRATOR_ID,
100237
+ level: "addon-state",
100238
+ seq: 5,
100239
+ dependsOn: [
100240
+ NODE_BINDINGS_TO_NODE_ROWS_ID,
100241
+ AGENT_SETTINGS_TO_NODE_ROWS_ID,
100242
+ CAMERA_SETTINGS_TO_DEVICE_ROWS_ID
100243
+ ],
100244
+ store: "settings",
100245
+ scope: "cluster",
100246
+ onFailure: "tolerate",
100247
+ bodyKind: "plan",
100248
+ description: "Delete the nodeBindings, agentSettings and cameraSettings maps once their rows are written",
100249
+ fixtureMark: "a marked field of each map, read back from the row its mover wrote"
100250
+ },
100251
+ plan: (ports) => planDropKeys(PIPELINE_ORCHESTRATOR_ID, [
100252
+ NODE_BINDINGS_FIELD,
100253
+ AGENT_SETTINGS_FIELD,
100254
+ CAMERA_SETTINGS_FIELD
100255
+ ], ports)
100259
100256
  }
100260
100257
  ];
100261
100258
  var orchestratorRecordKinds = defineRecordKinds({