@camstack/addon-osd-manager 0.1.142 → 0.1.143

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 (18) hide show
  1. package/dist/{MotionZonesSettings-CLoGx9rM.mjs → MotionZonesSettings-D_u2HAV8.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BZiL6_bt.mjs → PrivacyMaskSettings-BWo2Poz3.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-C4XOkOxm.mjs → SceneMonitorEditor-lkaFmEgy.mjs} +3 -3
  4. package/dist/_stub.js +137 -137
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BA2LcfhK.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BNPWHRDn.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Bj2dTNd0.mjs +26 -0
  7. package/dist/{hostInit-BXqW88VO.mjs → hostInit-aLPXTY6c.mjs} +2 -2
  8. package/dist/index.js +532 -26
  9. package/dist/index.mjs +532 -26
  10. package/dist/{player-overlays-QdIhVJJ9.mjs → player-overlays-BLFv1a4b.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-BaAG2IvP.mjs → responsive-CRQJLpxM.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-DViLoo13.mjs → scene-monitor-copy-Uvp-WnB0.mjs} +1 -1
  14. package/dist/{square-DwPV8oay.mjs → square-UutiR2vl.mjs} +1 -1
  15. package/dist/{trash-2-C1AFBh3V.mjs → trash-2-CQR67Ytv.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-J30N4Tun.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-DqdShEJ5.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CWTKCd56.mjs +0 -26
package/dist/index.js CHANGED
@@ -9662,6 +9662,48 @@ var ModelProviderIdSchema = _enum([
9662
9662
  "scrypted",
9663
9663
  "custom"
9664
9664
  ]);
9665
+ /**
9666
+ * The licence of a model, as a record rather than a bare SPDX string: a
9667
+ * permissive CODE licence routinely sits on top of restrictive WEIGHTS or
9668
+ * DATA, and the obligations (attribution, modification notices, source offers)
9669
+ * are per upstream. A persisted custom-model row written when this field was a
9670
+ * string still parses — the string is lifted into `{ weights }`.
9671
+ *
9672
+ * Every licence surface (the admin "Models and licenses" page,
9673
+ * `THIRD_PARTY_MODELS.md`, the Hugging Face model table) is GENERATED from
9674
+ * these records by `scripts/gen-model-licenses.ts` (D661).
9675
+ */
9676
+ var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { weights: value } : value, object({
9677
+ /** SPDX id of the WEIGHTS' terms, a `LicenseRef-*` for non-SPDX terms, or `UNKNOWN`. */
9678
+ weights: string().min(1),
9679
+ /** SPDX id of the upstream code that defines / trained the network. */
9680
+ code: string().min(1).optional(),
9681
+ /** Training data whose terms add obligations (attribution, non-commercial). */
9682
+ data: object({
9683
+ name: string().min(1),
9684
+ terms: string().min(1),
9685
+ url: string().url().optional()
9686
+ }).optional(),
9687
+ /** The project the weights come from. Required on built-in entries (guard). */
9688
+ upstream: object({
9689
+ name: string().min(1),
9690
+ url: string().url()
9691
+ }).optional(),
9692
+ /** Where the licence text governing the weights is published. */
9693
+ url: string().url().optional(),
9694
+ /** Attribution the licence REQUIRES, verbatim. */
9695
+ attribution: string().min(1).optional(),
9696
+ /** What CamStack changed. Required when `hosting` is `camstack-hf` (guard). */
9697
+ modifications: string().min(1).optional(),
9698
+ /** Who serves the file a node downloads. */
9699
+ hosting: _enum([
9700
+ "camstack-hf",
9701
+ "third-party",
9702
+ "built-in"
9703
+ ]).optional(),
9704
+ /** True when the weights or their data forbid commercial use. */
9705
+ nonCommercial: boolean().optional()
9706
+ }));
9665
9707
  var ModelCatalogEntrySchema = object({
9666
9708
  id: string(),
9667
9709
  name: string(),
@@ -9750,11 +9792,11 @@ var ModelCatalogEntrySchema = object({
9750
9792
  p95LatencyMs: record(string(), number()).optional()
9751
9793
  }).optional(),
9752
9794
  /**
9753
- * SPDX-ish license id of the model weights (e.g. `AGPL-3.0` for Ultralytics
9754
- * YOLO26, `GPL-3.0` for YOLOv9, `Apache-2.0` for D-FINE/RF-DETR). Matters for
9755
- * the retraining addon and any future commercial distribution.
9795
+ * The model's licence record — see {@link ModelLicenseSchema}. Optional in
9796
+ * the schema (a custom model's author may state none); REQUIRED and complete
9797
+ * on every built-in catalog entry (`scripts/check-catalog-licence.ts`).
9756
9798
  */
9757
- license: string().optional(),
9799
+ license: ModelLicenseSchema.optional(),
9758
9800
  /**
9759
9801
  * Variant-selector grouping. The UI groups models by `family` + `tier` and
9760
9802
  * offers `precision` / `optimization` as variant axes WITHIN a tier — so all
@@ -9849,23 +9891,6 @@ var ExpressionEvalError = class extends Error {
9849
9891
  this.name = "ExpressionEvalError";
9850
9892
  }
9851
9893
  };
9852
- /**
9853
- * Frozen, null-prototype builtin function table for the expression engine
9854
- * (spec §4 rule 4). The table is the SOLE surface of callable functions: the
9855
- * parser rejects any callee not in it, and the evaluator gates each call on an
9856
- * own-property check against it.
9857
- *
9858
- * Because the object has a NULL prototype AND is `Object.freeze`d:
9859
- * - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
9860
- * - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
9861
- * (there is no `Object.prototype` in the chain), so those names are not
9862
- * callable — they are simply "unknown function" at parse time.
9863
- *
9864
- * Every numeric argument is validated as a finite number and every numeric
9865
- * RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
9866
- * (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
9867
- * closed rather than emitting a garbage value.
9868
- */
9869
9894
  function asFiniteNumber(value, name, index) {
9870
9895
  if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
9871
9896
  return value;
@@ -9881,6 +9906,10 @@ function finiteResult(value, name) {
9881
9906
  function allFiniteNumbers(args, name) {
9882
9907
  return args.map((a, idx) => asFiniteNumber(a, name, idx));
9883
9908
  }
9909
+ function asBoolean$1(value, name, index) {
9910
+ if (typeof value !== "boolean") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a boolean`);
9911
+ return value;
9912
+ }
9884
9913
  var INF = Number.POSITIVE_INFINITY;
9885
9914
  var table = {
9886
9915
  min: {
@@ -9981,6 +10010,40 @@ var table = {
9981
10010
  if (from === to) return x;
9982
10011
  throw new ExpressionEvalError("convert: unit conversion table not installed");
9983
10012
  }
10013
+ },
10014
+ any: {
10015
+ minArgs: 1,
10016
+ maxArgs: INF,
10017
+ apply: (args) => args.map((a, i) => asBoolean$1(a, "any", i)).some((b) => b)
10018
+ },
10019
+ all: {
10020
+ minArgs: 1,
10021
+ maxArgs: INF,
10022
+ apply: (args) => args.map((a, i) => asBoolean$1(a, "all", i)).every((b) => b)
10023
+ },
10024
+ within: {
10025
+ minArgs: 2,
10026
+ maxArgs: 2,
10027
+ apply: (args, hooks) => {
10028
+ const windowMs = asFiniteNumber(args[1], "within", 1);
10029
+ if (windowMs < 0) throw new ExpressionEvalError("within: the window must not be negative");
10030
+ const at = args[0];
10031
+ if (at === null) return false;
10032
+ const ts = asFiniteNumber(at, "within", 0);
10033
+ const now = hooks.now;
10034
+ if (now === void 0 || !Number.isFinite(now)) throw new ExpressionEvalError("within: no clock was supplied to this evaluation");
10035
+ const inside = now - ts <= windowMs;
10036
+ if (inside) hooks.noteDeadline?.(ts + windowMs + 1);
10037
+ return inside;
10038
+ }
10039
+ },
10040
+ latest: {
10041
+ minArgs: 1,
10042
+ maxArgs: INF,
10043
+ apply: (args) => {
10044
+ const present = args.flatMap((a, i) => a === null ? [] : [asFiniteNumber(a, "latest", i)]);
10045
+ return present.length === 0 ? null : finiteResult(Math.max(...present), "latest");
10046
+ }
9984
10047
  }
9985
10048
  };
9986
10049
  Object.freeze(Object.assign(Object.create(null), table));
@@ -10595,7 +10658,7 @@ var AutomationActionSchema = discriminatedUnion("kind", [
10595
10658
  code: string().min(1).max(2e4)
10596
10659
  })
10597
10660
  ]);
10598
- object({
10661
+ var AutomationRecipeSchema = object({
10599
10662
  triggers: array(AutomationTriggerSchema),
10600
10663
  conditions: AutomationConditionSchema.optional(),
10601
10664
  actions: array(AutomationActionSchema)
@@ -11212,12 +11275,32 @@ var AudioClassificationLabelSchema = object({
11212
11275
  originalClass: string().optional(),
11213
11276
  score: number()
11214
11277
  });
11278
+ /**
11279
+ * Did the classifier RUN on this window? (D660)
11280
+ *
11281
+ * `classified` with no labels means the model heard nothing above the
11282
+ * camera's floor. `not-classified` means nobody listened — and until D660 the
11283
+ * two were the same shape (`classification` absent), so a window the global
11284
+ * busy gate threw away read downstream exactly like a quiet one (D393).
11285
+ */
11286
+ var AudioClassifyOutcomeSchema = discriminatedUnion("state", [object({ state: literal("classified") }), object({
11287
+ state: literal("not-classified"),
11288
+ reason: _enum([
11289
+ "superseded",
11290
+ "error",
11291
+ "timeout",
11292
+ "disposed"
11293
+ ])
11294
+ })]);
11215
11295
  var AudioAnalysisResultSchema = object({
11216
11296
  level: AudioLevelSchema,
11297
+ /** Labels at or above the camera's floor. Absent = none — read `classifyOutcome` to know whether the model ran at all. */
11217
11298
  classification: object({
11218
11299
  labels: array(AudioClassificationLabelSchema).readonly(),
11219
11300
  inferenceMs: number()
11220
11301
  }).optional(),
11302
+ /** Whether the classifier ran on this window (D660). */
11303
+ classifyOutcome: AudioClassifyOutcomeSchema,
11221
11304
  timestamp: number()
11222
11305
  });
11223
11306
  var AudioAnalysisSettingsSchema = object({
@@ -13402,6 +13485,195 @@ var cameraStreamsCapability = {
13402
13485
  */
13403
13486
  durability: "session"
13404
13487
  };
13488
+ /** A composed device's stableId is this prefix plus the block id. */
13489
+ var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
13490
+ /** Longest snippet a `code` source may carry (slice 4). */
13491
+ var MAX_COMPOSITION_CODE_LENGTH = 2e4;
13492
+ var CompositionSourceRefSchema = object({
13493
+ /** The owning addon; `stableId` is unique only within it. */
13494
+ addonId: string().min(1),
13495
+ stableId: string().min(1)
13496
+ });
13497
+ /** One field of one capability of one source device. */
13498
+ var CompositionFieldReadSchema = object({
13499
+ source: CompositionSourceRefSchema,
13500
+ cap: string().min(1),
13501
+ /** Dotted path into the source cap's runtime-state slice. */
13502
+ fieldPath: string().min(1)
13503
+ });
13504
+ /** `from`: copy one source field verbatim. It is also an expression's `from` binding. */
13505
+ var CompositionFromSourceSchema = CompositionFieldReadSchema.extend({ kind: literal("from") });
13506
+ var CompositionBindingSchema = discriminatedUnion("kind", [CompositionFromSourceSchema, object({
13507
+ kind: literal("literal"),
13508
+ value: union([
13509
+ string(),
13510
+ number(),
13511
+ boolean(),
13512
+ _null()
13513
+ ])
13514
+ })]);
13515
+ /**
13516
+ * `expression`: a formula over named bindings, in the salvaged expression
13517
+ * engine. Validated at parse by the SAME function every other consumer runs,
13518
+ * so the editor and the store cannot disagree.
13519
+ */
13520
+ var CompositionExpressionSourceSchema = object({
13521
+ kind: literal("expression"),
13522
+ expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
13523
+ bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), CompositionBindingSchema)
13524
+ }).superRefine((src, ctx) => {
13525
+ const err = validateExpressionSource(src);
13526
+ if (err !== null) ctx.addIssue({
13527
+ code: "custom",
13528
+ message: err,
13529
+ path: ["expr"]
13530
+ });
13531
+ });
13532
+ /** `code`: RESERVED for slice 4 (own runner, one-way eject). */
13533
+ var CompositionCodeSourceSchema = object({
13534
+ kind: literal("code"),
13535
+ code: string().min(1).max(MAX_COMPOSITION_CODE_LENGTH)
13536
+ });
13537
+ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
13538
+ CompositionFromSourceSchema,
13539
+ CompositionExpressionSourceSchema,
13540
+ CompositionCodeSourceSchema
13541
+ ]);
13542
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
13543
+ kind: literal("forward"),
13544
+ source: CompositionSourceRefSchema,
13545
+ cap: string().min(1),
13546
+ method: string().min(1)
13547
+ }), CompositionCodeSourceSchema]);
13548
+ var CompositionFeatureSchema = discriminatedUnion("kind", [object({
13549
+ kind: literal("fields"),
13550
+ cap: string().min(1),
13551
+ fields: record(string().min(1), CompositionFieldSourceSchema).refine((fields) => Object.keys(fields).length <= 32, { message: `at most 32 fields per capability` }),
13552
+ /** RESERVED for slice 3; refused by the validator when non-empty. */
13553
+ commands: record(string().min(1), CompositionCommandTargetSchema).optional()
13554
+ }), object({
13555
+ kind: literal("passthrough"),
13556
+ cap: string().min(1),
13557
+ source: CompositionSourceRefSchema
13558
+ })]);
13559
+ var CompositionSchema = object({
13560
+ target: discriminatedUnion("kind", [object({
13561
+ kind: literal("new"),
13562
+ type: _enum(DeviceType),
13563
+ role: _enum(DeviceRole).optional()
13564
+ }), object({
13565
+ kind: literal("existing"),
13566
+ device: CompositionSourceRefSchema
13567
+ })]),
13568
+ features: array(CompositionFeatureSchema).min(1).max(16)
13569
+ }).superRefine((composition, ctx) => {
13570
+ const seen = /* @__PURE__ */ new Set();
13571
+ composition.features.forEach((feature, index) => {
13572
+ if (seen.has(feature.cap)) ctx.addIssue({
13573
+ code: "custom",
13574
+ message: `capability \`${feature.cap}\` is composed twice — one feature per capability`,
13575
+ path: [
13576
+ "features",
13577
+ index,
13578
+ "cap"
13579
+ ]
13580
+ });
13581
+ seen.add(feature.cap);
13582
+ });
13583
+ });
13584
+ /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
13585
+ var CompositionProblemSchema = object({
13586
+ code: _enum([
13587
+ "reserved-variant",
13588
+ "unknown-capability",
13589
+ "not-composable",
13590
+ "wrong-device-type",
13591
+ "has-commands",
13592
+ "unknown-field",
13593
+ "nested-field",
13594
+ "missing-field",
13595
+ "kind-mismatch",
13596
+ "may-be-null",
13597
+ "source-missing",
13598
+ "source-unreadable",
13599
+ "source-capability-missing",
13600
+ "source-field-unknown",
13601
+ "expression-invalid",
13602
+ "cycle",
13603
+ "duplicate-target"
13604
+ ]),
13605
+ path: string(),
13606
+ message: string()
13607
+ });
13608
+ var CompositionFieldKindSchema = _enum([
13609
+ "string",
13610
+ "number",
13611
+ "boolean",
13612
+ "enum"
13613
+ ]);
13614
+ /** How a field says "unavailable": `null` when its schema allows it, else the device goes offline (D393). */
13615
+ var CompositionUnavailableModeSchema = _enum(["null", "offline"]);
13616
+ /**
13617
+ * `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
13618
+ * field of its cap changes value · `constant` reads nothing, computed once.
13619
+ */
13620
+ var CompositionFieldRoleSchema = _enum([
13621
+ "derived",
13622
+ "clock",
13623
+ "constant"
13624
+ ]);
13625
+ var CompositionFieldPlanSchema = object({
13626
+ cap: string(),
13627
+ path: string(),
13628
+ /** Index into `composition.features` this field's capability came from —
13629
+ * lets a source/cycle problem name its path as `features[N].fields.<path>`
13630
+ * (the same convention `planComposition`'s own problems already use). */
13631
+ featureIndex: number().int().nonnegative(),
13632
+ kind: CompositionFieldKindSchema,
13633
+ nullable: boolean(),
13634
+ required: boolean(),
13635
+ unavailable: CompositionUnavailableModeSchema,
13636
+ role: CompositionFieldRoleSchema,
13637
+ source: CompositionFieldSourceSchema,
13638
+ reads: array(CompositionFieldReadSchema)
13639
+ });
13640
+ var CompositionValidationSchema = object({
13641
+ ok: boolean(),
13642
+ problems: array(CompositionProblemSchema),
13643
+ fields: array(CompositionFieldPlanSchema)
13644
+ });
13645
+ /** Mirrors `CoreBlockStatus`, pinned by `core-blocks-source.spec.ts` (Task 11). */
13646
+ var CompositionRunStatusSchema = _enum([
13647
+ "stopped",
13648
+ "starting",
13649
+ "running",
13650
+ "failed"
13651
+ ]);
13652
+ var CompositionFieldStateKindSchema = _enum([
13653
+ "fresh",
13654
+ "stale",
13655
+ "unavailable"
13656
+ ]);
13657
+ var CompositionFieldStateSchema = object({
13658
+ cap: string(),
13659
+ path: string(),
13660
+ state: CompositionFieldStateKindSchema,
13661
+ /** `null` whenever `state === 'unavailable'`; never a plausible stand-in (D393). */
13662
+ value: union([
13663
+ string(),
13664
+ number(),
13665
+ boolean(),
13666
+ _null()
13667
+ ]),
13668
+ reason: string().optional()
13669
+ });
13670
+ var CompositionBlockStateSchema = object({
13671
+ blockId: string(),
13672
+ deviceId: number().nullable(),
13673
+ status: CompositionRunStatusSchema,
13674
+ reason: string().optional(),
13675
+ fields: array(CompositionFieldStateSchema)
13676
+ });
13405
13677
  /** Where a block runs. The operator chooses — a block driving a device on an
13406
13678
  * agent is the reason placement is not fixed to the hub. */
13407
13679
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -13428,6 +13700,30 @@ var CoreBlockInputSchema = object({
13428
13700
  */
13429
13701
  integrationId: string().optional()
13430
13702
  });
13703
+ /**
13704
+ * What a block IS (D659). Absent means `code` — every row stored before this
13705
+ * union keeps working unchanged.
13706
+ * - `code`: the TypeScript in `code`, compiled and run in its own runner;
13707
+ * - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
13708
+ * - `composition`: declarative, run by the shared `composer`; `code` is `''`.
13709
+ */
13710
+ var CoreBlockSourceSchema = discriminatedUnion("kind", [
13711
+ object({ kind: literal("code") }),
13712
+ object({
13713
+ kind: literal("recipe"),
13714
+ recipe: AutomationRecipeSchema
13715
+ }),
13716
+ object({
13717
+ kind: literal("composition"),
13718
+ composition: CompositionSchema
13719
+ })
13720
+ ]);
13721
+ /** The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7). */
13722
+ var CompositionBlockInputSchema = object({
13723
+ name: string().min(1).max(120),
13724
+ enabled: boolean(),
13725
+ composition: CompositionSchema
13726
+ });
13431
13727
  /** A stored block. */
13432
13728
  var CoreBlockSchema = CoreBlockInputSchema.extend({
13433
13729
  id: string(),
@@ -13443,8 +13739,38 @@ var CoreBlockSchema = CoreBlockInputSchema.extend({
13443
13739
  */
13444
13740
  lastError: string().optional(),
13445
13741
  /** Ms epoch of the last state change. */
13446
- lastChangedAt: number()
13742
+ lastChangedAt: number(),
13743
+ /** What the block is. Absent means `code` (D659). */
13744
+ source: CoreBlockSourceSchema.optional()
13745
+ });
13746
+ /** A stored composition block and what the composer says about it. */
13747
+ var CompositionViewSchema = object({
13748
+ block: CoreBlockSchema,
13749
+ state: discriminatedUnion("kind", [object({
13750
+ kind: literal("answered"),
13751
+ state: CompositionBlockStateSchema.nullable()
13752
+ }), object({
13753
+ kind: literal("unreachable"),
13754
+ error: string()
13755
+ })])
13447
13756
  });
13757
+ /**
13758
+ * A read of the stored compositions. `not-loaded` while the `core_blocks`
13759
+ * table has not been READ: an empty answer then would make "not yet known"
13760
+ * look like "none", and invite the operator to recreate what exists (D315).
13761
+ */
13762
+ var CompositionsNotLoadedSchema = object({
13763
+ state: literal("not-loaded"),
13764
+ reason: string()
13765
+ });
13766
+ var CompositionListReadSchema = discriminatedUnion("state", [object({
13767
+ state: literal("loaded"),
13768
+ views: array(CompositionViewSchema)
13769
+ }), CompositionsNotLoadedSchema]);
13770
+ var CompositionGetReadSchema = discriminatedUnion("state", [object({
13771
+ state: literal("loaded"),
13772
+ view: CompositionViewSchema.nullable()
13773
+ }), CompositionsNotLoadedSchema]);
13448
13774
  /** What a compile attempt produced. */
13449
13775
  var CoreBlockCompileResultSchema = object({
13450
13776
  ok: boolean(),
@@ -13526,7 +13852,105 @@ var coreBlocksCapability = {
13526
13852
  getTypeDefs: method(object({}), object({ libs: array(object({
13527
13853
  filePath: string(),
13528
13854
  content: string()
13529
- })) }), { auth: "admin" })
13855
+ })) }), { auth: "admin" }),
13856
+ /**
13857
+ * Create a composition block (D659). VALIDATED first against the live
13858
+ * sources and every stored composition; a refusal names every problem by
13859
+ * path and reason (D391) and stores nothing.
13860
+ */
13861
+ createComposition: method(object({ block: CompositionBlockInputSchema }), object({ block: CoreBlockSchema }), {
13862
+ kind: "mutation",
13863
+ auth: "admin",
13864
+ caller: "required"
13865
+ }),
13866
+ /**
13867
+ * Patch a composition block. A changed `composition` is validated exactly
13868
+ * as on create. `expectedUpdatedAt` is the `updatedAt` the caller READ: a
13869
+ * block changed since is refused by name, never silently overwritten.
13870
+ */
13871
+ updateComposition: method(object({
13872
+ blockId: string(),
13873
+ expectedUpdatedAt: number(),
13874
+ block: CompositionBlockInputSchema.partial()
13875
+ }), object({ block: CoreBlockSchema }), {
13876
+ kind: "mutation",
13877
+ auth: "admin",
13878
+ caller: "required"
13879
+ }),
13880
+ /** One composition and the composer's state for it, or `not-loaded` (D315). */
13881
+ getComposition: method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }),
13882
+ listCompositions: method(object({}), CompositionListReadSchema, { auth: "admin" }),
13883
+ /**
13884
+ * Validate without saving — the same verdict the save reaches. A mutation
13885
+ * for its body size; it writes nothing, so its access is `view`.
13886
+ */
13887
+ validateComposition: method(object({
13888
+ composition: CompositionSchema,
13889
+ blockId: string().optional()
13890
+ }), CompositionValidationSchema, {
13891
+ kind: "mutation",
13892
+ auth: "admin",
13893
+ access: "view"
13894
+ })
13895
+ }
13896
+ };
13897
+ var ComposerBlockSchema = object({
13898
+ id: string().min(1),
13899
+ name: string().min(1).max(120),
13900
+ enabled: boolean(),
13901
+ updatedAt: number(),
13902
+ composition: CompositionSchema
13903
+ });
13904
+ /**
13905
+ * A stored composition row that no longer PARSES — a schema a release
13906
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
13907
+ * its device as a placeholder and reports the block `failed` naming the parse
13908
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
13909
+ */
13910
+ var ComposerUnreadableBlockSchema = object({
13911
+ id: string().min(1),
13912
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13913
+ name: string().nullable(),
13914
+ /** The parse error, in the operator's words. */
13915
+ error: string()
13916
+ });
13917
+ var composerCapability = {
13918
+ name: "composer",
13919
+ scope: "system",
13920
+ mode: "singleton",
13921
+ internal: true,
13922
+ methods: {
13923
+ /**
13924
+ * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
13925
+ * `router({})` throws on one — every cap router is built at boot.
13926
+ */
13927
+ applyBlocks: method(object({
13928
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13929
+ integrationId: string().nullable(),
13930
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13931
+ storeLoaded: boolean(),
13932
+ blocks: array(ComposerBlockSchema),
13933
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13934
+ restartBlockIds: array(string()),
13935
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13936
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
13937
+ }), object({
13938
+ blocks: array(object({
13939
+ blockId: string(),
13940
+ status: CompositionRunStatusSchema,
13941
+ reason: string().optional()
13942
+ })),
13943
+ /**
13944
+ * False when the composer declared and withdrew NOTHING (store not loaded,
13945
+ * integration unknown, its own rows unread or read empty once). An empty
13946
+ * apply the caller owes is paid off only by one the composer acted on (D49).
13947
+ */
13948
+ acted: boolean()
13949
+ }), {
13950
+ kind: "mutation",
13951
+ auth: "admin"
13952
+ }),
13953
+ getStates: method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" })
13530
13954
  }
13531
13955
  };
13532
13956
  /**
@@ -20928,8 +21352,8 @@ var NcTestResultSchema = object({
20928
21352
  className: string().optional(),
20929
21353
  label: string().optional()
20930
21354
  });
20931
- /** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is the
20932
- * same union; the template-vars spec pins the two together. `mixed` is DERIVED
21355
+ /** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
21356
+ * `z.infer` of this schema — one shape, no twin. `mixed` is DERIVED
20933
21357
  * (a stored system rule whose kinds span families, D637) and never authored. */
20934
21358
  var NcRuleKindSchema = _enum([
20935
21359
  "detection",
@@ -23548,6 +23972,13 @@ var AudioEventSchema = object({
23548
23972
  originalClass: string().optional(),
23549
23973
  score: number()
23550
23974
  }).optional(),
23975
+ /**
23976
+ * Whether the classifier RAN on the window behind this row (D660). Absent
23977
+ * on rows written before D660 — unknown, NOT classified: until then a
23978
+ * window the analyzer's busy gate threw away was stored exactly like one
23979
+ * that heard nothing above the floor.
23980
+ */
23981
+ classifyOutcome: AudioClassifyOutcomeSchema.optional(),
23551
23982
  /** Populated by B5 (recording playback URL for this event). */
23552
23983
  mediaUrl: string().optional()
23553
23984
  });
@@ -43932,6 +44363,38 @@ var zoneRulesCapability = {
43932
44363
  */
43933
44364
  durability: "restored"
43934
44365
  };
44366
+ var NUMBER = {
44367
+ kind: "fixed",
44368
+ result: ["number"]
44369
+ };
44370
+ var BOOLEAN = {
44371
+ kind: "fixed",
44372
+ result: ["boolean"]
44373
+ };
44374
+ Object.freeze({
44375
+ min: NUMBER,
44376
+ max: NUMBER,
44377
+ abs: NUMBER,
44378
+ floor: NUMBER,
44379
+ ceil: NUMBER,
44380
+ sqrt: NUMBER,
44381
+ round: NUMBER,
44382
+ pow: NUMBER,
44383
+ clamp: NUMBER,
44384
+ avg: NUMBER,
44385
+ sum: NUMBER,
44386
+ age: NUMBER,
44387
+ convert: NUMBER,
44388
+ coalesce: { kind: "coalesce" },
44389
+ any: BOOLEAN,
44390
+ all: BOOLEAN,
44391
+ within: BOOLEAN,
44392
+ latest: {
44393
+ kind: "fixed",
44394
+ result: ["number", "null"]
44395
+ }
44396
+ });
44397
+ `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
43935
44398
  /**
43936
44399
  * Most specific first. Extending this list is how a new device kind becomes
43937
44400
  * gateable; nothing else needs to change.
@@ -45392,6 +45855,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
45392
45855
  carbonMonoxideCapability,
45393
45856
  climateControlCapability,
45394
45857
  colorCapability,
45858
+ composerCapability,
45395
45859
  connectionTestCapability,
45396
45860
  connectivityCapability,
45397
45861
  consumablesCapability,
@@ -46465,6 +46929,18 @@ Object.freeze({
46465
46929
  addonId: null,
46466
46930
  access: "create"
46467
46931
  },
46932
+ "composer.applyBlocks": {
46933
+ capName: "composer",
46934
+ capScope: "system",
46935
+ addonId: null,
46936
+ access: "create"
46937
+ },
46938
+ "composer.getStates": {
46939
+ capName: "composer",
46940
+ capScope: "system",
46941
+ addonId: null,
46942
+ access: "view"
46943
+ },
46468
46944
  "connectionTest.describeTest": {
46469
46945
  capName: "connection-test",
46470
46946
  capScope: "system",
@@ -46525,6 +47001,12 @@ Object.freeze({
46525
47001
  addonId: null,
46526
47002
  access: "create"
46527
47003
  },
47004
+ "coreBlocks.createComposition": {
47005
+ capName: "core-blocks",
47006
+ capScope: "system",
47007
+ addonId: null,
47008
+ access: "create"
47009
+ },
46528
47010
  "coreBlocks.delete": {
46529
47011
  capName: "core-blocks",
46530
47012
  capScope: "system",
@@ -46537,6 +47019,12 @@ Object.freeze({
46537
47019
  addonId: null,
46538
47020
  access: "view"
46539
47021
  },
47022
+ "coreBlocks.getComposition": {
47023
+ capName: "core-blocks",
47024
+ capScope: "system",
47025
+ addonId: null,
47026
+ access: "view"
47027
+ },
46540
47028
  "coreBlocks.getTypeDefs": {
46541
47029
  capName: "core-blocks",
46542
47030
  capScope: "system",
@@ -46549,6 +47037,12 @@ Object.freeze({
46549
47037
  addonId: null,
46550
47038
  access: "view"
46551
47039
  },
47040
+ "coreBlocks.listCompositions": {
47041
+ capName: "core-blocks",
47042
+ capScope: "system",
47043
+ addonId: null,
47044
+ access: "view"
47045
+ },
46552
47046
  "coreBlocks.restart": {
46553
47047
  capName: "core-blocks",
46554
47048
  capScope: "system",
@@ -46567,6 +47061,18 @@ Object.freeze({
46567
47061
  addonId: null,
46568
47062
  access: "create"
46569
47063
  },
47064
+ "coreBlocks.updateComposition": {
47065
+ capName: "core-blocks",
47066
+ capScope: "system",
47067
+ addonId: null,
47068
+ access: "create"
47069
+ },
47070
+ "coreBlocks.validateComposition": {
47071
+ capName: "core-blocks",
47072
+ capScope: "system",
47073
+ addonId: null,
47074
+ access: "view"
47075
+ },
46570
47076
  "cover.close": {
46571
47077
  capName: "cover",
46572
47078
  capScope: "device",