@camstack/types 1.2.274 → 1.2.276

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { $ as CamProfileSchema, A as DEVICE_STATUS_METHOD, At as normalizeAddonInitResult, B as nodePin, Bt as hydrateSchema, C as customAction, Ct as PEER_BYTES_STALL_MS, D as adminUiCapability, Dt as SHARE_VIEW_KINDS, E as deviceCustomAction, Et as DATAPLANE_SECRET_HEADER, F as method, Ft as isEvent, G as emitDownForOwnedCaps, Gt as isAudioChunkFormat, H as toNodeId, Ht as AUDIO_CHUNK_FORMATS, I as optionalMethod, It as WELL_KNOWN_TABS, J as AudioChunkFormatSchema, K as readinessKey, L as resolveCapMount, Lt as WELL_KNOWN_TAB_MAP, M as event, Mt as createDurableState, N as expandCapMethods, Nt as createEvent, O as DEFAULT_RUNTIME_STATE_DURABILITY, Ot as DisposerChain, P as isDeviceConfigCap, Pt as emitReadiness, Q as CAM_PROFILE_ORDER, R as systemMethod, Rt as collectHydratedFieldEntries, S as DEVICE_CHILDREN_BATCH_MAX, St as PEER_BYTES_MAX_OUTSTANDING, T as describeCustomActions, Tt as PeerBytesTicketSchema, U as ReadinessRegistry, Ut as audioChunkBytesPerSample, V as readNodePin, Vt as resolveHydratedFieldValue, W as ReadinessTimeoutError, Wt as expandAudioChunkToF32le, X as BrokerStatsSchema, Y as AudioStreamPickSchema, Z as BrokerStatusSchema, _ as createMirrorSource, _t as makeProfileBrokerId, a as asJsonObject, at as EncodedPacketSchema, b as deviceOpsCapability, bt as selectAssignedProfileSlots, c as parseJsonArray, ct as ProfileRtspEntrySchema, d as BOOT_RECOVERY_BACKOFF_MS, dt as StreamSourceEntrySchema, et as CamStreamKindSchema, f as DEVICE_SCOPED_CAPS, ft as StreamSourceSchema, g as createLazyTrpcSource, gt as SubscribeFramesResultSchema, h as createEventBusSliceSource, ht as SubscribeFramesInputSchema, i as asJsonArray, it as DecodedFrameSchema, j as PROVIDER_PIN_FIELD, jt as normalizeNodeId, k as DEVICE_SETTINGS_CONTRIBUTION_METHODS, kt as BaseAddon, l as parseJsonObject, lt as ProfileSlotSchema, m as createDeviceProxy, mt as SubscribeAudioChunksResultSchema, n as sleepCancellable, nt as CameraStreamSchema, o as asNumber, ot as FrameHandleFormatSchema, p as isDeviceScopedCap, pt as SubscribeAudioChunksInputSchema, q as scopeKey, r as asBoolean, rt as DecodedAudioChunkSchema, s as asString, st as FrameHandleSchema, t as sleep, tt as CamStreamResolutionSchema, u as parseJsonUnknown, ut as ProfileSlotStatusSchema, v as createSliceHandle, vt as makeSourceBrokerId, w as defineCustomActions, wt as PEER_BYTES_TICKET_TTL_MS, x as viewerUiCapability, xt as PEER_BYTES_CHUNK_BYTES, y as RawStateResultSchema, yt as parseProfileBrokerId, z as CAP_NODE_PIN_CONTEXT_KEY, zt as collectHydratedFieldValues } from "./sleep-C-v96WpE.mjs";
2
2
  import { i as publicEventCategories, n as OWNER_ONLY_EVENT_CATEGORIES, r as isOwnerOnlyEventCategory, t as EventCategory } from "./event-category-C5xZWqz6.mjs";
3
- import { $ as MAX_EXPRESSION_AST_NODES, A as compositionFeatureEnabled, At as invocationFromEncodeProfile, B as createStatefulExpressionMemory, C as CompositionTargetSchema, Ct as Fmp4BoxSplitter, D as MAX_COMPOSITION_ITEMS, Dt as buildFfmpegArgs, E as MAX_COMPOSITION_FIELDS_PER_FEATURE, Et as buildAudioArgs, F as featureFieldEntries, G as createExpressionScope, H as evaluateStatefulExpressionCall, I as featureSources, J as compileExpressionSafe, K as evaluateAst, L as fieldReads, M as compositionReadKey, Mt as logBannerArgs, N as compositionSliceKey, Nt as pickVideoEncoder, O as composedDeviceRef, Ot as buildInputArgs, P as compositionSourceKey, Pt as resolveStreamMaps, Q as EXPRESSION_IDENTIFIER_RE, R as EXPRESSION_INJECTED_NOW, S as CompositionSourceRefSchema, St as canonicalHash, T as MAX_COMPOSITION_FEATURES, Tt as audioPlanFromEncodeProfile, U as toExpressionValue, V as evaluateExpressionSource, W as validateExpressionSource, X as tokenize, Y as parseExpression, Z as EXPRESSION_COMPILE_CACHE_CAPACITY, _ as CompositionItemEntrySchema, _t as evaluateSensorEdge, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, at as EXPRESSION_BUILTINS, b as CompositionPassthroughFeatureSchema, bt as sliceActiveValue, c as CompositionCommandTargetSchema, ct as evaluateRose, d as CompositionFeatureSchema, dt as ExpressionParseError, et as MAX_EXPRESSION_BINDINGS, f as CompositionFieldReadSchema, ft as DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, g as CompositionFromSourceSchema, gt as SOURCE_DEVICE_TYPES, h as CompositionForwardCommandSchema, ht as SOURCE_CAP_CHANGED_AT_FIELD, i as COMPOSITION_ITEM_KEY_RE, it as RESERVED_BINDING_NAMES, j as compositionItemFieldPath, jt as isSoftwareDecode, k as composedDeviceStableId, kt as buildVideoArgs, l as CompositionExistingTargetSchema, lt as isStatefulBuiltin, m as CompositionFieldsFeatureSchema, mt as SOURCE_CAP_ACTIVE_FIELD, n as COMPOSER_ADDON_ID, nt as MAX_EXPRESSION_EVAL_STEPS, o as CompositionBindingSchema, ot as EXPRESSION_BUILTIN_NAMES, p as CompositionFieldSourceSchema, pt as SOURCE_CAPS, q as compileExpression, r as COMPOSITION_ITEM_ARRAY_PATH, rt as MAX_EXPRESSION_SOURCE_LENGTH, s as CompositionCodeSourceSchema, st as evaluateCount, t as COMPOSED_DEVICE_STABLE_ID_PREFIX, tt as MAX_EXPRESSION_CALL_ARGS, u as CompositionExpressionSourceSchema, ut as ExpressionEvalError, v as CompositionLiteralBindingSchema, vt as evaluateSensorLevelEdge, w as MAX_COMPOSITION_CODE_LENGTH, wt as AUDIO_PRESETS, x as CompositionSchema, xt as sliceChangedAt, y as CompositionNewTargetSchema, yt as isSourceCap, z as cloneStatefulExpressionMemory } from "./composition-BK-GTFYb.mjs";
3
+ import { $ as MAX_EXPRESSION_AST_NODES, A as compositionFeatureEnabled, At as AUDIO_PRESETS, B as createStatefulExpressionMemory, Bt as resolveStreamMaps, C as CompositionTargetSchema, D as MAX_COMPOSITION_ITEMS, E as MAX_COMPOSITION_FIELDS_PER_FEATURE, F as featureFieldEntries, Ft as buildVideoArgs, G as createExpressionScope, H as evaluateStatefulExpressionCall, I as featureSources, It as invocationFromEncodeProfile, J as compileExpressionSafe, K as evaluateAst, L as fieldReads, Lt as isSoftwareDecode, M as compositionReadKey, Mt as buildAudioArgs, N as compositionSliceKey, Nt as buildFfmpegArgs, O as composedDeviceRef, Ot as canonicalHash, P as compositionSourceKey, Pt as buildInputArgs, Q as EXPRESSION_IDENTIFIER_RE, R as EXPRESSION_INJECTED_NOW, Rt as logBannerArgs, S as CompositionSourceRefSchema, St as FFMPEG_PATH_ENV, T as MAX_COMPOSITION_FEATURES, U as toExpressionValue, V as evaluateExpressionSource, W as validateExpressionSource, X as tokenize, Y as parseExpression, Z as EXPRESSION_COMPILE_CACHE_CAPACITY, _ as CompositionItemEntrySchema, _t as evaluateSensorEdge, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, at as EXPRESSION_BUILTINS, b as CompositionPassthroughFeatureSchema, bt as sliceActiveValue, c as CompositionCommandTargetSchema, ct as evaluateRose, d as CompositionFeatureSchema, dt as ExpressionParseError, et as MAX_EXPRESSION_BINDINGS, f as CompositionFieldReadSchema, ft as DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, g as CompositionFromSourceSchema, gt as SOURCE_DEVICE_TYPES, h as CompositionForwardCommandSchema, ht as SOURCE_CAP_CHANGED_AT_FIELD, i as COMPOSITION_ITEM_KEY_RE, it as RESERVED_BINDING_NAMES, j as compositionItemFieldPath, jt as audioPlanFromEncodeProfile, k as composedDeviceStableId, kt as Fmp4BoxSplitter, l as CompositionExistingTargetSchema, lt as isStatefulBuiltin, m as CompositionFieldsFeatureSchema, mt as SOURCE_CAP_ACTIVE_FIELD, n as COMPOSER_ADDON_ID, nt as MAX_EXPRESSION_EVAL_STEPS, o as CompositionBindingSchema, ot as EXPRESSION_BUILTIN_NAMES, p as CompositionFieldSourceSchema, pt as SOURCE_CAPS, q as compileExpression, r as COMPOSITION_ITEM_ARRAY_PATH, rt as MAX_EXPRESSION_SOURCE_LENGTH, s as CompositionCodeSourceSchema, st as evaluateCount, t as COMPOSED_DEVICE_STABLE_ID_PREFIX, tt as MAX_EXPRESSION_CALL_ARGS, u as CompositionExpressionSourceSchema, ut as ExpressionEvalError, v as CompositionLiteralBindingSchema, vt as evaluateSensorLevelEdge, w as MAX_COMPOSITION_CODE_LENGTH, x as CompositionSchema, xt as sliceChangedAt, y as CompositionNewTargetSchema, yt as isSourceCap, z as cloneStatefulExpressionMemory, zt as pickVideoEncoder } from "./composition-Dq42XWp0.mjs";
4
4
  import { a as DeviceType, i as DeviceRole, n as ChargingStatus, r as DeviceFeature, t as errMsg } from "./err-msg-DX6i_MY4.mjs";
5
5
  import { EventSourceType } from "./enums.mjs";
6
6
  import { z } from "zod";
@@ -832,6 +832,28 @@ function egressTranscodeSharingKey(request, delivery = egressTransportFromReques
832
832
  return `egress:${canonicalHash(canonicalEgressPlan(request, delivery))}`;
833
833
  }
834
834
  //#endregion
835
+ //#region src/ffmpeg/pinned-binary.ts
836
+ /**
837
+ * Memoize `ensure` on SUCCESS only.
838
+ *
839
+ * A failure is not remembered: the next caller asks again, so a node whose
840
+ * first download failed (no network at boot) recovers on the next spawn that
841
+ * needs it — with no timer and no retry loop, because the ask is driven by
842
+ * work that actually wants the binary.
843
+ */
844
+ function memoizePinnedFfmpeg(ensure) {
845
+ let pending = null;
846
+ return () => {
847
+ if (pending !== null) return pending;
848
+ const attempt = ensure();
849
+ pending = attempt;
850
+ attempt.catch(() => {
851
+ if (pending === attempt) pending = null;
852
+ });
853
+ return attempt;
854
+ };
855
+ }
856
+ //#endregion
835
857
  //#region src/health/wiring-health.ts
836
858
  /**
837
859
  * Deep wiring healthcheck — snapshot of active reachability probes across
@@ -9767,269 +9789,1198 @@ var CompositionBlockStateSchema = z.object({
9767
9789
  fields: z.array(CompositionFieldStateSchema)
9768
9790
  });
9769
9791
  //#endregion
9770
- //#region src/capabilities/core-blocks.cap.ts
9771
- /**
9772
- * core-blocks — user-authored TypeScript, stored in the kernel and executed in
9773
- * its own process.
9774
- *
9775
- * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
9776
- *
9777
- * The first use is **owning devices without being a device provider**: a block
9778
- * declares devices under a system or custom integration and drives their state,
9779
- * with the same `ctx` an addon gets. Automations come later; nothing here
9780
- * models a trigger.
9781
- *
9782
- * **Stated plainly, because it does not change by being true:** a block has an
9783
- * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
9784
- * with no review step. What makes that survivable is not a sandbox, it is
9785
- * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
9786
- * so a block that throws or never returns is marked `failed` and visible
9787
- * instead of taking the hub with it (D6). Every method here is admin-only, and
9788
- * must stay so.
9789
- */
9790
- /**
9791
- * Prefix for a block's generated addon id AND its runner id — one addon, one
9792
- * process, so the two are the same string (D2).
9793
- *
9794
- * It lives on the CONTRACT rather than beside the code that materialises the
9795
- * package, because it is not an implementation detail: the operator surface
9796
- * reads a block's logs by asking `logs.query` for `addonId = core-block-<id>`,
9797
- * with no cap and no store of its own. Two copies of this string is one copy
9798
- * too many — a drift would show as a logs pane that is simply always empty.
9799
- */
9800
- var CORE_BLOCK_ADDON_PREFIX = "core-block-";
9792
+ //#region src/composition/plan-result.ts
9793
+ function problem(code, path, message) {
9794
+ return {
9795
+ code,
9796
+ path,
9797
+ message
9798
+ };
9799
+ }
9800
+ function refused(...problems) {
9801
+ return {
9802
+ problems,
9803
+ fields: [],
9804
+ features: [],
9805
+ events: []
9806
+ };
9807
+ }
9808
+ /** Where a planned field sits in the composition: `features[N].fields.<path>` or `features[N].items.<key>.fields.<path>`. */
9809
+ function compositionFieldAt(field) {
9810
+ const inner = field.item === void 0 ? "fields" : `items.${field.item.key}.fields`;
9811
+ return `features[${field.featureIndex}].${inner}.${field.path}`;
9812
+ }
9813
+ //#endregion
9814
+ //#region src/composition/expression-kinds.ts
9815
+ var NUMBER = {
9816
+ kind: "fixed",
9817
+ result: ["number"]
9818
+ };
9819
+ var BOOLEAN = {
9820
+ kind: "fixed",
9821
+ result: ["boolean"]
9822
+ };
9823
+ /** One rule per builtin. `expression-kinds.spec.ts` fails for a builtin missing here. */
9824
+ var BUILTIN_RESULT_KINDS = Object.freeze({
9825
+ min: NUMBER,
9826
+ max: NUMBER,
9827
+ abs: NUMBER,
9828
+ floor: NUMBER,
9829
+ ceil: NUMBER,
9830
+ sqrt: NUMBER,
9831
+ round: NUMBER,
9832
+ pow: NUMBER,
9833
+ clamp: NUMBER,
9834
+ avg: NUMBER,
9835
+ sum: NUMBER,
9836
+ age: NUMBER,
9837
+ convert: NUMBER,
9838
+ coalesce: { kind: "coalesce" },
9839
+ any: BOOLEAN,
9840
+ all: BOOLEAN,
9841
+ within: BOOLEAN,
9842
+ latest: {
9843
+ kind: "fixed",
9844
+ result: ["number", "null"]
9845
+ },
9846
+ number: {
9847
+ kind: "fixed",
9848
+ result: ["number", "null"]
9849
+ },
9850
+ rose: {
9851
+ kind: "fixed",
9852
+ result: ["number", "null"]
9853
+ },
9854
+ count: NUMBER
9855
+ });
9856
+ var KindInferenceError = class extends Error {};
9857
+ function kindOfValue(value) {
9858
+ if (value === null) return "null";
9859
+ if (typeof value === "number") return "number";
9860
+ if (typeof value === "string") return "string";
9861
+ return "boolean";
9862
+ }
9863
+ function only(kind) {
9864
+ return new Set([kind]);
9865
+ }
9866
+ function union(...sets) {
9867
+ return new Set(sets.flatMap((s) => [...s]));
9868
+ }
9869
+ function withoutNull(set) {
9870
+ return new Set([...set].filter((k) => k !== "null"));
9871
+ }
9872
+ function binaryKinds(op, left, right) {
9873
+ if (op === "+") {
9874
+ const all = [...left, ...right];
9875
+ if (all.every((k) => k === "string")) return only("string");
9876
+ if (all.every((k) => k === "number")) return only("number");
9877
+ return new Set(["number", "string"]);
9878
+ }
9879
+ if (op === "-" || op === "*" || op === "/" || op === "%") return only("number");
9880
+ return only("boolean");
9881
+ }
9882
+ /** "exactly N" / "at least N" / "N–M", for an arity refusal that says what IS allowed. */
9883
+ function arityRange(builtin) {
9884
+ if (builtin.minArgs === builtin.maxArgs) return `exactly ${builtin.minArgs}`;
9885
+ if (builtin.maxArgs === Number.POSITIVE_INFINITY) return `at least ${builtin.minArgs}`;
9886
+ return `${builtin.minArgs}–${builtin.maxArgs}`;
9887
+ }
9888
+ function callKinds(callee, args) {
9889
+ const builtin = EXPRESSION_BUILTINS[callee];
9890
+ if (builtin !== void 0 && (args.length < builtin.minArgs || args.length > builtin.maxArgs)) throw new KindInferenceError(`${callee}: wrong number of arguments (${args.length}); expected ${arityRange(builtin)}`);
9891
+ const rule = BUILTIN_RESULT_KINDS[callee];
9892
+ if (rule === void 0) throw new KindInferenceError(`no result-kind rule for builtin '${callee}'`);
9893
+ if (rule.kind === "fixed") return new Set(rule.result);
9894
+ const nonNull = union(...args.map(withoutNull));
9895
+ return args.every((a) => a.has("null")) ? union(nonNull, only("null")) : nonNull;
9896
+ }
9897
+ function kindsOf(node, bindings) {
9898
+ switch (node.kind) {
9899
+ case "literal": return only(kindOfValue(node.value));
9900
+ case "identifier": {
9901
+ if (node.name === "now") return only("number");
9902
+ const bound = bindings.get(node.name);
9903
+ if (bound === void 0) throw new KindInferenceError(`unbound identifier '${node.name}'`);
9904
+ return bound;
9905
+ }
9906
+ case "unary": return only(node.op === "!" ? "boolean" : "number");
9907
+ case "binary": return binaryKinds(node.op, kindsOf(node.left, bindings), kindsOf(node.right, bindings));
9908
+ case "logical": return union(kindsOf(node.left, bindings), kindsOf(node.right, bindings));
9909
+ case "conditional": return union(kindsOf(node.consequent, bindings), kindsOf(node.alternate, bindings));
9910
+ case "call": return callKinds(node.callee, node.args.map((a) => kindsOf(a, bindings)));
9911
+ }
9912
+ }
9913
+ function nodeContainsCall(node, callee) {
9914
+ switch (node.kind) {
9915
+ case "literal":
9916
+ case "identifier": return false;
9917
+ case "unary": return nodeContainsCall(node.operand, callee);
9918
+ case "binary":
9919
+ case "logical": return nodeContainsCall(node.left, callee) || nodeContainsCall(node.right, callee);
9920
+ case "conditional": return nodeContainsCall(node.test, callee) || nodeContainsCall(node.consequent, callee) || nodeContainsCall(node.alternate, callee);
9921
+ case "call": return node.callee === callee || node.args.some((arg) => nodeContainsCall(arg, callee));
9922
+ }
9923
+ }
9924
+ function expressionContainsBuiltinCall(expr, callee) {
9925
+ const compiled = compileExpressionSafe(expr);
9926
+ return compiled.ok && nodeContainsCall(compiled.parsed.ast, callee);
9927
+ }
9928
+ function inferExpressionKinds(input) {
9929
+ const compiled = compileExpressionSafe(input.expr);
9930
+ if (!compiled.ok) return {
9931
+ ok: false,
9932
+ error: compiled.error
9933
+ };
9934
+ try {
9935
+ return {
9936
+ ok: true,
9937
+ kinds: kindsOf(compiled.parsed.ast, input.bindingKinds)
9938
+ };
9939
+ } catch (err) {
9940
+ if (err instanceof KindInferenceError) return {
9941
+ ok: false,
9942
+ error: err.message
9943
+ };
9944
+ throw err;
9945
+ }
9946
+ }
9947
+ //#endregion
9948
+ //#region src/composition/field-kinds.ts
9801
9949
  /**
9802
- * The builtin's own addon id — and, because of that, the OWNER of the
9803
- * integration every block's devices hang from.
9804
- *
9805
- * A block cannot own one. Every integration read is gated on the installed-addon
9806
- * set (`addon-registry.service.ts` → `createFilteredRegistry`) and a block's
9807
- * `core-block-<uuid>` is never in it, so its `getIntegrationByAddonId` answers
9808
- * null forever while the write succeeds — one invisible, undeletable row per
9809
- * start. `core-blocks` IS installed, so it reconciles one shared integration and
9810
- * a block names it by id (`DeclaredDevicesSpec.integrationId`), minting nothing.
9811
- *
9812
- * Exported from the contract, next to the runner prefix and for the same reason:
9813
- * a block reads it as
9814
- * `ctx.api.integrations.getByAddonId.query({ addonId: CORE_BLOCKS_ADDON_ID })`,
9815
- * so a second copy of the string is a block that silently declares into nowhere.
9950
+ * The kind half of planning a composition field (D659): which kinds a source
9951
+ * can produce, whether they fit a target field, and the field's role.
9952
+ * Shared by the top-level planner (`validate-composition.ts`) and the item
9953
+ * planner (`composition-items.ts`). Internal to the composition module — NOT
9954
+ * in the barrel: these are planner internals, not a published contract.
9816
9955
  */
9817
- var CORE_BLOCKS_ADDON_ID = "core-blocks";
9818
- /** The addon/runner id a block's process runs under. */
9819
- function coreBlockAddonId(blockId) {
9820
- return `${CORE_BLOCK_ADDON_PREFIX}${blockId}`;
9956
+ function readKinds(read, lookupCap) {
9957
+ const def = lookupCap(read.cap);
9958
+ const schema = def?.runtimeState ?? def?.status?.schema;
9959
+ if (def === null || schema === void 0) return {
9960
+ ok: false,
9961
+ code: "source-field-unknown",
9962
+ message: `no capability \`${read.cap}\` with state to read`
9963
+ };
9964
+ const field = describeStateField(schema, read.fieldPath);
9965
+ if (field === null) return {
9966
+ ok: false,
9967
+ code: "source-field-unknown",
9968
+ message: `\`${read.cap}\` has no field \`${read.fieldPath}\``
9969
+ };
9970
+ const base = field.kind === "enum" ? "string" : field.kind;
9971
+ return {
9972
+ ok: true,
9973
+ kinds: new Set(field.nullable ? [base, "null"] : [base])
9974
+ };
9821
9975
  }
9822
- /** The block id behind a generated addon/runner id, or null when the id belongs
9823
- * to something else. The inverse of {@link coreBlockAddonId}. */
9824
- function coreBlockIdFromAddonId(addonId) {
9825
- if (!addonId.startsWith("core-block-")) return null;
9826
- const rest = addonId.slice(11);
9827
- return rest.length > 0 ? rest : null;
9976
+ function sourceKinds(source, lookupCap) {
9977
+ if (source.kind === "from") return readKinds(source, lookupCap);
9978
+ if (source.kind === "code") return {
9979
+ ok: false,
9980
+ code: "reserved-variant",
9981
+ message: "code fields arrive in slice 4"
9982
+ };
9983
+ const bindingKinds = /* @__PURE__ */ new Map();
9984
+ for (const [name, binding] of Object.entries(source.bindings)) {
9985
+ if (binding.kind === "literal") {
9986
+ bindingKinds.set(name, new Set([kindOfValue(binding.value)]));
9987
+ continue;
9988
+ }
9989
+ const kinds = readKinds(binding, lookupCap);
9990
+ if (!kinds.ok) return {
9991
+ ...kinds,
9992
+ message: `binding \`${name}\`: ${kinds.message}`
9993
+ };
9994
+ bindingKinds.set(name, kinds.kinds);
9995
+ }
9996
+ const inferred = inferExpressionKinds({
9997
+ expr: source.expr,
9998
+ bindingKinds
9999
+ });
10000
+ return inferred.ok ? {
10001
+ ok: true,
10002
+ kinds: inferred.kinds
10003
+ } : {
10004
+ ok: false,
10005
+ code: "expression-invalid",
10006
+ message: inferred.error
10007
+ };
10008
+ }
10009
+ function compatibility(cap, target, kinds, at) {
10010
+ const allowed = target.kind === "enum" ? "string" : target.kind;
10011
+ const offending = [...kinds].filter((k) => k !== "null" && k !== allowed);
10012
+ const problems = [];
10013
+ if (offending.length > 0) problems.push(problem("kind-mismatch", at, `\`${cap}.${target.path}\` is a ${target.kind}; this source can produce ${offending.join(" or ")}`));
10014
+ if (kinds.has("null") && !target.nullable) problems.push(problem("may-be-null", at, `\`${cap}.${target.path}\` cannot be null and this source can produce null — wrap it in coalesce(…) or pick a non-null source`));
10015
+ return problems;
9828
10016
  }
9829
- /** Where a block runs. The operator chooses — a block driving a device on an
9830
- * agent is the reason placement is not fixed to the hub. */
9831
- var CoreBlockPlacementSchema = z.union([z.literal("hub"), z.string().min(1)]);
9832
- /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
9833
- * a failing block reads the same way a failing addon does. `degraded` is a
9834
- * composition on an existing device with a field handed back to the native
9835
- * provider while its source is unavailable (S1b, D663); the error names it. */
9836
- var CoreBlockStatusSchema = z.enum([
9837
- "stopped",
9838
- "starting",
9839
- "running",
9840
- "degraded",
9841
- "failed"
9842
- ]);
9843
- /** Client-authored fields. */
9844
- var CoreBlockInputSchema = z.object({
9845
- name: z.string().min(1).max(120),
9846
- /** TypeScript source. Compiled server-side before it is ever stored — a
9847
- * block that does not compile is a fork failure the operator would meet
9848
- * minutes later, in a log, instead of in the editor. */
9849
- code: z.string().max(2e5),
9850
- enabled: z.boolean(),
9851
- placement: CoreBlockPlacementSchema,
9852
- /**
9853
- * Integration the block's devices hang from. Absent = the system integration
9854
- * blocks share. A block may declare its own instead.
9855
- */
9856
- integrationId: z.string().optional()
9857
- });
9858
10017
  /**
9859
- * What a block IS (D659). Absent means `code` — every row stored before this
9860
- * union keeps working unchanged.
9861
- * - `code`: the TypeScript in `code`, compiled and run in its own runner;
9862
- * - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
9863
- * - `composition`: declarative, run by the shared `composer`; `code` is `''`.
10018
+ * A string a source produces WITHOUT reading any device — a field-level
10019
+ * `expression` source whose compiled AST is a bare string literal (`"red"`,
10020
+ * never `a` or `a + "x"`). Anything else that can only produce `'string'` at
10021
+ * the kind level (a `from` read of an enum-typed source field, a computed
10022
+ * expression) is NOT checked against the target's `enumValues` here: the
10023
+ * kind inference already collapsed it to the coarse `'string'` kind, losing
10024
+ * whichever enum it actually came from, so membership can only be judged at
10025
+ * write time against the runtime-state schema. Known limitation — see the
10026
+ * fix report for Task 6 round 1.
9864
10027
  */
9865
- var CoreBlockSourceSchema = z.discriminatedUnion("kind", [
9866
- z.object({ kind: z.literal("code") }),
9867
- z.object({
9868
- kind: z.literal("recipe"),
9869
- recipe: AutomationRecipeSchema
9870
- }),
9871
- z.object({
9872
- kind: z.literal("composition"),
9873
- composition: CompositionSchema
9874
- })
9875
- ]);
10028
+ function literalStringValue(source) {
10029
+ if (source.kind !== "expression") return null;
10030
+ const compiled = compileExpressionSafe(source.expr);
10031
+ if (!compiled.ok) return null;
10032
+ const ast = compiled.parsed.ast;
10033
+ return ast.kind === "literal" && typeof ast.value === "string" ? ast.value : null;
10034
+ }
9876
10035
  /**
9877
- * The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7).
9878
- *
9879
- * `name`: REQUIRED for a `new` target — the block's name IS the device's name
9880
- * (D659). ABSENT for an `existing` target — a customization has no name of its
9881
- * own; the server derives one (`customizationBlockName`, D663) and refuses a
9882
- * client-sent name by name.
10036
+ * An enum target whose source is a save-time-KNOWN string literal outside its
10037
+ * `enumValues` is refused now rather than left to fail the write later. A
10038
+ * dynamic source (a `from` read, a non-literal expression) is left to
10039
+ * runtime — see {@link literalStringValue}.
9883
10040
  */
9884
- var CompositionBlockInputSchema = z.object({
9885
- name: z.string().min(1).max(120).optional(),
9886
- enabled: z.boolean(),
9887
- composition: CompositionSchema
9888
- });
9889
- /** A stored block. */
9890
- var CoreBlockSchema = CoreBlockInputSchema.extend({
9891
- id: z.string(),
9892
- createdAt: z.number(),
9893
- updatedAt: z.number(),
9894
- /** Server-stamped author. */
9895
- createdBy: z.string(),
9896
- status: CoreBlockStatusSchema,
9897
- /**
9898
- * Why the block is not running, when it is not. The operator's ONLY window
9899
- * into a block that failed at load — a block that is silently absent is the
9900
- * failure mode this whole feature has to avoid.
9901
- */
9902
- lastError: z.string().optional(),
9903
- /** Ms epoch of the last state change. */
9904
- lastChangedAt: z.number(),
9905
- /** What the block is. Absent means `code` (D659). */
9906
- source: CoreBlockSourceSchema.optional()
9907
- });
9908
- function coreBlockSourceKind(block) {
9909
- return block.source?.kind ?? "code";
10041
+ function enumLiteralProblem(cap, target, source, at) {
10042
+ if (target.kind !== "enum" || target.enumValues === void 0) return null;
10043
+ const value = literalStringValue(source);
10044
+ if (value === null || target.enumValues.includes(value)) return null;
10045
+ const allowed = target.enumValues.map((v) => `\`${v}\``).join(", ");
10046
+ return problem("kind-mismatch", at, `\`${cap}.${target.path}\` accepts only ${allowed}; this source is the literal \`${value}\``);
9910
10047
  }
9911
- function coreBlockComposition(block) {
9912
- return block.source?.kind === "composition" ? block.source.composition : null;
10048
+ function roleOf(source) {
10049
+ if (source.kind !== "expression") return "derived";
10050
+ if (expressionContainsBuiltinCall(source.expr, "count")) return "accumulator";
10051
+ if (fieldReads(source).length > 0) return "derived";
10052
+ const compiled = compileExpressionSafe(source.expr);
10053
+ return compiled.ok && compiled.parsed.identifiers.has("now") ? "clock" : "constant";
9913
10054
  }
9914
- /** What the composer said, or that it could not be asked. Unknown never looks like absent (D315). */
9915
- var CompositionStateReadSchema = z.discriminatedUnion("kind", [z.object({
9916
- kind: z.literal("answered"),
9917
- state: CompositionBlockStateSchema.nullable()
9918
- }), z.object({
9919
- kind: z.literal("unreachable"),
9920
- error: z.string()
9921
- })]);
9922
- /** A stored composition block and what the composer says about it. */
9923
- var CompositionViewSchema = z.object({
9924
- block: CoreBlockSchema,
9925
- state: CompositionStateReadSchema
9926
- });
9927
10055
  /**
9928
- * A read of the stored compositions. `not-loaded` while the `core_blocks`
9929
- * table has not been READ: an empty answer then would make "not yet known"
9930
- * look like "none", and invite the operator to recreate what exists (D315).
10056
+ * How a planned field says "unavailable", per feature mode and AFTER `roleOf`
10057
+ * (D393, D663 rulings S1 + S1b). The composer cannot take a device it does not
10058
+ * own offline, and D393 forbids a stale number, so on an existing target a
10059
+ * field that READS a source never gets `offline`.
9931
10060
  */
9932
- var CompositionsNotLoadedSchema = z.object({
9933
- state: z.literal("not-loaded"),
9934
- reason: z.string()
9935
- });
9936
- var CompositionListReadSchema = z.discriminatedUnion("state", [z.object({
9937
- state: z.literal("loaded"),
9938
- views: z.array(CompositionViewSchema)
9939
- }), CompositionsNotLoadedSchema]);
9940
- var CompositionGetReadSchema = z.discriminatedUnion("state", [z.object({
9941
- state: z.literal("loaded"),
9942
- view: CompositionViewSchema.nullable()
9943
- }), CompositionsNotLoadedSchema]);
9944
- /** The customization of one existing device, found by its TARGET, or `not-loaded` (D315). */
9945
- var CompositionCustomizationReadSchema = z.discriminatedUnion("state", [z.object({
9946
- state: z.literal("loaded"),
9947
- view: CompositionViewSchema.nullable()
9948
- }), CompositionsNotLoadedSchema]);
9949
- /** What a compile attempt produced. */
9950
- var CoreBlockCompileResultSchema = z.object({
9951
- ok: z.boolean(),
9952
- /** Present when `ok` is false — the first error, in the author's words. */
9953
- error: z.string().optional(),
9954
- line: z.number().optional(),
9955
- column: z.number().optional()
9956
- });
9957
- var coreBlocksCapability = {
9958
- name: "core-blocks",
9959
- scope: "system",
9960
- mode: "singleton",
9961
- methods: {
9962
- list: method(z.object({}), z.object({ blocks: z.array(CoreBlockSchema) }), { auth: "admin" }),
9963
- get: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }),
9964
- /**
9965
- * Create a block. The code is COMPILED first: storing source that does not
9966
- * compile turns an editor error into a fork failure the operator meets
9967
- * minutes later in a log.
9968
- */
9969
- create: method(z.object({ block: CoreBlockInputSchema }), z.object({ block: CoreBlockSchema }), {
9970
- kind: "mutation",
9971
- auth: "admin",
9972
- caller: "required"
9973
- }),
9974
- update: method(z.object({
9975
- blockId: z.string(),
9976
- block: CoreBlockInputSchema.partial()
9977
- }), z.object({ block: CoreBlockSchema }), {
9978
- kind: "mutation",
9979
- auth: "admin",
9980
- caller: "required"
9981
- }),
9982
- delete: method(z.object({ blockId: z.string() }), z.object({ success: z.literal(true) }), {
9983
- kind: "mutation",
9984
- auth: "admin"
9985
- }),
9986
- setEnabled: method(z.object({
9987
- blockId: z.string(),
9988
- enabled: z.boolean()
9989
- }), z.object({ block: CoreBlockSchema }), {
9990
- kind: "mutation",
9991
- auth: "admin"
9992
- }),
9993
- /**
9994
- * Stop this block's runner and let the supervisor bring it back.
9995
- *
9996
- * **It stores nothing.** There is no "restart requested" flag and no second
9997
- * lifecycle field: the supervisor already stops and respawns a runner when
9998
- * the code hash changes, and this exposes that same path deliberately
9999
- * (D62 — a switch writes the authority that already owned the function).
10000
- * The next reconcile pass remains the authority, so a restart that lost a
10001
- * race is corrected within one pass rather than leaving a stale flag behind.
10002
- *
10003
- * Refused for a DISABLED block: nothing would come back, and a button that
10004
- * silently does nothing is worse than one that says why.
10005
- */
10006
- restart: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema }), {
10007
- kind: "mutation",
10008
- auth: "admin"
10009
- }),
10010
- /**
10011
- * Type-check without saving — what the editor calls as the author types, so
10012
- * the compiler's verdict is the same one the server will reach.
10013
- */
10014
- compile: method(z.object({ code: z.string() }), CoreBlockCompileResultSchema, {
10015
- kind: "mutation",
10016
- auth: "admin"
10017
- }),
10018
- /**
10019
- * The declaration files the editor type-checks against.
10020
- *
10021
- * Served rather than bundled: the graph is 3.4 MB across 344 files, and
10022
- * bundling it would roughly double the admin remote. Served rather than
10023
- * hand-stubbed: a block runs with the same `ctx` an addon gets, so a stub
10024
- * would drift and the editor would confidently autocomplete methods that
10025
- * do not exist.
10026
- */
10027
- getTypeDefs: method(z.object({}), z.object({ libs: z.array(z.object({
10028
- filePath: z.string(),
10029
- content: z.string()
10030
- })) }), { auth: "admin" }),
10031
- /**
10032
- * Create a composition block (D659). VALIDATED first against the live
10061
+ function unavailableFor(tf, role, mode, cap, at) {
10062
+ if (mode === "replace" && (role === "derived" || role === "accumulator")) return {
10063
+ ok: true,
10064
+ unavailable: "release"
10065
+ };
10066
+ if (mode === "new" || role !== "derived") return {
10067
+ ok: true,
10068
+ unavailable: tf.nullable ? "null" : "offline"
10069
+ };
10070
+ if (tf.nullable) return {
10071
+ ok: true,
10072
+ unavailable: "null"
10073
+ };
10074
+ if (tf.enumValues?.includes("unknown") === true) return {
10075
+ ok: true,
10076
+ unavailable: "unknown"
10077
+ };
10078
+ return {
10079
+ ok: false,
10080
+ problem: problem("not-replaceable", at, `\`${cap}.${tf.path}\` reads a source but can say neither null nor 'unknown', and an ADDED capability has no native reading to fall back to (D393, D663)`)
10081
+ };
10082
+ }
10083
+ //#endregion
10084
+ //#region src/composition/composition-items.ts
10085
+ /** Item fields the composer writes itself, with the value it writes. */
10086
+ var COMPOSED_ITEM_FIXED_FIELDS = { resettable: false };
10087
+ function reservedItemFields(itemArray) {
10088
+ return new Set([
10089
+ itemArray.keyField,
10090
+ ...itemArray.labelField === void 0 ? [] : [itemArray.labelField],
10091
+ ...Object.keys(COMPOSED_ITEM_FIXED_FIELDS)
10092
+ ]);
10093
+ }
10094
+ /** A required leaf under an optional parent is required only once something writes that parent. */
10095
+ function leafRequired(itemArray, path, written) {
10096
+ const described = describeStateField(itemArray.itemSchema, path);
10097
+ if (described === null || !described.required) return false;
10098
+ return optionalAncestors(itemArray.itemSchema, path).every((parent) => written.some((w) => w.startsWith(`${parent}.`)));
10099
+ }
10100
+ function missingLeaves({ capName, itemArray, reserved }, item, at) {
10101
+ const written = Object.keys(item.fields);
10102
+ return enumerateSchemaFields(itemArray.itemSchema).flatMap((leaf) => {
10103
+ if (reserved.has(leaf.path) || leaf.path in item.fields) return [];
10104
+ if (!leafRequired(itemArray, leaf.path, written)) return [];
10105
+ const described = describeStateField(itemArray.itemSchema, leaf.path);
10106
+ if (described === null || described.nullable) return [];
10107
+ return [problem("missing-field", `${at}.fields.${leaf.path}`, `\`${capName}.${itemArray.path}[].${leaf.path}\` is required and has no source`)];
10108
+ });
10109
+ }
10110
+ function planItemField(ctx, leaf) {
10111
+ const { capName, itemArray, featureIndex, lookupCap } = ctx;
10112
+ const { key, label, path, source } = leaf;
10113
+ const at = `features[${featureIndex}].items.${key}.fields.${path}`;
10114
+ if (ctx.reserved.has(path)) return refused(problem("item-field-reserved", at, `\`${capName}.${itemArray.path}[].${path}\` is set by the composer itself — it takes no source`));
10115
+ const tf = describeStateField(itemArray.itemSchema, path);
10116
+ if (tf === null) return refused(problem("unknown-field", at, `a \`${capName}\` item has no field \`${path}\``));
10117
+ const kinds = sourceKinds(source, lookupCap);
10118
+ if (!kinds.ok) return refused(problem(kinds.code, at, kinds.message));
10119
+ const role = roleOf(source);
10120
+ const unavailable = unavailableFor(tf, role, ctx.mode, capName, at);
10121
+ if (!unavailable.ok) return refused(unavailable.problem);
10122
+ const plan = {
10123
+ cap: capName,
10124
+ path,
10125
+ item: {
10126
+ arrayPath: itemArray.path,
10127
+ key,
10128
+ label
10129
+ },
10130
+ featureIndex,
10131
+ kind: tf.kind,
10132
+ nullable: tf.nullable,
10133
+ required: tf.required,
10134
+ unavailable: unavailable.unavailable,
10135
+ role,
10136
+ source,
10137
+ reads: [...fieldReads(source)]
10138
+ };
10139
+ const enumProblem = enumLiteralProblem(capName, tf, source, at);
10140
+ return {
10141
+ problems: [...compatibility(capName, tf, kinds.kinds, at), ...enumProblem === null ? [] : [enumProblem]],
10142
+ fields: [plan],
10143
+ features: [],
10144
+ events: []
10145
+ };
10146
+ }
10147
+ function planItems(def, feature, featureIndex, lookupCap, mode = "new") {
10148
+ const at = `features[${featureIndex}].items`;
10149
+ const itemArray = def.status?.itemArray;
10150
+ if (itemArray === void 0) return refused(problem("not-item-array", at, `\`${def.name}\` has no item array — it takes no \`items\``));
10151
+ if (itemArray.path !== "items") return refused(problem("not-item-array", at, `\`${def.name}\`'s item array is at \`${itemArray.path}\`, not \`${COMPOSITION_ITEM_ARRAY_PATH}\` — not composable yet`));
10152
+ const ctx = {
10153
+ capName: def.name,
10154
+ itemArray,
10155
+ reserved: reservedItemFields(itemArray),
10156
+ featureIndex,
10157
+ lookupCap,
10158
+ mode
10159
+ };
10160
+ const results = Object.entries(feature.items ?? {}).flatMap(([key, item]) => [{
10161
+ problems: missingLeaves(ctx, item, `${at}.${key}`),
10162
+ fields: [],
10163
+ features: [],
10164
+ events: []
10165
+ }, ...Object.entries(item.fields).map(([path, source]) => planItemField(ctx, {
10166
+ key,
10167
+ label: item.label,
10168
+ path,
10169
+ source
10170
+ }))]);
10171
+ return {
10172
+ problems: results.flatMap((r) => r.problems),
10173
+ fields: results.flatMap((r) => r.fields),
10174
+ features: [],
10175
+ events: []
10176
+ };
10177
+ }
10178
+ //#endregion
10179
+ //#region src/composition/composition-graph.ts
10180
+ /**
10181
+ * The field graph across every composition, and the cycles in it (D659).
10182
+ *
10183
+ * A node is ONE field of ONE device (`<addon>/<stableId>#<cap>.<field>`); an
10184
+ * edge points from a composed field to each field it reads. A cycle, direct or
10185
+ * through another composition, is refused at save by name (spec §2).
10186
+ *
10187
+ * The graph is built for ONE save: the CANDIDATE composition (the one being
10188
+ * validated) plus every STORED composition. The candidate replaces its own old
10189
+ * version, identified BY BLOCK ID wherever it sits in `stored` — whether a save
10190
+ * introduces or removes a cycle must never depend on array order. A DIFFERENT
10191
+ * block targeting the candidate's device is refused by name: one composition
10192
+ * per device (D663). Two different stored peers that (wrongly) target the same
10193
+ * device are corrupted state, not a cycle to resolve by picking one silently;
10194
+ * that is refused by name too (D391).
10195
+ *
10196
+ * A customization of an EXISTING device reads that device's NATIVE value for a
10197
+ * field it replaces or does not write ("Invert state" reads the `on` it
10198
+ * replaces): such a self-read is no edge, so it is never a cycle (D663).
10199
+ * Another composition reading that field reads the customizer's output.
10200
+ *
10201
+ * `findCompositionCycles` reports at least one cycle per cycle-SET (the DFS
10202
+ * marks a node `done` after its first expansion) — not every elementary cycle
10203
+ * through a shared node, so the path it names may AVOID the candidate while
10204
+ * one through it goes unreported. What a save refuses is therefore decided per
10205
+ * strongly connected component (`findCandidateCycles`, C-1). A dotted
10206
+ * `fieldPath` is matched only as an exact string: a write to `state.value` and
10207
+ * a read of `state` would not connect (no nested field writes exist yet).
10208
+ *
10209
+ * An item leaf is its own node, `…#consumables.items[desiccant].status`
10210
+ * (`featureFieldEntries`), so two items sharing an inner path never merge. No
10211
+ * READ can name an array element (`describeStateField` never describes one),
10212
+ * so an item node is write-only: its edges to sources are what the check needs.
10213
+ */
10214
+ /** Two blocks' compositions target the same device — refused by name, never silently resolved. */
10215
+ var CompositionGraphError = class extends Error {};
10216
+ /** `"cap.field"` of every field a peer writes — the same spelling as `compositionFieldKey`. */
10217
+ function writtenFields(peer) {
10218
+ return new Set(peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath }) => `${feature.cap}.${fieldPath}`)));
10219
+ }
10220
+ /** A read of the peer's OWN device is an edge only when it reads the peer's own output (rule 5, D663). */
10221
+ function readsComposedValue(peer, written, read) {
10222
+ if (compositionSourceKey(read.source) !== compositionSourceKey(peer.target)) return true;
10223
+ const field = `${read.cap}.${read.fieldPath}`;
10224
+ return written.has(field) && peer.replaced?.has(field) !== true;
10225
+ }
10226
+ function peerEdges(peer) {
10227
+ const written = writtenFields(peer);
10228
+ return peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath, source }) => [compositionReadKey({
10229
+ source: peer.target,
10230
+ cap: feature.cap,
10231
+ fieldPath
10232
+ }), fieldReads(source).filter((read) => readsComposedValue(peer, written, read)).map(compositionReadKey)]));
10233
+ }
10234
+ /**
10235
+ * Every peer that actually takes part in the graph: each stored peer minus the
10236
+ * candidate's own old version (same block id — the drop happens before any
10237
+ * edge is built, so its old edges never enter the map), plus the candidate
10238
+ * itself, exactly once. Throws {@link CompositionGraphError} when a DIFFERENT
10239
+ * block targets the candidate's device, or two stored peers share a device.
10240
+ */
10241
+ function resolvedPeers(candidate, stored) {
10242
+ const candidateKey = compositionSourceKey(candidate.target);
10243
+ const survivors = /* @__PURE__ */ new Map();
10244
+ for (const peer of stored) {
10245
+ if (peer.blockId === candidate.blockId) continue;
10246
+ const key = compositionSourceKey(peer.target);
10247
+ if (key === candidateKey) throw new CompositionGraphError(`block \`${peer.blockId}\` and block \`${candidate.blockId}\` both target device \`${key}\` — one composition per device; delete or edit the existing one`);
10248
+ const clash = survivors.get(key);
10249
+ if (clash !== void 0) throw new CompositionGraphError(`two stored compositions (\`${clash.blockId}\`, \`${peer.blockId}\`) both target device \`${key}\` — refusing to build the field graph`);
10250
+ survivors.set(key, peer);
10251
+ }
10252
+ return [...survivors.values(), candidate];
10253
+ }
10254
+ function compositionEdges(candidate, stored) {
10255
+ const edges = resolvedPeers(candidate, stored).flatMap(peerEdges);
10256
+ return new Map(edges);
10257
+ }
10258
+ function findCompositionCycles(candidate, stored) {
10259
+ const edges = compositionEdges(candidate, stored);
10260
+ const marks = /* @__PURE__ */ new Map();
10261
+ const found = /* @__PURE__ */ new Map();
10262
+ const visit = (node, stack) => {
10263
+ const mark = marks.get(node);
10264
+ if (mark === "done") return;
10265
+ if (mark === "visiting") {
10266
+ const path = [...stack.slice(stack.indexOf(node)), node];
10267
+ const id = [...new Set(path)].toSorted().join("|");
10268
+ if (!found.has(id)) found.set(id, { path });
10269
+ return;
10270
+ }
10271
+ marks.set(node, "visiting");
10272
+ for (const next of edges.get(node) ?? []) visit(next, [...stack, node]);
10273
+ marks.set(node, "done");
10274
+ };
10275
+ for (const node of edges.keys()) visit(node, []);
10276
+ return [...found.values()];
10277
+ }
10278
+ /** Tarjan's strongly connected components over every node of the graph (sources included). */
10279
+ function stronglyConnected(edges) {
10280
+ const index = /* @__PURE__ */ new Map();
10281
+ const low = /* @__PURE__ */ new Map();
10282
+ const onStack = /* @__PURE__ */ new Set();
10283
+ const stack = [];
10284
+ const components = [];
10285
+ const connect = (node) => {
10286
+ index.set(node, index.size);
10287
+ low.set(node, index.get(node) ?? 0);
10288
+ stack.push(node);
10289
+ onStack.add(node);
10290
+ for (const next of edges.get(node) ?? []) if (!index.has(next)) {
10291
+ connect(next);
10292
+ low.set(node, Math.min(low.get(node) ?? 0, low.get(next) ?? 0));
10293
+ } else if (onStack.has(next)) low.set(node, Math.min(low.get(node) ?? 0, index.get(next) ?? 0));
10294
+ if (low.get(node) !== index.get(node)) return;
10295
+ const component = [];
10296
+ for (let member = stack.pop(); member !== void 0; member = stack.pop()) {
10297
+ onStack.delete(member);
10298
+ component.push(member);
10299
+ if (member === node) break;
10300
+ }
10301
+ components.push(component);
10302
+ };
10303
+ for (const node of edges.keys()) if (!index.has(node)) connect(node);
10304
+ return components;
10305
+ }
10306
+ /** The shortest walk from `start` back to itself inside `component` (one exists: the component has a cycle). */
10307
+ function cycleThrough(start, component, edges) {
10308
+ const parent = /* @__PURE__ */ new Map();
10309
+ const queue = [start];
10310
+ for (let head = 0; head < queue.length; head += 1) {
10311
+ const node = queue[head];
10312
+ if (node === void 0) break;
10313
+ for (const next of edges.get(node) ?? []) {
10314
+ if (next === start) {
10315
+ const chain = [];
10316
+ for (let at = node; at !== void 0 && at !== start; at = parent.get(at)) chain.push(at);
10317
+ return [
10318
+ start,
10319
+ ...chain.reverse(),
10320
+ start
10321
+ ];
10322
+ }
10323
+ if (!component.has(next) || parent.has(next)) continue;
10324
+ parent.set(next, node);
10325
+ queue.push(next);
10326
+ }
10327
+ }
10328
+ return [start, start];
10329
+ }
10330
+ /**
10331
+ * The cycles THIS save closes, decided per strongly connected component — never
10332
+ * per reported DFS path, which names one back-edge per revisit and can report a
10333
+ * component's cycle by a path that avoids the candidate while the one through it
10334
+ * goes unreported. A component refuses when it holds a candidate node and a
10335
+ * cycle (more than one node, or a self-loop). Components without a candidate
10336
+ * node are not this save's cycles.
10337
+ */
10338
+ function findCandidateCycles(candidate, stored) {
10339
+ const edges = compositionEdges(candidate, stored);
10340
+ const prefix = `${compositionSourceKey(candidate.target)}#`;
10341
+ return stronglyConnected(edges).flatMap((members) => {
10342
+ const start = members.find((n) => n.startsWith(prefix));
10343
+ if (start === void 0) return [];
10344
+ const component = new Set(members);
10345
+ const selfLoop = members.length === 1 && (edges.get(start) ?? []).includes(start);
10346
+ if (members.length === 1 && !selfLoop) return [];
10347
+ return [{
10348
+ path: cycleThrough(start, component, edges),
10349
+ component
10350
+ }];
10351
+ });
10352
+ }
10353
+ //#endregion
10354
+ //#region src/composition/validate-composition.ts
10355
+ function buildCapabilityLookup(defs) {
10356
+ const byName = new Map(defs.map((d) => [d.name, d]));
10357
+ return (capName) => byName.get(capName) ?? null;
10358
+ }
10359
+ /** Caps every `BaseDevice` registers on itself; a second registration throws. */
10360
+ var BASE_DEVICE_CAPS = new Set(["device-status", "feature-probe"]);
10361
+ var PENDING_SELF = {
10362
+ addonId: COMPOSER_ADDON_ID,
10363
+ stableId: `${COMPOSED_DEVICE_STABLE_ID_PREFIX}(unsaved)`
10364
+ };
10365
+ /** The candidate's block id before its first save. Stored block ids are `randomUUID()`, so none can carry it. */
10366
+ var PENDING_BLOCK_ID = "(unsaved)";
10367
+ function composableCap(feature, at, lookupCap) {
10368
+ const def = lookupCap(feature.cap);
10369
+ if (def === null) return problem("unknown-capability", `${at}.cap`, `no capability is named \`${feature.cap}\``);
10370
+ if (BASE_DEVICE_CAPS.has(def.name)) return problem("not-composable", `${at}.cap`, `\`${def.name}\` is registered by every device itself — it cannot be composed`);
10371
+ const state = def.runtimeState;
10372
+ if (def.scope !== "device" || state === void 0) return problem("not-composable", `${at}.cap`, `\`${def.name}\` has no per-device state to compose`);
10373
+ return {
10374
+ def,
10375
+ state,
10376
+ fields: describeTopLevelStateFields(state)
10377
+ };
10378
+ }
10379
+ /**
10380
+ * A capability BUILT by the composition (a new device, or one ADDED to an
10381
+ * existing device) must fit the device type, serve no command, and have every
10382
+ * required field. A REPLACE needs none of it: the cap is bound (a fact), the
10383
+ * native keeps serving its methods, and only the named fields are owned (D663).
10384
+ */
10385
+ function builtCapProblems({ def, state, fields: targetFields }, feature, at, deviceType) {
10386
+ const problems = [];
10387
+ if (def.deviceTypes !== void 0 && !def.deviceTypes.includes(deviceType)) problems.push(problem("wrong-device-type", `${at}.cap`, `\`${def.name}\` is not offered on a \`${deviceType}\` device (it allows ${def.deviceTypes.join(", ")})`));
10388
+ const served = Object.entries(def.methods).filter(([name, m]) => m.systemOnly !== true && def.composedMethods?.[name] === void 0).map(([name]) => `\`${name}\``);
10389
+ if (served.length > 0) problems.push(problem("has-commands", `${at}.cap`, `\`${def.name}\` has ${served.join(", ")}, which a composed device cannot serve until commands arrive (slice 3)`));
10390
+ const itemArrayPath = feature.items === void 0 ? null : def.status?.itemArray?.path ?? null;
10391
+ for (const key of requiredTopLevelKeys(state)) {
10392
+ if (key === itemArrayPath) continue;
10393
+ if (!targetFields.has(key)) problems.push(problem("not-composable", `${at}.fields`, `\`${def.name}.${key}\` is not a scalar — nested fields arrive in a later slice`));
10394
+ else if (!(key in feature.fields)) problems.push(problem("missing-field", `${at}.fields.${key}`, `\`${def.name}.${key}\` is required and has no source`));
10395
+ }
10396
+ return problems;
10397
+ }
10398
+ function planTopLevelField({ def, fields }, field, mode, lookupCap) {
10399
+ const { featureIndex, path, source } = field;
10400
+ const fieldAt = `features[${featureIndex}].fields.${path}`;
10401
+ if (path.includes(".")) return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — nested fields arrive in a later slice`));
10402
+ const tf = fields.get(path);
10403
+ if (tf === void 0) return refused(problem("unknown-field", fieldAt, `\`${def.name}\` has no field \`${path}\``));
10404
+ const kinds = sourceKinds(source, lookupCap);
10405
+ if (!kinds.ok) return refused(problem(kinds.code, fieldAt, kinds.message));
10406
+ const role = roleOf(source);
10407
+ const unavailable = unavailableFor(tf, role, mode, def.name, fieldAt);
10408
+ if (!unavailable.ok) return refused(unavailable.problem);
10409
+ const plan = {
10410
+ cap: def.name,
10411
+ path,
10412
+ featureIndex,
10413
+ kind: tf.kind,
10414
+ nullable: tf.nullable,
10415
+ required: tf.required,
10416
+ unavailable: unavailable.unavailable,
10417
+ role,
10418
+ source,
10419
+ reads: [...fieldReads(source)]
10420
+ };
10421
+ const enumProblem = enumLiteralProblem(def.name, tf, source, fieldAt);
10422
+ return {
10423
+ problems: [...compatibility(def.name, tf, kinds.kinds, fieldAt), ...enumProblem === null ? [] : [enumProblem]],
10424
+ fields: [plan],
10425
+ features: [],
10426
+ events: []
10427
+ };
10428
+ }
10429
+ function planFeature(feature, featureIndex, target, lookupCap) {
10430
+ const at = `features[${featureIndex}]`;
10431
+ const cap = composableCap(feature, at, lookupCap);
10432
+ if ("code" in cap) return refused(cap);
10433
+ const capProblems = target.mode === "replace" ? [] : [...builtCapProblems(cap, feature, at, target.deviceType)];
10434
+ if (feature.commands !== void 0 && Object.keys(feature.commands).length > 0) capProblems.push(problem("reserved-variant", `${at}.commands`, "commands (`forward`) arrive in slice 3"));
10435
+ const perField = Object.entries(feature.fields).map(([path, source]) => planTopLevelField(cap, {
10436
+ featureIndex,
10437
+ path,
10438
+ source
10439
+ }, target.mode, lookupCap));
10440
+ const items = feature.items === void 0 ? [] : [planItems(cap.def, feature, featureIndex, lookupCap, target.mode)];
10441
+ const all = [...perField, ...items];
10442
+ const fields = all.flatMap((result) => result.fields);
10443
+ const featurePlan = {
10444
+ featureIndex,
10445
+ cap: cap.def.name,
10446
+ mode: target.mode
10447
+ };
10448
+ const eventPlan = planCompositionEvents(cap.def, featurePlan, fields);
10449
+ return {
10450
+ problems: [
10451
+ ...capProblems,
10452
+ ...all.flatMap((r) => r.problems),
10453
+ ...eventPlan.problems
10454
+ ],
10455
+ fields,
10456
+ features: [featurePlan],
10457
+ events: eventPlan.events
10458
+ };
10459
+ }
10460
+ /** A cap the device serves itself; one the composer grafted (an earlier ADD) is not native. */
10461
+ function isNativeCap(target, cap) {
10462
+ const owner = target.nativeCaps.get(cap);
10463
+ return owner !== void 0 && owner !== "composer";
10464
+ }
10465
+ /** The target read, or the refusal that replaces the whole plan when it could not be (D391). */
10466
+ function planTargetOf(composition, target) {
10467
+ if (composition.target.kind === "new") return {
10468
+ kind: "new",
10469
+ type: composition.target.type
10470
+ };
10471
+ const key = compositionSourceKey(composition.target.device);
10472
+ if (target === void 0) return problem("target-unreadable", "target", `target device \`${key}\` was not read — the save is refused rather than stored unchecked`);
10473
+ if (target.kind === "absent") return problem("target-missing", "target", `target device \`${key}\` does not exist`);
10474
+ if (target.kind === "unreadable") return problem("target-unreadable", "target", `could not read target device \`${key}\` (${target.error}) — the save is refused rather than stored unchecked`);
10475
+ return {
10476
+ kind: "existing",
10477
+ found: target
10478
+ };
10479
+ }
10480
+ function featureTargetOf(target, cap) {
10481
+ if (target.kind === "new") return {
10482
+ mode: "new",
10483
+ deviceType: target.type
10484
+ };
10485
+ return {
10486
+ mode: isNativeCap(target.found, cap) ? "replace" : "add",
10487
+ deviceType: target.found.type
10488
+ };
10489
+ }
10490
+ /**
10491
+ * The static plan. `target` describes an EXISTING target device (one read);
10492
+ * it is ignored for a new one. On an existing target each feature REPLACES a
10493
+ * cap the device has natively, else ADDS it (D663).
10494
+ */
10495
+ function planComposition(composition, lookupCap, target) {
10496
+ const planTarget = planTargetOf(composition, target);
10497
+ if ("code" in planTarget) return refused(planTarget);
10498
+ const results = composition.features.map((feature, index) => {
10499
+ const result = feature.kind === "passthrough" ? refused(problem("reserved-variant", `features[${index}]`, `whole-capability passthrough of \`${feature.cap}\` arrives in slice 3`)) : planFeature(feature, index, featureTargetOf(planTarget, feature.cap), lookupCap);
10500
+ return compositionFeatureEnabled(feature) ? result : {
10501
+ problems: result.problems,
10502
+ fields: [],
10503
+ features: [],
10504
+ events: []
10505
+ };
10506
+ });
10507
+ return {
10508
+ problems: results.flatMap((r) => r.problems),
10509
+ fields: results.flatMap((r) => r.fields),
10510
+ features: results.flatMap((r) => r.features),
10511
+ events: results.flatMap((r) => r.events)
10512
+ };
10513
+ }
10514
+ function compositionSourceRefs(composition) {
10515
+ const refs = composition.features.flatMap((f) => compositionFeatureEnabled(f) && f.kind === "fields" ? featureSources(f).flatMap(fieldReads).map((r) => r.source) : []);
10516
+ return [...new Map(refs.map((r) => [compositionSourceKey(r), r])).values()];
10517
+ }
10518
+ /**
10519
+ * The candidate's device: the existing target itself, else `self`, else a
10520
+ * placeholder that cannot collide with a stored target. An existing target is
10521
+ * known even on create, so a second customization of it is refused on create too.
10522
+ */
10523
+ function candidateSelf(composition, ctx, plan) {
10524
+ return {
10525
+ ref: composition.target.kind === "existing" ? composition.target.device : ctx.self ?? PENDING_SELF,
10526
+ native: composition.target.kind === "existing" && ctx.target?.kind === "found" ? ctx.target : null,
10527
+ replaced: replacedFieldKeys(plan)
10528
+ };
10529
+ }
10530
+ /**
10531
+ * `compositionFieldKey` of every field a REPLACE feature of `plan` owns — the
10532
+ * candidate's own, and a stored peer's `CompositionPeer.replaced` (D663): one
10533
+ * derivation, so the graph reads both the same way.
10534
+ */
10535
+ function replacedFieldKeys(plan) {
10536
+ const replacing = new Set(plan.features.filter((f) => f.mode === "replace").map((f) => f.featureIndex));
10537
+ return new Set(plan.fields.filter((f) => replacing.has(f.featureIndex)).map(compositionFieldKey));
10538
+ }
10539
+ /**
10540
+ * A read of the candidate's own device. Its own composed output (a new device's
10541
+ * field, an ADDED field) is the slice-1 own-field rule; on an existing target
10542
+ * every other field — replaced, or not composed at all — is the NATIVE value,
10543
+ * valid when the device serves that cap natively (D663, rule 5).
10544
+ */
10545
+ function selfReadProblems(read, at, fields, self) {
10546
+ const readKey = `${read.cap}.${read.fieldPath}`;
10547
+ if (fields.some((f) => compositionFieldKey(f) === readKey && !self.replaced.has(readKey))) return [];
10548
+ if (self.native === null) return [problem("source-field-unknown", at, `this device has no composed field \`${read.cap}.${read.fieldPath}\``)];
10549
+ if (isNativeCap(self.native, read.cap)) return [];
10550
+ return [problem("source-capability-missing", at, `the target device (device ${self.native.deviceId}) has no native \`${read.cap}\``)];
10551
+ }
10552
+ function sourceProblems(fields, ctx, self) {
10553
+ const selfKey = compositionSourceKey(self.ref);
10554
+ return fields.flatMap((field) => field.reads.flatMap((read) => {
10555
+ const at = compositionFieldAt(field);
10556
+ const key = compositionSourceKey(read.source);
10557
+ if (key === selfKey) return selfReadProblems(read, at, fields, self);
10558
+ const desc = ctx.sources.get(key);
10559
+ if (desc === void 0 || desc.kind === "unreadable") return [problem("source-unreadable", at, `could not read source \`${key}\` (${desc === void 0 ? "it was not read" : desc.error}) — the save is refused rather than stored unchecked`)];
10560
+ if (desc.kind === "absent") return [problem("source-missing", at, `source \`${key}\` does not exist`)];
10561
+ if (!desc.caps.has(read.cap)) return [problem("source-capability-missing", at, `source \`${key}\` (device ${desc.deviceId}) has no \`${read.cap}\``)];
10562
+ return [];
10563
+ }));
10564
+ }
10565
+ /**
10566
+ * A cycle's node keys are `compositionReadKey` strings:
10567
+ * `<addonId>/<stableId>#<cap>.<fieldPath>`. When a node belongs to the
10568
+ * CANDIDATE itself (this composition being saved), pull its `cap`/`fieldPath`
10569
+ * back out so the refusal can point at that exact field, matching the
10570
+ * documented `features[N].fields.<path>` convention. A cap name has no `.`,
10571
+ * so splitting `rest` on the FIRST `.` is exact; an item leaf's remainder
10572
+ * (`items[desiccant].status`) is matched through `compositionFieldKey`.
10573
+ */
10574
+ function candidateFieldOfNode(nodeKey, candidateKey) {
10575
+ const prefix = `${candidateKey}#`;
10576
+ if (!nodeKey.startsWith(prefix)) return null;
10577
+ const rest = nodeKey.slice(prefix.length);
10578
+ const dot = rest.indexOf(".");
10579
+ if (dot === -1) return null;
10580
+ return {
10581
+ cap: rest.slice(0, dot),
10582
+ fieldPath: rest.slice(dot + 1)
10583
+ };
10584
+ }
10585
+ /** The first node of a cycle's path that is one of THIS composition's own
10586
+ * planned fields, as a documented-convention path; `'features'` when the
10587
+ * cycle runs entirely through other stored compositions. */
10588
+ function cyclePath(nodePath, candidateKey, fields) {
10589
+ for (const nodeKey of nodePath) {
10590
+ const hit = candidateFieldOfNode(nodeKey, candidateKey);
10591
+ if (hit === null) continue;
10592
+ const hitKey = `${hit.cap}.${hit.fieldPath}`;
10593
+ const field = fields.find((f) => compositionFieldKey(f) === hitKey);
10594
+ if (field !== void 0) return compositionFieldAt(field);
10595
+ }
10596
+ return "features";
10597
+ }
10598
+ /** The first unread device any of `nodes` belongs to; null when none does. */
10599
+ function unreadDeviceOf(nodes, unread) {
10600
+ for (const [key, error] of unread) if (nodes.some((node) => node.startsWith(`${key}#`))) return {
10601
+ key,
10602
+ error
10603
+ };
10604
+ return null;
10605
+ }
10606
+ /**
10607
+ * Cycle check runs against the CANDIDATE (this composition, as block
10608
+ * `ctx.blockId`, writing `self.ref`) plus every OTHER stored composition,
10609
+ * decided per strongly connected component (`findCandidateCycles`): a cyclic
10610
+ * component holding a candidate node refuses, with one representative cycle
10611
+ * through it; one without is not this save's cycle. A
10612
+ * stored composition of the same block is its old version; another block on
10613
+ * the same device, or two stored peers sharing a device, make
10614
+ * `compositionEdges` throw `CompositionGraphError` — refused BY NAME as
10615
+ * `duplicate-target` (D391, D663) instead of escaping as an uncaught throw.
10616
+ */
10617
+ function cycleProblems(composition, ctx, fields, self) {
10618
+ const candidate = {
10619
+ blockId: ctx.blockId ?? "(unsaved)",
10620
+ target: self.ref,
10621
+ composition,
10622
+ replaced: self.replaced
10623
+ };
10624
+ const candidateKey = compositionSourceKey(candidate.target);
10625
+ const unread = ctx.unreadTargets ?? /* @__PURE__ */ new Map();
10626
+ try {
10627
+ return findCandidateCycles(candidate, ctx.peers).map((c) => {
10628
+ const at = cyclePath(c.path, candidateKey, fields);
10629
+ const through = unreadDeviceOf([...c.component], unread);
10630
+ return through === null ? problem("cycle", at, `a field reads itself: ${c.path.join(" → ")}`) : problem("cycle", at, `possible cycle through \`${through.key}\` — its state could not be read (${through.error}): ${c.path.join(" → ")}`);
10631
+ });
10632
+ } catch (err) {
10633
+ if (err instanceof CompositionGraphError) return [problem("duplicate-target", "features", err.message)];
10634
+ throw err;
10635
+ }
10636
+ }
10637
+ function validateComposition(composition, ctx) {
10638
+ const plan = planComposition(composition, ctx.lookupCap, ctx.target ?? void 0);
10639
+ const self = candidateSelf(composition, ctx, plan);
10640
+ const cycles = cycleProblems(composition, ctx, plan.fields, self);
10641
+ const problems = [
10642
+ ...plan.problems,
10643
+ ...sourceProblems(plan.fields, ctx, self),
10644
+ ...cycles
10645
+ ];
10646
+ return {
10647
+ ok: problems.length === 0,
10648
+ problems,
10649
+ fields: [...plan.fields],
10650
+ features: [...plan.features],
10651
+ events: [...plan.events]
10652
+ };
10653
+ }
10654
+ //#endregion
10655
+ //#region src/composition/composable-caps.ts
10656
+ /**
10657
+ * What a composition may BUILD on a device type (G2, D676): the caps a new
10658
+ * device of that type, or an existing one that lacks them, can be given. The
10659
+ * blockers are the validator's own refusal codes, and a spec compares this
10660
+ * listing with `planComposition` for every capability — the editor can never
10661
+ * offer a feature the save would refuse for the same reason.
10662
+ */
10663
+ var ComposableFieldSchema = z.object({
10664
+ path: z.string(),
10665
+ kind: CompositionFieldKindSchema,
10666
+ nullable: z.boolean(),
10667
+ required: z.boolean(),
10668
+ enumValues: z.array(z.string()).optional()
10669
+ });
10670
+ var ComposableCapabilitySchema = z.object({
10671
+ cap: z.string(),
10672
+ fields: z.array(ComposableFieldSchema),
10673
+ /** Present for an item-array cap (`consumables.items`). */
10674
+ itemArray: z.object({
10675
+ path: z.string(),
10676
+ keyField: z.string()
10677
+ }).optional()
10678
+ });
10679
+ var ComposableCapabilitiesSchema = z.object({ caps: z.array(ComposableCapabilitySchema) });
10680
+ /** Why a cap cannot be BUILT (new device, or added to an existing one) on `deviceType`; [] = it can. */
10681
+ function builtCapabilityBlockers(def, deviceType) {
10682
+ if (BASE_DEVICE_CAPS.has(def.name)) return ["not-composable"];
10683
+ const state = def.runtimeState;
10684
+ if (def.scope !== "device" || state === void 0) return ["not-composable"];
10685
+ const blockers = [];
10686
+ if (def.deviceTypes !== void 0 && !def.deviceTypes.includes(deviceType)) blockers.push("wrong-device-type");
10687
+ if (Object.entries(def.methods).filter(([name, m]) => m.systemOnly !== true && def.composedMethods?.[name] === void 0).length > 0) blockers.push("has-commands");
10688
+ const fields = describeTopLevelStateFields(state);
10689
+ const itemArrayPath = def.status?.itemArray?.path ?? null;
10690
+ if (requiredTopLevelKeys(state).some((key) => key !== itemArrayPath && !fields.has(key))) blockers.push("not-composable");
10691
+ if (planCompositionEvents(def, {
10692
+ featureIndex: 0,
10693
+ cap: def.name,
10694
+ mode: "new"
10695
+ }, []).problems.some((p) => p.code === "not-composable") && !blockers.includes("not-composable")) blockers.push("not-composable");
10696
+ return blockers;
10697
+ }
10698
+ /** Every cap with no blocker, sorted by name. */
10699
+ function describeComposableCaps(defs, deviceType) {
10700
+ return defs.filter((def) => builtCapabilityBlockers(def, deviceType).length === 0).map((def) => {
10701
+ const state = def.runtimeState;
10702
+ const fields = state === void 0 ? [] : [...describeTopLevelStateFields(state).values()];
10703
+ const itemArray = def.status?.itemArray;
10704
+ return {
10705
+ cap: def.name,
10706
+ fields: fields.map((f) => ({
10707
+ path: f.path,
10708
+ kind: f.kind,
10709
+ nullable: f.nullable,
10710
+ required: f.required,
10711
+ ...f.enumValues === void 0 ? {} : { enumValues: [...f.enumValues] }
10712
+ })),
10713
+ ...itemArray === void 0 ? {} : { itemArray: {
10714
+ path: itemArray.path,
10715
+ keyField: itemArray.keyField
10716
+ } }
10717
+ };
10718
+ }).toSorted((a, b) => a.cap.localeCompare(b.cap));
10719
+ }
10720
+ //#endregion
10721
+ //#region src/capabilities/core-blocks.cap.ts
10722
+ /**
10723
+ * core-blocks — user-authored TypeScript, stored in the kernel and executed in
10724
+ * its own process.
10725
+ *
10726
+ * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
10727
+ *
10728
+ * The first use is **owning devices without being a device provider**: a block
10729
+ * declares devices under a system or custom integration and drives their state,
10730
+ * with the same `ctx` an addon gets. Automations come later; nothing here
10731
+ * models a trigger.
10732
+ *
10733
+ * **Stated plainly, because it does not change by being true:** a block has an
10734
+ * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
10735
+ * with no review step. What makes that survivable is not a sandbox, it is
10736
+ * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
10737
+ * so a block that throws or never returns is marked `failed` and visible
10738
+ * instead of taking the hub with it (D6). Every method here is admin-only, and
10739
+ * must stay so.
10740
+ */
10741
+ /**
10742
+ * Prefix for a block's generated addon id AND its runner id — one addon, one
10743
+ * process, so the two are the same string (D2).
10744
+ *
10745
+ * It lives on the CONTRACT rather than beside the code that materialises the
10746
+ * package, because it is not an implementation detail: the operator surface
10747
+ * reads a block's logs by asking `logs.query` for `addonId = core-block-<id>`,
10748
+ * with no cap and no store of its own. Two copies of this string is one copy
10749
+ * too many — a drift would show as a logs pane that is simply always empty.
10750
+ */
10751
+ var CORE_BLOCK_ADDON_PREFIX = "core-block-";
10752
+ /**
10753
+ * The builtin's own addon id — and, because of that, the OWNER of the
10754
+ * integration every block's devices hang from.
10755
+ *
10756
+ * A block cannot own one. Every integration read is gated on the installed-addon
10757
+ * set (`addon-registry.service.ts` → `createFilteredRegistry`) and a block's
10758
+ * `core-block-<uuid>` is never in it, so its `getIntegrationByAddonId` answers
10759
+ * null forever while the write succeeds — one invisible, undeletable row per
10760
+ * start. `core-blocks` IS installed, so it reconciles one shared integration and
10761
+ * a block names it by id (`DeclaredDevicesSpec.integrationId`), minting nothing.
10762
+ *
10763
+ * Exported from the contract, next to the runner prefix and for the same reason:
10764
+ * a block reads it as
10765
+ * `ctx.api.integrations.getByAddonId.query({ addonId: CORE_BLOCKS_ADDON_ID })`,
10766
+ * so a second copy of the string is a block that silently declares into nowhere.
10767
+ */
10768
+ var CORE_BLOCKS_ADDON_ID = "core-blocks";
10769
+ /** The addon/runner id a block's process runs under. */
10770
+ function coreBlockAddonId(blockId) {
10771
+ return `${CORE_BLOCK_ADDON_PREFIX}${blockId}`;
10772
+ }
10773
+ /** The block id behind a generated addon/runner id, or null when the id belongs
10774
+ * to something else. The inverse of {@link coreBlockAddonId}. */
10775
+ function coreBlockIdFromAddonId(addonId) {
10776
+ if (!addonId.startsWith("core-block-")) return null;
10777
+ const rest = addonId.slice(11);
10778
+ return rest.length > 0 ? rest : null;
10779
+ }
10780
+ /** Where a block runs. The operator chooses — a block driving a device on an
10781
+ * agent is the reason placement is not fixed to the hub. */
10782
+ var CoreBlockPlacementSchema = z.union([z.literal("hub"), z.string().min(1)]);
10783
+ /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
10784
+ * a failing block reads the same way a failing addon does. `degraded` is a
10785
+ * composition on an existing device with a field handed back to the native
10786
+ * provider while its source is unavailable (S1b, D663); the error names it. */
10787
+ var CoreBlockStatusSchema = z.enum([
10788
+ "stopped",
10789
+ "starting",
10790
+ "running",
10791
+ "degraded",
10792
+ "failed"
10793
+ ]);
10794
+ /** Client-authored fields. */
10795
+ var CoreBlockInputSchema = z.object({
10796
+ name: z.string().min(1).max(120),
10797
+ /** TypeScript source. Compiled server-side before it is ever stored — a
10798
+ * block that does not compile is a fork failure the operator would meet
10799
+ * minutes later, in a log, instead of in the editor. */
10800
+ code: z.string().max(2e5),
10801
+ enabled: z.boolean(),
10802
+ placement: CoreBlockPlacementSchema,
10803
+ /**
10804
+ * Integration the block's devices hang from. Absent = the system integration
10805
+ * blocks share. A block may declare its own instead.
10806
+ */
10807
+ integrationId: z.string().optional()
10808
+ });
10809
+ /**
10810
+ * What a block IS (D659). Absent means `code` — every row stored before this
10811
+ * union keeps working unchanged.
10812
+ * - `code`: the TypeScript in `code`, compiled and run in its own runner;
10813
+ * - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
10814
+ * - `composition`: declarative, run by the shared `composer`; `code` is `''`.
10815
+ */
10816
+ var CoreBlockSourceSchema = z.discriminatedUnion("kind", [
10817
+ z.object({ kind: z.literal("code") }),
10818
+ z.object({
10819
+ kind: z.literal("recipe"),
10820
+ recipe: AutomationRecipeSchema
10821
+ }),
10822
+ z.object({
10823
+ kind: z.literal("composition"),
10824
+ composition: CompositionSchema
10825
+ })
10826
+ ]);
10827
+ /**
10828
+ * The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7).
10829
+ *
10830
+ * `name`: REQUIRED for a `new` target — the block's name IS the device's name
10831
+ * (D659). ABSENT for an `existing` target — a customization has no name of its
10832
+ * own; the server derives one (`customizationBlockName`, D663) and refuses a
10833
+ * client-sent name by name.
10834
+ */
10835
+ var CompositionBlockInputSchema = z.object({
10836
+ name: z.string().min(1).max(120).optional(),
10837
+ enabled: z.boolean(),
10838
+ composition: CompositionSchema
10839
+ });
10840
+ /** A stored block. */
10841
+ var CoreBlockSchema = CoreBlockInputSchema.extend({
10842
+ id: z.string(),
10843
+ createdAt: z.number(),
10844
+ updatedAt: z.number(),
10845
+ /** Server-stamped author. */
10846
+ createdBy: z.string(),
10847
+ status: CoreBlockStatusSchema,
10848
+ /**
10849
+ * Why the block is not running, when it is not. The operator's ONLY window
10850
+ * into a block that failed at load — a block that is silently absent is the
10851
+ * failure mode this whole feature has to avoid.
10852
+ */
10853
+ lastError: z.string().optional(),
10854
+ /** Ms epoch of the last state change. */
10855
+ lastChangedAt: z.number(),
10856
+ /** What the block is. Absent means `code` (D659). */
10857
+ source: CoreBlockSourceSchema.optional()
10858
+ });
10859
+ function coreBlockSourceKind(block) {
10860
+ return block.source?.kind ?? "code";
10861
+ }
10862
+ function coreBlockComposition(block) {
10863
+ return block.source?.kind === "composition" ? block.source.composition : null;
10864
+ }
10865
+ /** What the composer said, or that it could not be asked. Unknown never looks like absent (D315). */
10866
+ var CompositionStateReadSchema = z.discriminatedUnion("kind", [z.object({
10867
+ kind: z.literal("answered"),
10868
+ state: CompositionBlockStateSchema.nullable()
10869
+ }), z.object({
10870
+ kind: z.literal("unreachable"),
10871
+ error: z.string()
10872
+ })]);
10873
+ /** A stored composition block and what the composer says about it. */
10874
+ var CompositionViewSchema = z.object({
10875
+ block: CoreBlockSchema,
10876
+ state: CompositionStateReadSchema
10877
+ });
10878
+ /**
10879
+ * A read of the stored compositions. `not-loaded` while the `core_blocks`
10880
+ * table has not been READ: an empty answer then would make "not yet known"
10881
+ * look like "none", and invite the operator to recreate what exists (D315).
10882
+ */
10883
+ var CompositionsNotLoadedSchema = z.object({
10884
+ state: z.literal("not-loaded"),
10885
+ reason: z.string()
10886
+ });
10887
+ var CompositionListReadSchema = z.discriminatedUnion("state", [z.object({
10888
+ state: z.literal("loaded"),
10889
+ views: z.array(CompositionViewSchema)
10890
+ }), CompositionsNotLoadedSchema]);
10891
+ var CompositionGetReadSchema = z.discriminatedUnion("state", [z.object({
10892
+ state: z.literal("loaded"),
10893
+ view: CompositionViewSchema.nullable()
10894
+ }), CompositionsNotLoadedSchema]);
10895
+ /** The customization of one existing device, found by its TARGET, or `not-loaded` (D315). */
10896
+ var CompositionCustomizationReadSchema = z.discriminatedUnion("state", [z.object({
10897
+ state: z.literal("loaded"),
10898
+ view: CompositionViewSchema.nullable()
10899
+ }), CompositionsNotLoadedSchema]);
10900
+ /** What a compile attempt produced. */
10901
+ var CoreBlockCompileResultSchema = z.object({
10902
+ ok: z.boolean(),
10903
+ /** Present when `ok` is false — the first error, in the author's words. */
10904
+ error: z.string().optional(),
10905
+ line: z.number().optional(),
10906
+ column: z.number().optional()
10907
+ });
10908
+ var coreBlocksCapability = {
10909
+ name: "core-blocks",
10910
+ scope: "system",
10911
+ mode: "singleton",
10912
+ methods: {
10913
+ list: method(z.object({}), z.object({ blocks: z.array(CoreBlockSchema) }), { auth: "admin" }),
10914
+ get: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }),
10915
+ /**
10916
+ * Create a block. The code is COMPILED first: storing source that does not
10917
+ * compile turns an editor error into a fork failure the operator meets
10918
+ * minutes later in a log.
10919
+ */
10920
+ create: method(z.object({ block: CoreBlockInputSchema }), z.object({ block: CoreBlockSchema }), {
10921
+ kind: "mutation",
10922
+ auth: "admin",
10923
+ caller: "required"
10924
+ }),
10925
+ update: method(z.object({
10926
+ blockId: z.string(),
10927
+ block: CoreBlockInputSchema.partial()
10928
+ }), z.object({ block: CoreBlockSchema }), {
10929
+ kind: "mutation",
10930
+ auth: "admin",
10931
+ caller: "required"
10932
+ }),
10933
+ delete: method(z.object({ blockId: z.string() }), z.object({ success: z.literal(true) }), {
10934
+ kind: "mutation",
10935
+ auth: "admin"
10936
+ }),
10937
+ setEnabled: method(z.object({
10938
+ blockId: z.string(),
10939
+ enabled: z.boolean()
10940
+ }), z.object({ block: CoreBlockSchema }), {
10941
+ kind: "mutation",
10942
+ auth: "admin"
10943
+ }),
10944
+ /**
10945
+ * Stop this block's runner and let the supervisor bring it back.
10946
+ *
10947
+ * **It stores nothing.** There is no "restart requested" flag and no second
10948
+ * lifecycle field: the supervisor already stops and respawns a runner when
10949
+ * the code hash changes, and this exposes that same path deliberately
10950
+ * (D62 — a switch writes the authority that already owned the function).
10951
+ * The next reconcile pass remains the authority, so a restart that lost a
10952
+ * race is corrected within one pass rather than leaving a stale flag behind.
10953
+ *
10954
+ * Refused for a DISABLED block: nothing would come back, and a button that
10955
+ * silently does nothing is worse than one that says why.
10956
+ */
10957
+ restart: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema }), {
10958
+ kind: "mutation",
10959
+ auth: "admin"
10960
+ }),
10961
+ /**
10962
+ * Type-check without saving — what the editor calls as the author types, so
10963
+ * the compiler's verdict is the same one the server will reach.
10964
+ */
10965
+ compile: method(z.object({ code: z.string() }), CoreBlockCompileResultSchema, {
10966
+ kind: "mutation",
10967
+ auth: "admin"
10968
+ }),
10969
+ /**
10970
+ * The declaration files the editor type-checks against.
10971
+ *
10972
+ * Served rather than bundled: the graph is 3.4 MB across 344 files, and
10973
+ * bundling it would roughly double the admin remote. Served rather than
10974
+ * hand-stubbed: a block runs with the same `ctx` an addon gets, so a stub
10975
+ * would drift and the editor would confidently autocomplete methods that
10976
+ * do not exist.
10977
+ */
10978
+ getTypeDefs: method(z.object({}), z.object({ libs: z.array(z.object({
10979
+ filePath: z.string(),
10980
+ content: z.string()
10981
+ })) }), { auth: "admin" }),
10982
+ /**
10983
+ * Create a composition block (D659). VALIDATED first against the live
10033
10984
  * sources and every stored composition; a refusal names every problem by
10034
10985
  * path and reason (D391) and stores nothing.
10035
10986
  */
@@ -10064,6 +11015,14 @@ var coreBlocksCapability = {
10064
11015
  stableId: z.string().min(1)
10065
11016
  }), CompositionCustomizationReadSchema, { auth: "admin" }),
10066
11017
  /**
11018
+ * The capabilities a composition may BUILD on a device of `deviceType`
11019
+ * (a new device, or added to an existing one), with their fields — the
11020
+ * editor's feature list and the presets' availability (G2, D676). Built
11021
+ * from the validator's own blockers; a replace of a BOUND cap is not
11022
+ * listed here (the device's bindings say what it has).
11023
+ */
11024
+ listComposableCaps: method(z.object({ deviceType: z.enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }),
11025
+ /**
10067
11026
  * Validate without saving — the same verdict the save reaches. A mutation
10068
11027
  * for its body size; it writes nothing, so its access is `view`.
10069
11028
  */
@@ -26287,6 +27246,16 @@ var NodeInferenceDevicesSchema = z.object({
26287
27246
  * Strictly the control plane: never sees a frame, never calls inference,
26288
27247
  * never drains queues. The runner does that work locally on each agent.
26289
27248
  */
27249
+ /**
27250
+ * The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
27251
+ * camera's attached sensors (D672). `config: null` removes the attachment —
27252
+ * the camera reads `not-configured` again, never `unreadable`.
27253
+ */
27254
+ var SetCameraSensorsInputSchema = z.object({
27255
+ deviceId: z.number().int().nonnegative(),
27256
+ /** `null` removes the attachment: the camera goes back to `not-configured`. */
27257
+ config: CameraSensorsConfigSchema.nullable()
27258
+ });
26290
27259
  var pipelineOrchestratorCapability = {
26291
27260
  name: "pipeline-orchestrator",
26292
27261
  scope: "system",
@@ -26752,6 +27721,18 @@ var pipelineOrchestratorCapability = {
26752
27721
  */
26753
27722
  getCameraStatuses: method(z.object({ deviceIds: z.array(z.number()).optional() }), z.array(CameraStatusSchema).readonly()),
26754
27723
  /**
27724
+ * Attach sensors to a camera, or detach them with `config: null` (D672
27725
+ * configuration, G5/D676). Written to the orchestrator's per-device store
27726
+ * under the same key `applyDeviceSettingsPatch` writes, and announced as a
27727
+ * settings change so the camera-sensors bridge refreshes. Refused by name
27728
+ * — nothing written — for a device that cannot be read, does not exist,
27729
+ * is not a camera, or names itself as its own sensor.
27730
+ */
27731
+ setCameraSensors: method(SetCameraSensorsInputSchema, z.object({ success: z.literal(true) }), {
27732
+ kind: "mutation",
27733
+ auth: "admin"
27734
+ }),
27735
+ /**
26755
27736
  * Disk-wins fleet reconcile after a recordings wipe. Starts the walk in
26756
27737
  * the addon process and returns immediately with the job snapshot — the
26757
27738
  * work outlives the tRPC/UDS 60s timeout. Poll `getReconcileFromDiskStatus`.
@@ -44657,569 +45638,366 @@ function createDeviceExtensionProvider(options) {
44657
45638
  };
44658
45639
  }
44659
45640
  //#endregion
44660
- //#region src/composition/composition-graph.ts
44661
- /**
44662
- * The field graph across every composition, and the cycles in it (D659).
44663
- *
44664
- * A node is ONE field of ONE device (`<addon>/<stableId>#<cap>.<field>`); an
44665
- * edge points from a composed field to each field it reads. A cycle, direct or
44666
- * through another composition, is refused at save by name (spec §2).
44667
- *
44668
- * The graph is built for ONE save: the CANDIDATE composition (the one being
44669
- * validated) plus every STORED composition. The candidate replaces its own old
44670
- * version, identified BY BLOCK ID wherever it sits in `stored` — whether a save
44671
- * introduces or removes a cycle must never depend on array order. A DIFFERENT
44672
- * block targeting the candidate's device is refused by name: one composition
44673
- * per device (D663). Two different stored peers that (wrongly) target the same
44674
- * device are corrupted state, not a cycle to resolve by picking one silently;
44675
- * that is refused by name too (D391).
44676
- *
44677
- * A customization of an EXISTING device reads that device's NATIVE value for a
44678
- * field it replaces or does not write ("Invert state" reads the `on` it
44679
- * replaces): such a self-read is no edge, so it is never a cycle (D663).
44680
- * Another composition reading that field reads the customizer's output.
44681
- *
44682
- * `findCompositionCycles` reports at least one cycle per cycle-SET (the DFS
44683
- * marks a node `done` after its first expansion) — not every elementary cycle
44684
- * through a shared node, so the path it names may AVOID the candidate while
44685
- * one through it goes unreported. What a save refuses is therefore decided per
44686
- * strongly connected component (`findCandidateCycles`, C-1). A dotted
44687
- * `fieldPath` is matched only as an exact string: a write to `state.value` and
44688
- * a read of `state` would not connect (no nested field writes exist yet).
44689
- *
44690
- * An item leaf is its own node, `…#consumables.items[desiccant].status`
44691
- * (`featureFieldEntries`), so two items sharing an inner path never merge. No
44692
- * READ can name an array element (`describeStateField` never describes one),
44693
- * so an item node is write-only: its edges to sources are what the check needs.
44694
- */
44695
- /** Two blocks' compositions target the same device — refused by name, never silently resolved. */
44696
- var CompositionGraphError = class extends Error {};
44697
- /** `"cap.field"` of every field a peer writes — the same spelling as `compositionFieldKey`. */
44698
- function writtenFields(peer) {
44699
- return new Set(peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath }) => `${feature.cap}.${fieldPath}`)));
44700
- }
44701
- /** A read of the peer's OWN device is an edge only when it reads the peer's own output (rule 5, D663). */
44702
- function readsComposedValue(peer, written, read) {
44703
- if (compositionSourceKey(read.source) !== compositionSourceKey(peer.target)) return true;
44704
- const field = `${read.cap}.${read.fieldPath}`;
44705
- return written.has(field) && peer.replaced?.has(field) !== true;
44706
- }
44707
- function peerEdges(peer) {
44708
- const written = writtenFields(peer);
44709
- return peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath, source }) => [compositionReadKey({
44710
- source: peer.target,
44711
- cap: feature.cap,
44712
- fieldPath
44713
- }), fieldReads(source).filter((read) => readsComposedValue(peer, written, read)).map(compositionReadKey)]));
44714
- }
44715
- /**
44716
- * Every peer that actually takes part in the graph: each stored peer minus the
44717
- * candidate's own old version (same block id — the drop happens before any
44718
- * edge is built, so its old edges never enter the map), plus the candidate
44719
- * itself, exactly once. Throws {@link CompositionGraphError} when a DIFFERENT
44720
- * block targets the candidate's device, or two stored peers share a device.
44721
- */
44722
- function resolvedPeers(candidate, stored) {
44723
- const candidateKey = compositionSourceKey(candidate.target);
44724
- const survivors = /* @__PURE__ */ new Map();
44725
- for (const peer of stored) {
44726
- if (peer.blockId === candidate.blockId) continue;
44727
- const key = compositionSourceKey(peer.target);
44728
- if (key === candidateKey) throw new CompositionGraphError(`block \`${peer.blockId}\` and block \`${candidate.blockId}\` both target device \`${key}\` — one composition per device; delete or edit the existing one`);
44729
- const clash = survivors.get(key);
44730
- if (clash !== void 0) throw new CompositionGraphError(`two stored compositions (\`${clash.blockId}\`, \`${peer.blockId}\`) both target device \`${key}\` — refusing to build the field graph`);
44731
- survivors.set(key, peer);
44732
- }
44733
- return [...survivors.values(), candidate];
44734
- }
44735
- function compositionEdges(candidate, stored) {
44736
- const edges = resolvedPeers(candidate, stored).flatMap(peerEdges);
44737
- return new Map(edges);
44738
- }
44739
- function findCompositionCycles(candidate, stored) {
44740
- const edges = compositionEdges(candidate, stored);
44741
- const marks = /* @__PURE__ */ new Map();
44742
- const found = /* @__PURE__ */ new Map();
44743
- const visit = (node, stack) => {
44744
- const mark = marks.get(node);
44745
- if (mark === "done") return;
44746
- if (mark === "visiting") {
44747
- const path = [...stack.slice(stack.indexOf(node)), node];
44748
- const id = [...new Set(path)].toSorted().join("|");
44749
- if (!found.has(id)) found.set(id, { path });
44750
- return;
44751
- }
44752
- marks.set(node, "visiting");
44753
- for (const next of edges.get(node) ?? []) visit(next, [...stack, node]);
44754
- marks.set(node, "done");
44755
- };
44756
- for (const node of edges.keys()) visit(node, []);
44757
- return [...found.values()];
44758
- }
44759
- /** Tarjan's strongly connected components over every node of the graph (sources included). */
44760
- function stronglyConnected(edges) {
44761
- const index = /* @__PURE__ */ new Map();
44762
- const low = /* @__PURE__ */ new Map();
44763
- const onStack = /* @__PURE__ */ new Set();
44764
- const stack = [];
44765
- const components = [];
44766
- const connect = (node) => {
44767
- index.set(node, index.size);
44768
- low.set(node, index.get(node) ?? 0);
44769
- stack.push(node);
44770
- onStack.add(node);
44771
- for (const next of edges.get(node) ?? []) if (!index.has(next)) {
44772
- connect(next);
44773
- low.set(node, Math.min(low.get(node) ?? 0, low.get(next) ?? 0));
44774
- } else if (onStack.has(next)) low.set(node, Math.min(low.get(node) ?? 0, index.get(next) ?? 0));
44775
- if (low.get(node) !== index.get(node)) return;
44776
- const component = [];
44777
- for (let member = stack.pop(); member !== void 0; member = stack.pop()) {
44778
- onStack.delete(member);
44779
- component.push(member);
44780
- if (member === node) break;
44781
- }
44782
- components.push(component);
44783
- };
44784
- for (const node of edges.keys()) if (!index.has(node)) connect(node);
44785
- return components;
44786
- }
44787
- /** The shortest walk from `start` back to itself inside `component` (one exists: the component has a cycle). */
44788
- function cycleThrough(start, component, edges) {
44789
- const parent = /* @__PURE__ */ new Map();
44790
- const queue = [start];
44791
- for (let head = 0; head < queue.length; head += 1) {
44792
- const node = queue[head];
44793
- if (node === void 0) break;
44794
- for (const next of edges.get(node) ?? []) {
44795
- if (next === start) {
44796
- const chain = [];
44797
- for (let at = node; at !== void 0 && at !== start; at = parent.get(at)) chain.push(at);
44798
- return [
44799
- start,
44800
- ...chain.reverse(),
44801
- start
44802
- ];
44803
- }
44804
- if (!component.has(next) || parent.has(next)) continue;
44805
- parent.set(next, node);
44806
- queue.push(next);
44807
- }
44808
- }
44809
- return [start, start];
44810
- }
45641
+ //#region src/units/unit-table.ts
44811
45642
  /**
44812
- * The cycles THIS save closes, decided per strongly connected component — never
44813
- * per reported DFS path, which names one back-edge per revisit and can report a
44814
- * component's cycle by a path that avoids the candidate while the one through it
44815
- * goes unreported. A component refuses when it holds a candidate node and a
44816
- * cycle (more than one node, or a self-loop). Components without a candidate
44817
- * node are not this save's cycles.
45643
+ * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
45644
+ * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
45645
+ * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
45646
+ * decimals). K derives from `°C = K − 273.15`.
44818
45647
  */
44819
- function findCandidateCycles(candidate, stored) {
44820
- const edges = compositionEdges(candidate, stored);
44821
- const prefix = `${compositionSourceKey(candidate.target)}#`;
44822
- return stronglyConnected(edges).flatMap((members) => {
44823
- const start = members.find((n) => n.startsWith(prefix));
44824
- if (start === void 0) return [];
44825
- const component = new Set(members);
44826
- const selfLoop = members.length === 1 && (edges.get(start) ?? []).includes(start);
44827
- if (members.length === 1 && !selfLoop) return [];
44828
- return [{
44829
- path: cycleThrough(start, component, edges),
44830
- component
44831
- }];
44832
- });
44833
- }
44834
- //#endregion
44835
- //#region src/composition/plan-result.ts
44836
- function problem(code, path, message) {
44837
- return {
44838
- code,
44839
- path,
44840
- message
44841
- };
44842
- }
44843
- function refused(...problems) {
44844
- return {
44845
- problems,
44846
- fields: [],
44847
- features: [],
44848
- events: []
44849
- };
44850
- }
44851
- /** Where a planned field sits in the composition: `features[N].fields.<path>` or `features[N].items.<key>.fields.<path>`. */
44852
- function compositionFieldAt(field) {
44853
- const inner = field.item === void 0 ? "fields" : `items.${field.item.key}.fields`;
44854
- return `features[${field.featureIndex}].${inner}.${field.path}`;
44855
- }
44856
- //#endregion
44857
- //#region src/composition/expression-kinds.ts
44858
- var NUMBER = {
44859
- kind: "fixed",
44860
- result: ["number"]
44861
- };
44862
- var BOOLEAN = {
44863
- kind: "fixed",
44864
- result: ["boolean"]
44865
- };
44866
- /** One rule per builtin. `expression-kinds.spec.ts` fails for a builtin missing here. */
44867
- var BUILTIN_RESULT_KINDS = Object.freeze({
44868
- min: NUMBER,
44869
- max: NUMBER,
44870
- abs: NUMBER,
44871
- floor: NUMBER,
44872
- ceil: NUMBER,
44873
- sqrt: NUMBER,
44874
- round: NUMBER,
44875
- pow: NUMBER,
44876
- clamp: NUMBER,
44877
- avg: NUMBER,
44878
- sum: NUMBER,
44879
- age: NUMBER,
44880
- convert: NUMBER,
44881
- coalesce: { kind: "coalesce" },
44882
- any: BOOLEAN,
44883
- all: BOOLEAN,
44884
- within: BOOLEAN,
44885
- latest: {
44886
- kind: "fixed",
44887
- result: ["number", "null"]
45648
+ var UNIT_TABLE = {
45649
+ "°C": {
45650
+ dimension: "temperature",
45651
+ factor: 1,
45652
+ offset: 0
45653
+ },
45654
+ "°F": {
45655
+ dimension: "temperature",
45656
+ factor: 5 / 9,
45657
+ offset: -160 / 9
45658
+ },
45659
+ K: {
45660
+ dimension: "temperature",
45661
+ factor: 1,
45662
+ offset: -273.15
45663
+ },
45664
+ hPa: {
45665
+ dimension: "pressure",
45666
+ factor: 1,
45667
+ offset: 0
45668
+ },
45669
+ kPa: {
45670
+ dimension: "pressure",
45671
+ factor: 10,
45672
+ offset: 0
45673
+ },
45674
+ Pa: {
45675
+ dimension: "pressure",
45676
+ factor: .01,
45677
+ offset: 0
45678
+ },
45679
+ mbar: {
45680
+ dimension: "pressure",
45681
+ factor: 1,
45682
+ offset: 0
45683
+ },
45684
+ bar: {
45685
+ dimension: "pressure",
45686
+ factor: 1e3,
45687
+ offset: 0
45688
+ },
45689
+ inHg: {
45690
+ dimension: "pressure",
45691
+ factor: 33.8639,
45692
+ offset: 0
45693
+ },
45694
+ mmHg: {
45695
+ dimension: "pressure",
45696
+ factor: 1.33322,
45697
+ offset: 0
45698
+ },
45699
+ psi: {
45700
+ dimension: "pressure",
45701
+ factor: 68.9476,
45702
+ offset: 0
45703
+ },
45704
+ "m/s": {
45705
+ dimension: "speed",
45706
+ factor: 1,
45707
+ offset: 0
45708
+ },
45709
+ "km/h": {
45710
+ dimension: "speed",
45711
+ factor: 1 / 3.6,
45712
+ offset: 0
45713
+ },
45714
+ mph: {
45715
+ dimension: "speed",
45716
+ factor: .44704,
45717
+ offset: 0
45718
+ },
45719
+ kn: {
45720
+ dimension: "speed",
45721
+ factor: .514444,
45722
+ offset: 0
45723
+ },
45724
+ "mm/h": {
45725
+ dimension: "precipitation-rate",
45726
+ factor: 1,
45727
+ offset: 0
45728
+ },
45729
+ "in/h": {
45730
+ dimension: "precipitation-rate",
45731
+ factor: 25.4,
45732
+ offset: 0
45733
+ },
45734
+ m: {
45735
+ dimension: "length",
45736
+ factor: 1,
45737
+ offset: 0
45738
+ },
45739
+ mm: {
45740
+ dimension: "length",
45741
+ factor: .001,
45742
+ offset: 0
45743
+ },
45744
+ cm: {
45745
+ dimension: "length",
45746
+ factor: .01,
45747
+ offset: 0
45748
+ },
45749
+ km: {
45750
+ dimension: "length",
45751
+ factor: 1e3,
45752
+ offset: 0
44888
45753
  },
44889
- number: {
44890
- kind: "fixed",
44891
- result: ["number", "null"]
45754
+ in: {
45755
+ dimension: "length",
45756
+ factor: .0254,
45757
+ offset: 0
44892
45758
  },
44893
- rose: {
44894
- kind: "fixed",
44895
- result: ["number", "null"]
45759
+ ft: {
45760
+ dimension: "length",
45761
+ factor: .3048,
45762
+ offset: 0
44896
45763
  },
44897
- count: NUMBER
44898
- });
44899
- var KindInferenceError = class extends Error {};
44900
- function kindOfValue(value) {
44901
- if (value === null) return "null";
44902
- if (typeof value === "number") return "number";
44903
- if (typeof value === "string") return "string";
44904
- return "boolean";
44905
- }
44906
- function only(kind) {
44907
- return new Set([kind]);
44908
- }
44909
- function union(...sets) {
44910
- return new Set(sets.flatMap((s) => [...s]));
44911
- }
44912
- function withoutNull(set) {
44913
- return new Set([...set].filter((k) => k !== "null"));
44914
- }
44915
- function binaryKinds(op, left, right) {
44916
- if (op === "+") {
44917
- const all = [...left, ...right];
44918
- if (all.every((k) => k === "string")) return only("string");
44919
- if (all.every((k) => k === "number")) return only("number");
44920
- return new Set(["number", "string"]);
45764
+ mi: {
45765
+ dimension: "length",
45766
+ factor: 1609.344,
45767
+ offset: 0
45768
+ },
45769
+ lx: {
45770
+ dimension: "illuminance",
45771
+ factor: 1,
45772
+ offset: 0
45773
+ },
45774
+ "W/m²": {
45775
+ dimension: "irradiance",
45776
+ factor: 1,
45777
+ offset: 0
45778
+ },
45779
+ W: {
45780
+ dimension: "power",
45781
+ factor: 1,
45782
+ offset: 0
45783
+ },
45784
+ kW: {
45785
+ dimension: "power",
45786
+ factor: 1e3,
45787
+ offset: 0
45788
+ },
45789
+ VA: {
45790
+ dimension: "apparent-power",
45791
+ factor: 1,
45792
+ offset: 0
45793
+ },
45794
+ Wh: {
45795
+ dimension: "energy",
45796
+ factor: 1,
45797
+ offset: 0
45798
+ },
45799
+ kWh: {
45800
+ dimension: "energy",
45801
+ factor: 1e3,
45802
+ offset: 0
45803
+ },
45804
+ MWh: {
45805
+ dimension: "energy",
45806
+ factor: 1e6,
45807
+ offset: 0
45808
+ },
45809
+ V: {
45810
+ dimension: "voltage",
45811
+ factor: 1,
45812
+ offset: 0
45813
+ },
45814
+ mV: {
45815
+ dimension: "voltage",
45816
+ factor: .001,
45817
+ offset: 0
45818
+ },
45819
+ A: {
45820
+ dimension: "current",
45821
+ factor: 1,
45822
+ offset: 0
45823
+ },
45824
+ mA: {
45825
+ dimension: "current",
45826
+ factor: .001,
45827
+ offset: 0
45828
+ },
45829
+ ppm: {
45830
+ dimension: "concentration-volume",
45831
+ factor: 1,
45832
+ offset: 0
45833
+ },
45834
+ ppb: {
45835
+ dimension: "concentration-volume",
45836
+ factor: .001,
45837
+ offset: 0
45838
+ },
45839
+ "µg/m³": {
45840
+ dimension: "concentration-mass",
45841
+ factor: 1,
45842
+ offset: 0
45843
+ },
45844
+ "mg/m³": {
45845
+ dimension: "concentration-mass",
45846
+ factor: 1e3,
45847
+ offset: 0
45848
+ },
45849
+ kg: {
45850
+ dimension: "mass",
45851
+ factor: 1,
45852
+ offset: 0
45853
+ },
45854
+ g: {
45855
+ dimension: "mass",
45856
+ factor: .001,
45857
+ offset: 0
45858
+ },
45859
+ lb: {
45860
+ dimension: "mass",
45861
+ factor: .453592,
45862
+ offset: 0
45863
+ },
45864
+ oz: {
45865
+ dimension: "mass",
45866
+ factor: .0283495,
45867
+ offset: 0
45868
+ },
45869
+ "%": {
45870
+ dimension: "percentage",
45871
+ factor: 1,
45872
+ offset: 0
44921
45873
  }
44922
- if (op === "-" || op === "*" || op === "/" || op === "%") return only("number");
44923
- return only("boolean");
44924
- }
44925
- /** "exactly N" / "at least N" / "N–M", for an arity refusal that says what IS allowed. */
44926
- function arityRange(builtin) {
44927
- if (builtin.minArgs === builtin.maxArgs) return `exactly ${builtin.minArgs}`;
44928
- if (builtin.maxArgs === Number.POSITIVE_INFINITY) return `at least ${builtin.minArgs}`;
44929
- return `${builtin.minArgs}–${builtin.maxArgs}`;
44930
- }
44931
- function callKinds(callee, args) {
44932
- const builtin = EXPRESSION_BUILTINS[callee];
44933
- if (builtin !== void 0 && (args.length < builtin.minArgs || args.length > builtin.maxArgs)) throw new KindInferenceError(`${callee}: wrong number of arguments (${args.length}); expected ${arityRange(builtin)}`);
44934
- const rule = BUILTIN_RESULT_KINDS[callee];
44935
- if (rule === void 0) throw new KindInferenceError(`no result-kind rule for builtin '${callee}'`);
44936
- if (rule.kind === "fixed") return new Set(rule.result);
44937
- const nonNull = union(...args.map(withoutNull));
44938
- return args.every((a) => a.has("null")) ? union(nonNull, only("null")) : nonNull;
44939
- }
44940
- function kindsOf(node, bindings) {
44941
- switch (node.kind) {
44942
- case "literal": return only(kindOfValue(node.value));
44943
- case "identifier": {
44944
- if (node.name === "now") return only("number");
44945
- const bound = bindings.get(node.name);
44946
- if (bound === void 0) throw new KindInferenceError(`unbound identifier '${node.name}'`);
44947
- return bound;
44948
- }
44949
- case "unary": return only(node.op === "!" ? "boolean" : "number");
44950
- case "binary": return binaryKinds(node.op, kindsOf(node.left, bindings), kindsOf(node.right, bindings));
44951
- case "logical": return union(kindsOf(node.left, bindings), kindsOf(node.right, bindings));
44952
- case "conditional": return union(kindsOf(node.consequent, bindings), kindsOf(node.alternate, bindings));
44953
- case "call": return callKinds(node.callee, node.args.map((a) => kindsOf(a, bindings)));
45874
+ };
45875
+ //#endregion
45876
+ //#region src/units/convert.ts
45877
+ /**
45878
+ * Pure unit-conversion API over `UNIT_TABLE`. No dependencies, no side effects.
45879
+ *
45880
+ * Conversion is refused (throws `UnitConversionError`, or returns `undefined`
45881
+ * from the `try*` variant) whenever a unit is unknown or the two units belong
45882
+ * to different dimensions — cross-dimension conversion is deliberately
45883
+ * impossible so a render override can never make the value and its unit label
45884
+ * disagree.
45885
+ *
45886
+ * Callers pass units through `normalizeUnit` (`../device/source-info.ts`) BEFORE
45887
+ * calling here — the table keys only canonical spellings.
45888
+ */
45889
+ /** Thrown by `convertUnit` when a conversion is refused. Carries the offending
45890
+ * units + a machine-readable `reason` for callers that branch on the cause. */
45891
+ var UnitConversionError = class extends Error {
45892
+ from;
45893
+ to;
45894
+ reason;
45895
+ constructor(from, to, reason) {
45896
+ super(`[units] cannot convert '${from}' → '${to}': ${reason}`);
45897
+ this.name = "UnitConversionError";
45898
+ this.from = from;
45899
+ this.to = to;
45900
+ this.reason = reason;
44954
45901
  }
45902
+ };
45903
+ /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
45904
+ function specFor(unit) {
45905
+ return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
44955
45906
  }
44956
- function nodeContainsCall(node, callee) {
44957
- switch (node.kind) {
44958
- case "literal":
44959
- case "identifier": return false;
44960
- case "unary": return nodeContainsCall(node.operand, callee);
44961
- case "binary":
44962
- case "logical": return nodeContainsCall(node.left, callee) || nodeContainsCall(node.right, callee);
44963
- case "conditional": return nodeContainsCall(node.test, callee) || nodeContainsCall(node.consequent, callee) || nodeContainsCall(node.alternate, callee);
44964
- case "call": return node.callee === callee || node.args.some((arg) => nodeContainsCall(arg, callee));
44965
- }
45907
+ /** The dimension a unit belongs to, or `undefined` for an unknown unit. */
45908
+ function unitDimension(unit) {
45909
+ return specFor(unit)?.dimension;
44966
45910
  }
44967
- function expressionContainsBuiltinCall(expr, callee) {
44968
- const compiled = compileExpressionSafe(expr);
44969
- return compiled.ok && nodeContainsCall(compiled.parsed.ast, callee);
45911
+ /** Value in `spec`'s unit → its dimension's canonical unit. */
45912
+ function toCanonical(value, spec) {
45913
+ return value * spec.factor + spec.offset;
44970
45914
  }
44971
- function inferExpressionKinds(input) {
44972
- const compiled = compileExpressionSafe(input.expr);
44973
- if (!compiled.ok) return {
44974
- ok: false,
44975
- error: compiled.error
44976
- };
44977
- try {
44978
- return {
44979
- ok: true,
44980
- kinds: kindsOf(compiled.parsed.ast, input.bindingKinds)
44981
- };
44982
- } catch (err) {
44983
- if (err instanceof KindInferenceError) return {
44984
- ok: false,
44985
- error: err.message
44986
- };
44987
- throw err;
44988
- }
45915
+ /** Canonical-unit value → the unit described by `spec`. */
45916
+ function fromCanonical(canonical, spec) {
45917
+ return (canonical - spec.offset) / spec.factor;
44989
45918
  }
44990
- //#endregion
44991
- //#region src/composition/field-kinds.ts
44992
45919
  /**
44993
- * The kind half of planning a composition field (D659): which kinds a source
44994
- * can produce, whether they fit a target field, and the field's role.
44995
- * Shared by the top-level planner (`validate-composition.ts`) and the item
44996
- * planner (`composition-items.ts`). Internal to the composition module — NOT
44997
- * in the barrel: these are planner internals, not a published contract.
45920
+ * Convert `value` from unit `from` to unit `to`. Identity when `from === to`.
45921
+ * Throws `UnitConversionError` when either unit is unknown or the units belong
45922
+ * to different dimensions.
44998
45923
  */
44999
- function readKinds(read, lookupCap) {
45000
- const def = lookupCap(read.cap);
45001
- const schema = def?.runtimeState ?? def?.status?.schema;
45002
- if (def === null || schema === void 0) return {
45003
- ok: false,
45004
- code: "source-field-unknown",
45005
- message: `no capability \`${read.cap}\` with state to read`
45006
- };
45007
- const field = describeStateField(schema, read.fieldPath);
45008
- if (field === null) return {
45009
- ok: false,
45010
- code: "source-field-unknown",
45011
- message: `\`${read.cap}\` has no field \`${read.fieldPath}\``
45012
- };
45013
- const base = field.kind === "enum" ? "string" : field.kind;
45014
- return {
45015
- ok: true,
45016
- kinds: new Set(field.nullable ? [base, "null"] : [base])
45017
- };
45018
- }
45019
- function sourceKinds(source, lookupCap) {
45020
- if (source.kind === "from") return readKinds(source, lookupCap);
45021
- if (source.kind === "code") return {
45022
- ok: false,
45023
- code: "reserved-variant",
45024
- message: "code fields arrive in slice 4"
45025
- };
45026
- const bindingKinds = /* @__PURE__ */ new Map();
45027
- for (const [name, binding] of Object.entries(source.bindings)) {
45028
- if (binding.kind === "literal") {
45029
- bindingKinds.set(name, new Set([kindOfValue(binding.value)]));
45030
- continue;
45031
- }
45032
- const kinds = readKinds(binding, lookupCap);
45033
- if (!kinds.ok) return {
45034
- ...kinds,
45035
- message: `binding \`${name}\`: ${kinds.message}`
45036
- };
45037
- bindingKinds.set(name, kinds.kinds);
45038
- }
45039
- const inferred = inferExpressionKinds({
45040
- expr: source.expr,
45041
- bindingKinds
45042
- });
45043
- return inferred.ok ? {
45044
- ok: true,
45045
- kinds: inferred.kinds
45046
- } : {
45047
- ok: false,
45048
- code: "expression-invalid",
45049
- message: inferred.error
45050
- };
45051
- }
45052
- function compatibility(cap, target, kinds, at) {
45053
- const allowed = target.kind === "enum" ? "string" : target.kind;
45054
- const offending = [...kinds].filter((k) => k !== "null" && k !== allowed);
45055
- const problems = [];
45056
- if (offending.length > 0) problems.push(problem("kind-mismatch", at, `\`${cap}.${target.path}\` is a ${target.kind}; this source can produce ${offending.join(" or ")}`));
45057
- if (kinds.has("null") && !target.nullable) problems.push(problem("may-be-null", at, `\`${cap}.${target.path}\` cannot be null and this source can produce null — wrap it in coalesce(…) or pick a non-null source`));
45058
- return problems;
45924
+ function convertUnit(value, from, to) {
45925
+ if (from === to) return value;
45926
+ const fromSpec = specFor(from);
45927
+ if (!fromSpec) throw new UnitConversionError(from, to, "unknown-from");
45928
+ const toSpec = specFor(to);
45929
+ if (!toSpec) throw new UnitConversionError(from, to, "unknown-to");
45930
+ if (fromSpec.dimension !== toSpec.dimension) throw new UnitConversionError(from, to, "cross-dimension");
45931
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
45059
45932
  }
45060
45933
  /**
45061
- * A string a source produces WITHOUT reading any device — a field-level
45062
- * `expression` source whose compiled AST is a bare string literal (`"red"`,
45063
- * never `a` or `a + "x"`). Anything else that can only produce `'string'` at
45064
- * the kind level (a `from` read of an enum-typed source field, a computed
45065
- * expression) is NOT checked against the target's `enumValues` here: the
45066
- * kind inference already collapsed it to the coarse `'string'` kind, losing
45067
- * whichever enum it actually came from, so membership can only be judged at
45068
- * write time against the runtime-state schema. Known limitation — see the
45069
- * fix report for Task 6 round 1.
45934
+ * Graceful variant for the render path: returns the converted value, or
45935
+ * `undefined` when the conversion is refused (unknown unit / cross-dimension).
45936
+ * Never throws — a render caller falls back to the raw value + source unit.
45070
45937
  */
45071
- function literalStringValue(source) {
45072
- if (source.kind !== "expression") return null;
45073
- const compiled = compileExpressionSafe(source.expr);
45074
- if (!compiled.ok) return null;
45075
- const ast = compiled.parsed.ast;
45076
- return ast.kind === "literal" && typeof ast.value === "string" ? ast.value : null;
45938
+ function tryConvertUnit(value, from, to) {
45939
+ if (from === to) return value;
45940
+ const fromSpec = specFor(from);
45941
+ if (!fromSpec) return void 0;
45942
+ const toSpec = specFor(to);
45943
+ if (!toSpec) return void 0;
45944
+ if (fromSpec.dimension !== toSpec.dimension) return void 0;
45945
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
45077
45946
  }
45078
45947
  /**
45079
- * An enum target whose source is a save-time-KNOWN string literal outside its
45080
- * `enumValues` is refused now rather than left to fail the write later. A
45081
- * dynamic source (a `from` read, a non-literal expression) is left to
45082
- * runtime — see {@link literalStringValue}.
45948
+ * Whether `value` can be converted between `from` and `to` (same dimension,
45949
+ * both known). Cheap boolean probe for the UI's same-dimension unit picker and
45950
+ * the resolver's convertibility branch — compute ONCE so a unit label and its
45951
+ * value math can never disagree.
45083
45952
  */
45084
- function enumLiteralProblem(cap, target, source, at) {
45085
- if (target.kind !== "enum" || target.enumValues === void 0) return null;
45086
- const value = literalStringValue(source);
45087
- if (value === null || target.enumValues.includes(value)) return null;
45088
- const allowed = target.enumValues.map((v) => `\`${v}\``).join(", ");
45089
- return problem("kind-mismatch", at, `\`${cap}.${target.path}\` accepts only ${allowed}; this source is the literal \`${value}\``);
45090
- }
45091
- function roleOf(source) {
45092
- if (source.kind !== "expression") return "derived";
45093
- if (expressionContainsBuiltinCall(source.expr, "count")) return "accumulator";
45094
- if (fieldReads(source).length > 0) return "derived";
45095
- const compiled = compileExpressionSafe(source.expr);
45096
- return compiled.ok && compiled.parsed.identifiers.has("now") ? "clock" : "constant";
45953
+ function canConvertUnit(from, to) {
45954
+ if (from === to) return true;
45955
+ const fromDim = unitDimension(from);
45956
+ if (fromDim === void 0) return false;
45957
+ return fromDim === unitDimension(to);
45097
45958
  }
45098
45959
  /**
45099
- * How a planned field says "unavailable", per feature mode and AFTER `roleOf`
45100
- * (D393, D663 rulings S1 + S1b). The composer cannot take a device it does not
45101
- * own offline, and D393 forbids a stale number, so on an existing target a
45102
- * field that READS a source never gets `offline`.
45960
+ * Every known unit spelling in a dimension (table insertion order — canonical
45961
+ * unit first). Powers the UI's same-dimension unit picker.
45103
45962
  */
45104
- function unavailableFor(tf, role, mode, cap, at) {
45105
- if (mode === "replace" && (role === "derived" || role === "accumulator")) return {
45106
- ok: true,
45107
- unavailable: "release"
45108
- };
45109
- if (mode === "new" || role !== "derived") return {
45110
- ok: true,
45111
- unavailable: tf.nullable ? "null" : "offline"
45112
- };
45113
- if (tf.nullable) return {
45114
- ok: true,
45115
- unavailable: "null"
45116
- };
45117
- if (tf.enumValues?.includes("unknown") === true) return {
45118
- ok: true,
45119
- unavailable: "unknown"
45120
- };
45121
- return {
45122
- ok: false,
45123
- problem: problem("not-replaceable", at, `\`${cap}.${tf.path}\` reads a source but can say neither null nor 'unknown', and an ADDED capability has no native reading to fall back to (D393, D663)`)
45124
- };
45125
- }
45126
- //#endregion
45127
- //#region src/composition/composition-items.ts
45128
- /** Item fields the composer writes itself, with the value it writes. */
45129
- var COMPOSED_ITEM_FIXED_FIELDS = { resettable: false };
45130
- function reservedItemFields(itemArray) {
45131
- return new Set([
45132
- itemArray.keyField,
45133
- ...itemArray.labelField === void 0 ? [] : [itemArray.labelField],
45134
- ...Object.keys(COMPOSED_ITEM_FIXED_FIELDS)
45135
- ]);
45136
- }
45137
- /** A required leaf under an optional parent is required only once something writes that parent. */
45138
- function leafRequired(itemArray, path, written) {
45139
- const described = describeStateField(itemArray.itemSchema, path);
45140
- if (described === null || !described.required) return false;
45141
- return optionalAncestors(itemArray.itemSchema, path).every((parent) => written.some((w) => w.startsWith(`${parent}.`)));
45142
- }
45143
- function missingLeaves({ capName, itemArray, reserved }, item, at) {
45144
- const written = Object.keys(item.fields);
45145
- return enumerateSchemaFields(itemArray.itemSchema).flatMap((leaf) => {
45146
- if (reserved.has(leaf.path) || leaf.path in item.fields) return [];
45147
- if (!leafRequired(itemArray, leaf.path, written)) return [];
45148
- const described = describeStateField(itemArray.itemSchema, leaf.path);
45149
- if (described === null || described.nullable) return [];
45150
- return [problem("missing-field", `${at}.fields.${leaf.path}`, `\`${capName}.${itemArray.path}[].${leaf.path}\` is required and has no source`)];
45151
- });
45152
- }
45153
- function planItemField(ctx, leaf) {
45154
- const { capName, itemArray, featureIndex, lookupCap } = ctx;
45155
- const { key, label, path, source } = leaf;
45156
- const at = `features[${featureIndex}].items.${key}.fields.${path}`;
45157
- if (ctx.reserved.has(path)) return refused(problem("item-field-reserved", at, `\`${capName}.${itemArray.path}[].${path}\` is set by the composer itself — it takes no source`));
45158
- const tf = describeStateField(itemArray.itemSchema, path);
45159
- if (tf === null) return refused(problem("unknown-field", at, `a \`${capName}\` item has no field \`${path}\``));
45160
- const kinds = sourceKinds(source, lookupCap);
45161
- if (!kinds.ok) return refused(problem(kinds.code, at, kinds.message));
45162
- const role = roleOf(source);
45163
- const unavailable = unavailableFor(tf, role, ctx.mode, capName, at);
45164
- if (!unavailable.ok) return refused(unavailable.problem);
45165
- const plan = {
45166
- cap: capName,
45167
- path,
45168
- item: {
45169
- arrayPath: itemArray.path,
45170
- key,
45171
- label
45172
- },
45173
- featureIndex,
45174
- kind: tf.kind,
45175
- nullable: tf.nullable,
45176
- required: tf.required,
45177
- unavailable: unavailable.unavailable,
45178
- role,
45179
- source,
45180
- reads: [...fieldReads(source)]
45181
- };
45182
- const enumProblem = enumLiteralProblem(capName, tf, source, at);
45183
- return {
45184
- problems: [...compatibility(capName, tf, kinds.kinds, at), ...enumProblem === null ? [] : [enumProblem]],
45185
- fields: [plan],
45186
- features: [],
45187
- events: []
45188
- };
45189
- }
45190
- function planItems(def, feature, featureIndex, lookupCap, mode = "new") {
45191
- const at = `features[${featureIndex}].items`;
45192
- const itemArray = def.status?.itemArray;
45193
- if (itemArray === void 0) return refused(problem("not-item-array", at, `\`${def.name}\` has no item array — it takes no \`items\``));
45194
- if (itemArray.path !== "items") return refused(problem("not-item-array", at, `\`${def.name}\`'s item array is at \`${itemArray.path}\`, not \`${COMPOSITION_ITEM_ARRAY_PATH}\` — not composable yet`));
45195
- const ctx = {
45196
- capName: def.name,
45197
- itemArray,
45198
- reserved: reservedItemFields(itemArray),
45199
- featureIndex,
45200
- lookupCap,
45201
- mode
45202
- };
45203
- const results = Object.entries(feature.items ?? {}).flatMap(([key, item]) => [{
45204
- problems: missingLeaves(ctx, item, `${at}.${key}`),
45205
- fields: [],
45206
- features: [],
45207
- events: []
45208
- }, ...Object.entries(item.fields).map(([path, source]) => planItemField(ctx, {
45209
- key,
45210
- label: item.label,
45211
- path,
45212
- source
45213
- }))]);
45214
- return {
45215
- problems: results.flatMap((r) => r.problems),
45216
- fields: results.flatMap((r) => r.fields),
45217
- features: [],
45218
- events: []
45219
- };
45963
+ function unitsForDimension(dimension) {
45964
+ const out = [];
45965
+ for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
45966
+ return out;
45220
45967
  }
45221
45968
  //#endregion
45222
45969
  //#region src/composition/evaluate-field.ts
45970
+ /**
45971
+ * One composed field, evaluated from what its sources say NOW (D659).
45972
+ *
45973
+ * Pure. The composer calls it on every source change, and the slice-5 editor
45974
+ * will call it for its live preview, so both see the same answer.
45975
+ *
45976
+ * The rules (spec §2):
45977
+ * - a source that is offline or unreadable keeps its last value and is marked
45978
+ * STALE; the field is stale and keeps computing (D49);
45979
+ * - a source that is GONE makes the field UNAVAILABLE, `fatal`, and never a
45980
+ * plausible number (D393);
45981
+ * - a source that is unavailable but NOT gone (e.g. a cap unregistered at
45982
+ * runtime, R7b) makes the field UNAVAILABLE, non-fatal, `value: null`: it
45983
+ * may come back on its own, no block failure is raised for it;
45984
+ * - an expression that fails on a value makes the field unavailable for that
45985
+ * value, and NOT fatal: the next value may compute.
45986
+ *
45987
+ * `confirmed` (D663, D49): whether a NON-fatal unavailability is an ANSWER — a
45988
+ * cap the provider unregistered and a re-read agreed, a field the source
45989
+ * reported without, an expression that failed on a value — or only the
45990
+ * absence of one (a failed read, a first or empty read, a source not tracked
45991
+ * yet). Only a confirmed unavailability may hand a `release`-mode field back
45992
+ * to the native provider; an unconfirmed one holds it on its last value.
45993
+ * Absent means NOT confirmed. Fatal is always confirmed.
45994
+ *
45995
+ * When an expression has more than one unavailable binding, a FATAL one always
45996
+ * wins the outcome, regardless of position: every binding is scanned before
45997
+ * the field is judged, so an earlier non-fatal binding (e.g. a cap that is
45998
+ * momentarily unregistered) can never hide a later fatal one (a deleted
45999
+ * source) behind an early return.
46000
+ */
45223
46001
  function describeRead(read) {
45224
46002
  return `${compositionSourceKey(read.source)} ${read.cap}.${read.fieldPath}`;
45225
46003
  }
@@ -45286,7 +46064,10 @@ function expressionOutcome(source, read, now, stateful) {
45286
46064
  }
45287
46065
  const deadlines = [];
45288
46066
  const result = evaluateExpressionSource(source.expr, values, now, {
45289
- hooks: { noteDeadline: (at) => deadlines.push(at) },
46067
+ hooks: {
46068
+ noteDeadline: (at) => deadlines.push(at),
46069
+ convert: (value, from, to) => tryConvertUnit(value, normalizeUnit(from) ?? from, normalizeUnit(to) ?? to) ?? null
46070
+ },
45290
46071
  ...stateful === void 0 ? {} : { invokeStateful: (invocation) => evaluateStatefulExpressionCall(stateful.callPathPrefix === void 0 ? invocation : {
45291
46072
  ...invocation,
45292
46073
  path: `${stateful.callPathPrefix}@${invocation.path}`
@@ -45525,304 +46306,71 @@ function feederCustomizationExample(sources) {
45525
46306
  });
45526
46307
  }
45527
46308
  //#endregion
45528
- //#region src/composition/validate-composition.ts
45529
- function buildCapabilityLookup(defs) {
45530
- const byName = new Map(defs.map((d) => [d.name, d]));
45531
- return (capName) => byName.get(capName) ?? null;
45532
- }
45533
- /** Caps every `BaseDevice` registers on itself; a second registration throws. */
45534
- var BASE_DEVICE_CAPS = new Set(["device-status", "feature-probe"]);
45535
- var PENDING_SELF = {
45536
- addonId: COMPOSER_ADDON_ID,
45537
- stableId: `${COMPOSED_DEVICE_STABLE_ID_PREFIX}(unsaved)`
45538
- };
45539
- /** The candidate's block id before its first save. Stored block ids are `randomUUID()`, so none can carry it. */
45540
- var PENDING_BLOCK_ID = "(unsaved)";
45541
- function composableCap(feature, at, lookupCap) {
45542
- const def = lookupCap(feature.cap);
45543
- if (def === null) return problem("unknown-capability", `${at}.cap`, `no capability is named \`${feature.cap}\``);
45544
- if (BASE_DEVICE_CAPS.has(def.name)) return problem("not-composable", `${at}.cap`, `\`${def.name}\` is registered by every device itself — it cannot be composed`);
45545
- const state = def.runtimeState;
45546
- if (def.scope !== "device" || state === void 0) return problem("not-composable", `${at}.cap`, `\`${def.name}\` has no per-device state to compose`);
45547
- return {
45548
- def,
45549
- state,
45550
- fields: describeTopLevelStateFields(state)
45551
- };
45552
- }
45553
- /**
45554
- * A capability BUILT by the composition (a new device, or one ADDED to an
45555
- * existing device) must fit the device type, serve no command, and have every
45556
- * required field. A REPLACE needs none of it: the cap is bound (a fact), the
45557
- * native keeps serving its methods, and only the named fields are owned (D663).
45558
- */
45559
- function builtCapProblems({ def, state, fields: targetFields }, feature, at, deviceType) {
45560
- const problems = [];
45561
- if (def.deviceTypes !== void 0 && !def.deviceTypes.includes(deviceType)) problems.push(problem("wrong-device-type", `${at}.cap`, `\`${def.name}\` is not offered on a \`${deviceType}\` device (it allows ${def.deviceTypes.join(", ")})`));
45562
- const served = Object.entries(def.methods).filter(([name, m]) => m.systemOnly !== true && def.composedMethods?.[name] === void 0).map(([name]) => `\`${name}\``);
45563
- if (served.length > 0) problems.push(problem("has-commands", `${at}.cap`, `\`${def.name}\` has ${served.join(", ")}, which a composed device cannot serve until commands arrive (slice 3)`));
45564
- const itemArrayPath = feature.items === void 0 ? null : def.status?.itemArray?.path ?? null;
45565
- for (const key of requiredTopLevelKeys(state)) {
45566
- if (key === itemArrayPath) continue;
45567
- if (!targetFields.has(key)) problems.push(problem("not-composable", `${at}.fields`, `\`${def.name}.${key}\` is not a scalar — nested fields arrive in a later slice`));
45568
- else if (!(key in feature.fields)) problems.push(problem("missing-field", `${at}.fields.${key}`, `\`${def.name}.${key}\` is required and has no source`));
45569
- }
45570
- return problems;
45571
- }
45572
- function planTopLevelField({ def, fields }, field, mode, lookupCap) {
45573
- const { featureIndex, path, source } = field;
45574
- const fieldAt = `features[${featureIndex}].fields.${path}`;
45575
- if (path.includes(".")) return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — nested fields arrive in a later slice`));
45576
- const tf = fields.get(path);
45577
- if (tf === void 0) return refused(problem("unknown-field", fieldAt, `\`${def.name}\` has no field \`${path}\``));
45578
- const kinds = sourceKinds(source, lookupCap);
45579
- if (!kinds.ok) return refused(problem(kinds.code, fieldAt, kinds.message));
45580
- const role = roleOf(source);
45581
- const unavailable = unavailableFor(tf, role, mode, def.name, fieldAt);
45582
- if (!unavailable.ok) return refused(unavailable.problem);
45583
- const plan = {
45584
- cap: def.name,
45585
- path,
45586
- featureIndex,
45587
- kind: tf.kind,
45588
- nullable: tf.nullable,
45589
- required: tf.required,
45590
- unavailable: unavailable.unavailable,
45591
- role,
45592
- source,
45593
- reads: [...fieldReads(source)]
45594
- };
45595
- const enumProblem = enumLiteralProblem(def.name, tf, source, fieldAt);
45596
- return {
45597
- problems: [...compatibility(def.name, tf, kinds.kinds, fieldAt), ...enumProblem === null ? [] : [enumProblem]],
45598
- fields: [plan],
45599
- features: [],
45600
- events: []
45601
- };
45602
- }
45603
- function planFeature(feature, featureIndex, target, lookupCap) {
45604
- const at = `features[${featureIndex}]`;
45605
- const cap = composableCap(feature, at, lookupCap);
45606
- if ("code" in cap) return refused(cap);
45607
- const capProblems = target.mode === "replace" ? [] : [...builtCapProblems(cap, feature, at, target.deviceType)];
45608
- if (feature.commands !== void 0 && Object.keys(feature.commands).length > 0) capProblems.push(problem("reserved-variant", `${at}.commands`, "commands (`forward`) arrive in slice 3"));
45609
- const perField = Object.entries(feature.fields).map(([path, source]) => planTopLevelField(cap, {
45610
- featureIndex,
45611
- path,
45612
- source
45613
- }, target.mode, lookupCap));
45614
- const items = feature.items === void 0 ? [] : [planItems(cap.def, feature, featureIndex, lookupCap, target.mode)];
45615
- const all = [...perField, ...items];
45616
- const fields = all.flatMap((result) => result.fields);
45617
- const featurePlan = {
45618
- featureIndex,
45619
- cap: cap.def.name,
45620
- mode: target.mode
45621
- };
45622
- const eventPlan = planCompositionEvents(cap.def, featurePlan, fields);
45623
- return {
45624
- problems: [
45625
- ...capProblems,
45626
- ...all.flatMap((r) => r.problems),
45627
- ...eventPlan.problems
45628
- ],
45629
- fields,
45630
- features: [featurePlan],
45631
- events: eventPlan.events
45632
- };
45633
- }
45634
- /** A cap the device serves itself; one the composer grafted (an earlier ADD) is not native. */
45635
- function isNativeCap(target, cap) {
45636
- const owner = target.nativeCaps.get(cap);
45637
- return owner !== void 0 && owner !== "composer";
45638
- }
45639
- /** The target read, or the refusal that replaces the whole plan when it could not be (D391). */
45640
- function planTargetOf(composition, target) {
45641
- if (composition.target.kind === "new") return {
45642
- kind: "new",
45643
- type: composition.target.type
45644
- };
45645
- const key = compositionSourceKey(composition.target.device);
45646
- if (target === void 0) return problem("target-unreadable", "target", `target device \`${key}\` was not read — the save is refused rather than stored unchecked`);
45647
- if (target.kind === "absent") return problem("target-missing", "target", `target device \`${key}\` does not exist`);
45648
- if (target.kind === "unreadable") return problem("target-unreadable", "target", `could not read target device \`${key}\` (${target.error}) — the save is refused rather than stored unchecked`);
45649
- return {
45650
- kind: "existing",
45651
- found: target
45652
- };
45653
- }
45654
- function featureTargetOf(target, cap) {
45655
- if (target.kind === "new") return {
45656
- mode: "new",
45657
- deviceType: target.type
45658
- };
45659
- return {
45660
- mode: isNativeCap(target.found, cap) ? "replace" : "add",
45661
- deviceType: target.found.type
45662
- };
46309
+ //#region src/composition/presets/doorbell-feature.ts
46310
+ /**
46311
+ * The doorbell of a camera as a customization (D671). ONE builder: the
46312
+ * virtual-doorbell migration and the admin UI's "Use as doorbell" preset both
46313
+ * call it, so a preset can never write a shape the migration would refuse as
46314
+ * "an unrelated existing block".
46315
+ */
46316
+ /** A rise closer than this to the previous one is the same press (D671). */
46317
+ var DOORBELL_RISE_DEBOUNCE_MS = 2e3;
46318
+ /** Every source cap of `source` that `SOURCE_CAP_ACTIVE_FIELD` knows AND the device has bound. */
46319
+ function doorbellFeatureSources(source, boundCaps) {
46320
+ return Object.keys(SOURCE_CAP_ACTIVE_FIELD).filter((cap) => Object.hasOwn(SOURCE_CAP_CHANGED_AT_FIELD, cap) && boundCaps.includes(cap)).toSorted().flatMap((cap) => {
46321
+ const activeField = SOURCE_CAP_ACTIVE_FIELD[cap];
46322
+ const changedAtField = SOURCE_CAP_CHANGED_AT_FIELD[cap];
46323
+ return activeField === void 0 || changedAtField === void 0 ? [] : [{
46324
+ source,
46325
+ cap,
46326
+ activeField,
46327
+ changedAtField
46328
+ }];
46329
+ });
45663
46330
  }
45664
- /**
45665
- * The static plan. `target` describes an EXISTING target device (one read);
45666
- * it is ignored for a new one. On an existing target each feature REPLACES a
45667
- * cap the device has natively, else ADDS it (D663).
45668
- */
45669
- function planComposition(composition, lookupCap, target) {
45670
- const planTarget = planTargetOf(composition, target);
45671
- if ("code" in planTarget) return refused(planTarget);
45672
- const results = composition.features.map((feature, index) => {
45673
- const result = feature.kind === "passthrough" ? refused(problem("reserved-variant", `features[${index}]`, `whole-capability passthrough of \`${feature.cap}\` arrives in slice 3`)) : planFeature(feature, index, featureTargetOf(planTarget, feature.cap), lookupCap);
45674
- return compositionFeatureEnabled(feature) ? result : {
45675
- problems: result.problems,
45676
- fields: [],
45677
- features: [],
45678
- events: []
46331
+ /** The D671 feature, byte for byte what the migration writes. Throws on zero sources. */
46332
+ function buildDoorbellCompositionFeature(input) {
46333
+ const sources = [...input.sources].toSorted((a, b) => `${a.source.addonId}/${a.source.stableId}#${a.cap}`.localeCompare(`${b.source.addonId}/${b.source.stableId}#${b.cap}`));
46334
+ if (sources.length === 0) throw new Error("doorbell composition needs at least one source");
46335
+ const edgeBindings = {};
46336
+ sources.forEach((entry, index) => {
46337
+ edgeBindings[`active${index}`] = {
46338
+ kind: "from",
46339
+ source: entry.source,
46340
+ cap: entry.cap,
46341
+ fieldPath: entry.activeField
46342
+ };
46343
+ edgeBindings[`changed${index}`] = {
46344
+ kind: "from",
46345
+ source: entry.source,
46346
+ cap: entry.cap,
46347
+ fieldPath: entry.changedAtField
45679
46348
  };
45680
46349
  });
45681
46350
  return {
45682
- problems: results.flatMap((r) => r.problems),
45683
- fields: results.flatMap((r) => r.fields),
45684
- features: results.flatMap((r) => r.features),
45685
- events: results.flatMap((r) => r.events)
45686
- };
45687
- }
45688
- function compositionSourceRefs(composition) {
45689
- const refs = composition.features.flatMap((f) => compositionFeatureEnabled(f) && f.kind === "fields" ? featureSources(f).flatMap(fieldReads).map((r) => r.source) : []);
45690
- return [...new Map(refs.map((r) => [compositionSourceKey(r), r])).values()];
45691
- }
45692
- /**
45693
- * The candidate's device: the existing target itself, else `self`, else a
45694
- * placeholder that cannot collide with a stored target. An existing target is
45695
- * known even on create, so a second customization of it is refused on create too.
45696
- */
45697
- function candidateSelf(composition, ctx, plan) {
45698
- return {
45699
- ref: composition.target.kind === "existing" ? composition.target.device : ctx.self ?? PENDING_SELF,
45700
- native: composition.target.kind === "existing" && ctx.target?.kind === "found" ? ctx.target : null,
45701
- replaced: replacedFieldKeys(plan)
45702
- };
45703
- }
45704
- /**
45705
- * `compositionFieldKey` of every field a REPLACE feature of `plan` owns — the
45706
- * candidate's own, and a stored peer's `CompositionPeer.replaced` (D663): one
45707
- * derivation, so the graph reads both the same way.
45708
- */
45709
- function replacedFieldKeys(plan) {
45710
- const replacing = new Set(plan.features.filter((f) => f.mode === "replace").map((f) => f.featureIndex));
45711
- return new Set(plan.fields.filter((f) => replacing.has(f.featureIndex)).map(compositionFieldKey));
45712
- }
45713
- /**
45714
- * A read of the candidate's own device. Its own composed output (a new device's
45715
- * field, an ADDED field) is the slice-1 own-field rule; on an existing target
45716
- * every other field — replaced, or not composed at all — is the NATIVE value,
45717
- * valid when the device serves that cap natively (D663, rule 5).
45718
- */
45719
- function selfReadProblems(read, at, fields, self) {
45720
- const readKey = `${read.cap}.${read.fieldPath}`;
45721
- if (fields.some((f) => compositionFieldKey(f) === readKey && !self.replaced.has(readKey))) return [];
45722
- if (self.native === null) return [problem("source-field-unknown", at, `this device has no composed field \`${read.cap}.${read.fieldPath}\``)];
45723
- if (isNativeCap(self.native, read.cap)) return [];
45724
- return [problem("source-capability-missing", at, `the target device (device ${self.native.deviceId}) has no native \`${read.cap}\``)];
45725
- }
45726
- function sourceProblems(fields, ctx, self) {
45727
- const selfKey = compositionSourceKey(self.ref);
45728
- return fields.flatMap((field) => field.reads.flatMap((read) => {
45729
- const at = compositionFieldAt(field);
45730
- const key = compositionSourceKey(read.source);
45731
- if (key === selfKey) return selfReadProblems(read, at, fields, self);
45732
- const desc = ctx.sources.get(key);
45733
- if (desc === void 0 || desc.kind === "unreadable") return [problem("source-unreadable", at, `could not read source \`${key}\` (${desc === void 0 ? "it was not read" : desc.error}) — the save is refused rather than stored unchecked`)];
45734
- if (desc.kind === "absent") return [problem("source-missing", at, `source \`${key}\` does not exist`)];
45735
- if (!desc.caps.has(read.cap)) return [problem("source-capability-missing", at, `source \`${key}\` (device ${desc.deviceId}) has no \`${read.cap}\``)];
45736
- return [];
45737
- }));
45738
- }
45739
- /**
45740
- * A cycle's node keys are `compositionReadKey` strings:
45741
- * `<addonId>/<stableId>#<cap>.<fieldPath>`. When a node belongs to the
45742
- * CANDIDATE itself (this composition being saved), pull its `cap`/`fieldPath`
45743
- * back out so the refusal can point at that exact field, matching the
45744
- * documented `features[N].fields.<path>` convention. A cap name has no `.`,
45745
- * so splitting `rest` on the FIRST `.` is exact; an item leaf's remainder
45746
- * (`items[desiccant].status`) is matched through `compositionFieldKey`.
45747
- */
45748
- function candidateFieldOfNode(nodeKey, candidateKey) {
45749
- const prefix = `${candidateKey}#`;
45750
- if (!nodeKey.startsWith(prefix)) return null;
45751
- const rest = nodeKey.slice(prefix.length);
45752
- const dot = rest.indexOf(".");
45753
- if (dot === -1) return null;
45754
- return {
45755
- cap: rest.slice(0, dot),
45756
- fieldPath: rest.slice(dot + 1)
45757
- };
45758
- }
45759
- /** The first node of a cycle's path that is one of THIS composition's own
45760
- * planned fields, as a documented-convention path; `'features'` when the
45761
- * cycle runs entirely through other stored compositions. */
45762
- function cyclePath(nodePath, candidateKey, fields) {
45763
- for (const nodeKey of nodePath) {
45764
- const hit = candidateFieldOfNode(nodeKey, candidateKey);
45765
- if (hit === null) continue;
45766
- const hitKey = `${hit.cap}.${hit.fieldPath}`;
45767
- const field = fields.find((f) => compositionFieldKey(f) === hitKey);
45768
- if (field !== void 0) return compositionFieldAt(field);
45769
- }
45770
- return "features";
45771
- }
45772
- /** The first unread device any of `nodes` belongs to; null when none does. */
45773
- function unreadDeviceOf(nodes, unread) {
45774
- for (const [key, error] of unread) if (nodes.some((node) => node.startsWith(`${key}#`))) return {
45775
- key,
45776
- error
45777
- };
45778
- return null;
45779
- }
45780
- /**
45781
- * Cycle check runs against the CANDIDATE (this composition, as block
45782
- * `ctx.blockId`, writing `self.ref`) plus every OTHER stored composition,
45783
- * decided per strongly connected component (`findCandidateCycles`): a cyclic
45784
- * component holding a candidate node refuses, with one representative cycle
45785
- * through it; one without is not this save's cycle. A
45786
- * stored composition of the same block is its old version; another block on
45787
- * the same device, or two stored peers sharing a device, make
45788
- * `compositionEdges` throw `CompositionGraphError` — refused BY NAME as
45789
- * `duplicate-target` (D391, D663) instead of escaping as an uncaught throw.
45790
- */
45791
- function cycleProblems(composition, ctx, fields, self) {
45792
- const candidate = {
45793
- blockId: ctx.blockId ?? "(unsaved)",
45794
- target: self.ref,
45795
- composition,
45796
- replaced: self.replaced
45797
- };
45798
- const candidateKey = compositionSourceKey(candidate.target);
45799
- const unread = ctx.unreadTargets ?? /* @__PURE__ */ new Map();
45800
- try {
45801
- return findCandidateCycles(candidate, ctx.peers).map((c) => {
45802
- const at = cyclePath(c.path, candidateKey, fields);
45803
- const through = unreadDeviceOf([...c.component], unread);
45804
- return through === null ? problem("cycle", at, `a field reads itself: ${c.path.join(" → ")}`) : problem("cycle", at, `possible cycle through \`${through.key}\` — its state could not be read (${through.error}): ${c.path.join(" → ")}`);
45805
- });
45806
- } catch (err) {
45807
- if (err instanceof CompositionGraphError) return [problem("duplicate-target", "features", err.message)];
45808
- throw err;
45809
- }
45810
- }
45811
- function validateComposition(composition, ctx) {
45812
- const plan = planComposition(composition, ctx.lookupCap, ctx.target ?? void 0);
45813
- const self = candidateSelf(composition, ctx, plan);
45814
- const cycles = cycleProblems(composition, ctx, plan.fields, self);
45815
- const problems = [
45816
- ...plan.problems,
45817
- ...sourceProblems(plan.fields, ctx, self),
45818
- ...cycles
45819
- ];
45820
- return {
45821
- ok: problems.length === 0,
45822
- problems,
45823
- fields: [...plan.fields],
45824
- features: [...plan.features],
45825
- events: [...plan.events]
46351
+ kind: "fields",
46352
+ cap: "doorbell",
46353
+ enabled: input.enabled,
46354
+ fields: {
46355
+ lastPressedAt: {
46356
+ kind: "expression",
46357
+ expr: `latest(${sources.map((_, index) => `rose(active${index}, changed${index}, ${DOORBELL_RISE_DEBOUNCE_MS})`).join(", ")})`,
46358
+ bindings: edgeBindings
46359
+ },
46360
+ pressCountSinceStart: {
46361
+ kind: "expression",
46362
+ expr: "count(lastPressedAt)",
46363
+ bindings: { lastPressedAt: {
46364
+ kind: "from",
46365
+ source: {
46366
+ addonId: input.camera.addonId,
46367
+ stableId: input.camera.stableId
46368
+ },
46369
+ cap: "doorbell",
46370
+ fieldPath: "lastPressedAt"
46371
+ } }
46372
+ }
46373
+ }
45826
46374
  };
45827
46375
  }
45828
46376
  //#endregion
@@ -45951,7 +46499,6 @@ var RUNTIME_DEFAULTS = {
45951
46499
  models: "camstack-data/models"
45952
46500
  },
45953
46501
  providers: [],
45954
- "ffmpeg.binaryPath": "ffmpeg",
45955
46502
  "ffmpeg.hwAccel": "auto",
45956
46503
  "ffmpeg.threadCount": 0,
45957
46504
  "auth.tokenExpiry": "30d"
@@ -52949,6 +53496,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
52949
53496
  addonId: null,
52950
53497
  access: "view"
52951
53498
  },
53499
+ "coreBlocks.listComposableCaps": {
53500
+ capName: "core-blocks",
53501
+ capScope: "system",
53502
+ addonId: null,
53503
+ access: "view"
53504
+ },
52952
53505
  "coreBlocks.listCompositions": {
52953
53506
  capName: "core-blocks",
52954
53507
  capScope: "system",
@@ -56633,6 +57186,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
56633
57186
  addonId: null,
56634
57187
  access: "create"
56635
57188
  },
57189
+ "pipelineOrchestrator.setCameraSensors": {
57190
+ capName: "pipeline-orchestrator",
57191
+ capScope: "system",
57192
+ addonId: null,
57193
+ access: "create"
57194
+ },
56636
57195
  "pipelineOrchestrator.setCameraStepOverride": {
56637
57196
  capName: "pipeline-orchestrator",
56638
57197
  capScope: "system",
@@ -60678,6 +61237,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
60678
61237
  form: "single",
60679
61238
  optional: false
60680
61239
  }],
61240
+ "pipelineOrchestrator.setCameraSensors": [{
61241
+ name: "deviceId",
61242
+ form: "single",
61243
+ optional: false
61244
+ }],
60681
61245
  "pipelineOrchestrator.setCameraStepOverride": [{
60682
61246
  name: "deviceId",
60683
61247
  form: "single",
@@ -61500,6 +62064,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
61500
62064
  "pipelineOrchestrator.getPipelineDevicePin",
61501
62065
  "pipelineOrchestrator.resolvePipeline",
61502
62066
  "pipelineOrchestrator.setCameraPipelineForAgent",
62067
+ "pipelineOrchestrator.setCameraSensors",
61503
62068
  "pipelineOrchestrator.setCameraStepOverride",
61504
62069
  "pipelineOrchestrator.setCameraStepToggle",
61505
62070
  "pipelineOrchestrator.setCameraSwitch",
@@ -62152,6 +62717,7 @@ function createSystemProxy(api) {
62152
62717
  getComposition: (input) => dispatch("coreBlocks", "getComposition", "query", input),
62153
62718
  listCompositions: (input) => dispatch("coreBlocks", "listCompositions", "query", input),
62154
62719
  getCustomization: (input) => dispatch("coreBlocks", "getCustomization", "query", input),
62720
+ listComposableCaps: (input) => dispatch("coreBlocks", "listComposableCaps", "query", input),
62155
62721
  validateComposition: (input) => dispatch("coreBlocks", "validateComposition", "mutation", input)
62156
62722
  },
62157
62723
  decoder: {
@@ -62483,6 +63049,7 @@ function createSystemProxy(api) {
62483
63049
  getNodeInferenceDevices: (input) => dispatch("pipelineOrchestrator", "getNodeInferenceDevices", "query", input),
62484
63050
  resetNodePipelineDefaults: (input) => dispatch("pipelineOrchestrator", "resetNodePipelineDefaults", "mutation", input),
62485
63051
  getCameraStatuses: (input) => dispatch("pipelineOrchestrator", "getCameraStatuses", "query", input),
63052
+ setCameraSensors: (input) => dispatch("pipelineOrchestrator", "setCameraSensors", "mutation", input),
62486
63053
  reconcileFromDisk: (input) => dispatch("pipelineOrchestrator", "reconcileFromDisk", "mutation", input),
62487
63054
  getReconcileFromDiskStatus: (input) => dispatch("pipelineOrchestrator", "getReconcileFromDiskStatus", "query", input),
62488
63055
  listTemplates: (input) => dispatch("pipelineOrchestrator", "listTemplates", "query", input),
@@ -66677,334 +67244,6 @@ var DEVICE_TYPE_INFO = { ["camera"]: {
66677
67244
  icon: "camera"
66678
67245
  } };
66679
67246
  //#endregion
66680
- //#region src/units/unit-table.ts
66681
- /**
66682
- * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
66683
- * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
66684
- * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
66685
- * decimals). K derives from `°C = K − 273.15`.
66686
- */
66687
- var UNIT_TABLE = {
66688
- "°C": {
66689
- dimension: "temperature",
66690
- factor: 1,
66691
- offset: 0
66692
- },
66693
- "°F": {
66694
- dimension: "temperature",
66695
- factor: 5 / 9,
66696
- offset: -160 / 9
66697
- },
66698
- K: {
66699
- dimension: "temperature",
66700
- factor: 1,
66701
- offset: -273.15
66702
- },
66703
- hPa: {
66704
- dimension: "pressure",
66705
- factor: 1,
66706
- offset: 0
66707
- },
66708
- kPa: {
66709
- dimension: "pressure",
66710
- factor: 10,
66711
- offset: 0
66712
- },
66713
- Pa: {
66714
- dimension: "pressure",
66715
- factor: .01,
66716
- offset: 0
66717
- },
66718
- mbar: {
66719
- dimension: "pressure",
66720
- factor: 1,
66721
- offset: 0
66722
- },
66723
- bar: {
66724
- dimension: "pressure",
66725
- factor: 1e3,
66726
- offset: 0
66727
- },
66728
- inHg: {
66729
- dimension: "pressure",
66730
- factor: 33.8639,
66731
- offset: 0
66732
- },
66733
- mmHg: {
66734
- dimension: "pressure",
66735
- factor: 1.33322,
66736
- offset: 0
66737
- },
66738
- psi: {
66739
- dimension: "pressure",
66740
- factor: 68.9476,
66741
- offset: 0
66742
- },
66743
- "m/s": {
66744
- dimension: "speed",
66745
- factor: 1,
66746
- offset: 0
66747
- },
66748
- "km/h": {
66749
- dimension: "speed",
66750
- factor: 1 / 3.6,
66751
- offset: 0
66752
- },
66753
- mph: {
66754
- dimension: "speed",
66755
- factor: .44704,
66756
- offset: 0
66757
- },
66758
- kn: {
66759
- dimension: "speed",
66760
- factor: .514444,
66761
- offset: 0
66762
- },
66763
- "mm/h": {
66764
- dimension: "precipitation-rate",
66765
- factor: 1,
66766
- offset: 0
66767
- },
66768
- "in/h": {
66769
- dimension: "precipitation-rate",
66770
- factor: 25.4,
66771
- offset: 0
66772
- },
66773
- m: {
66774
- dimension: "length",
66775
- factor: 1,
66776
- offset: 0
66777
- },
66778
- mm: {
66779
- dimension: "length",
66780
- factor: .001,
66781
- offset: 0
66782
- },
66783
- cm: {
66784
- dimension: "length",
66785
- factor: .01,
66786
- offset: 0
66787
- },
66788
- km: {
66789
- dimension: "length",
66790
- factor: 1e3,
66791
- offset: 0
66792
- },
66793
- in: {
66794
- dimension: "length",
66795
- factor: .0254,
66796
- offset: 0
66797
- },
66798
- ft: {
66799
- dimension: "length",
66800
- factor: .3048,
66801
- offset: 0
66802
- },
66803
- mi: {
66804
- dimension: "length",
66805
- factor: 1609.344,
66806
- offset: 0
66807
- },
66808
- lx: {
66809
- dimension: "illuminance",
66810
- factor: 1,
66811
- offset: 0
66812
- },
66813
- "W/m²": {
66814
- dimension: "irradiance",
66815
- factor: 1,
66816
- offset: 0
66817
- },
66818
- W: {
66819
- dimension: "power",
66820
- factor: 1,
66821
- offset: 0
66822
- },
66823
- kW: {
66824
- dimension: "power",
66825
- factor: 1e3,
66826
- offset: 0
66827
- },
66828
- VA: {
66829
- dimension: "apparent-power",
66830
- factor: 1,
66831
- offset: 0
66832
- },
66833
- Wh: {
66834
- dimension: "energy",
66835
- factor: 1,
66836
- offset: 0
66837
- },
66838
- kWh: {
66839
- dimension: "energy",
66840
- factor: 1e3,
66841
- offset: 0
66842
- },
66843
- MWh: {
66844
- dimension: "energy",
66845
- factor: 1e6,
66846
- offset: 0
66847
- },
66848
- V: {
66849
- dimension: "voltage",
66850
- factor: 1,
66851
- offset: 0
66852
- },
66853
- mV: {
66854
- dimension: "voltage",
66855
- factor: .001,
66856
- offset: 0
66857
- },
66858
- A: {
66859
- dimension: "current",
66860
- factor: 1,
66861
- offset: 0
66862
- },
66863
- mA: {
66864
- dimension: "current",
66865
- factor: .001,
66866
- offset: 0
66867
- },
66868
- ppm: {
66869
- dimension: "concentration-volume",
66870
- factor: 1,
66871
- offset: 0
66872
- },
66873
- ppb: {
66874
- dimension: "concentration-volume",
66875
- factor: .001,
66876
- offset: 0
66877
- },
66878
- "µg/m³": {
66879
- dimension: "concentration-mass",
66880
- factor: 1,
66881
- offset: 0
66882
- },
66883
- "mg/m³": {
66884
- dimension: "concentration-mass",
66885
- factor: 1e3,
66886
- offset: 0
66887
- },
66888
- kg: {
66889
- dimension: "mass",
66890
- factor: 1,
66891
- offset: 0
66892
- },
66893
- g: {
66894
- dimension: "mass",
66895
- factor: .001,
66896
- offset: 0
66897
- },
66898
- lb: {
66899
- dimension: "mass",
66900
- factor: .453592,
66901
- offset: 0
66902
- },
66903
- oz: {
66904
- dimension: "mass",
66905
- factor: .0283495,
66906
- offset: 0
66907
- },
66908
- "%": {
66909
- dimension: "percentage",
66910
- factor: 1,
66911
- offset: 0
66912
- }
66913
- };
66914
- //#endregion
66915
- //#region src/units/convert.ts
66916
- /**
66917
- * Pure unit-conversion API over `UNIT_TABLE`. No dependencies, no side effects.
66918
- *
66919
- * Conversion is refused (throws `UnitConversionError`, or returns `undefined`
66920
- * from the `try*` variant) whenever a unit is unknown or the two units belong
66921
- * to different dimensions — cross-dimension conversion is deliberately
66922
- * impossible so a render override can never make the value and its unit label
66923
- * disagree.
66924
- *
66925
- * Callers pass units through `normalizeUnit` (`../device/source-info.ts`) BEFORE
66926
- * calling here — the table keys only canonical spellings.
66927
- */
66928
- /** Thrown by `convertUnit` when a conversion is refused. Carries the offending
66929
- * units + a machine-readable `reason` for callers that branch on the cause. */
66930
- var UnitConversionError = class extends Error {
66931
- from;
66932
- to;
66933
- reason;
66934
- constructor(from, to, reason) {
66935
- super(`[units] cannot convert '${from}' → '${to}': ${reason}`);
66936
- this.name = "UnitConversionError";
66937
- this.from = from;
66938
- this.to = to;
66939
- this.reason = reason;
66940
- }
66941
- };
66942
- /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
66943
- function specFor(unit) {
66944
- return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
66945
- }
66946
- /** The dimension a unit belongs to, or `undefined` for an unknown unit. */
66947
- function unitDimension(unit) {
66948
- return specFor(unit)?.dimension;
66949
- }
66950
- /** Value in `spec`'s unit → its dimension's canonical unit. */
66951
- function toCanonical(value, spec) {
66952
- return value * spec.factor + spec.offset;
66953
- }
66954
- /** Canonical-unit value → the unit described by `spec`. */
66955
- function fromCanonical(canonical, spec) {
66956
- return (canonical - spec.offset) / spec.factor;
66957
- }
66958
- /**
66959
- * Convert `value` from unit `from` to unit `to`. Identity when `from === to`.
66960
- * Throws `UnitConversionError` when either unit is unknown or the units belong
66961
- * to different dimensions.
66962
- */
66963
- function convertUnit(value, from, to) {
66964
- if (from === to) return value;
66965
- const fromSpec = specFor(from);
66966
- if (!fromSpec) throw new UnitConversionError(from, to, "unknown-from");
66967
- const toSpec = specFor(to);
66968
- if (!toSpec) throw new UnitConversionError(from, to, "unknown-to");
66969
- if (fromSpec.dimension !== toSpec.dimension) throw new UnitConversionError(from, to, "cross-dimension");
66970
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
66971
- }
66972
- /**
66973
- * Graceful variant for the render path: returns the converted value, or
66974
- * `undefined` when the conversion is refused (unknown unit / cross-dimension).
66975
- * Never throws — a render caller falls back to the raw value + source unit.
66976
- */
66977
- function tryConvertUnit(value, from, to) {
66978
- if (from === to) return value;
66979
- const fromSpec = specFor(from);
66980
- if (!fromSpec) return void 0;
66981
- const toSpec = specFor(to);
66982
- if (!toSpec) return void 0;
66983
- if (fromSpec.dimension !== toSpec.dimension) return void 0;
66984
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
66985
- }
66986
- /**
66987
- * Whether `value` can be converted between `from` and `to` (same dimension,
66988
- * both known). Cheap boolean probe for the UI's same-dimension unit picker and
66989
- * the resolver's convertibility branch — compute ONCE so a unit label and its
66990
- * value math can never disagree.
66991
- */
66992
- function canConvertUnit(from, to) {
66993
- if (from === to) return true;
66994
- const fromDim = unitDimension(from);
66995
- if (fromDim === void 0) return false;
66996
- return fromDim === unitDimension(to);
66997
- }
66998
- /**
66999
- * Every known unit spelling in a dimension (table insertion order — canonical
67000
- * unit first). Powers the UI's same-dimension unit picker.
67001
- */
67002
- function unitsForDimension(dimension) {
67003
- const out = [];
67004
- for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
67005
- return out;
67006
- }
67007
- //#endregion
67008
67247
  //#region src/util/location-match.ts
67009
67248
  /**
67010
67249
  * Pure fuzzy matcher for adoption location import. Normalized
@@ -68305,4 +68544,4 @@ function enumerateInferenceDevices(hw) {
68305
68544
  return out;
68306
68545
  }
68307
68546
  //#endregion
68308
- export { ACCESSORY_LABEL, ACCESS_ROLES, ALEXA_EGRESS_PROFILE, ALL_CAPABILITY_DEFINITIONS, APPLE_SA_TO_MACRO, ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT, AUDIO_ANALYSIS_CAP_NAME, AUDIO_BACKEND_CHOICES, AUDIO_CHUNK_FORMATS, AUDIO_MACRO_LABELS, AUDIO_NOT_CLASSIFIED_REASONS, AUDIO_PRESETS, AUDIO_SCALE_EPOCH_ISO, AUDIO_SCALE_EPOCH_MS, AccessoriesStatusSchema, AccessoryKind, AddBrokerInputSchema, AddonAutoUpdateSchema, AddonListItemSchema, AddonPageDeclarationSchema, AddonPageInfoSchema, AdminLinkTargetEnum, AdoptInputSchema as AdoptionAdoptInputSchema, AdoptResultSchema as AdoptionAdoptResultSchema, AdoptionCandidateResultSchema, AdoptionFilterSchema, GetCandidateInputSchema as AdoptionGetCandidateInputSchema, AdoptionJobSchema, AdoptionJobStateSchema, ListCandidatesInputSchema as AdoptionListCandidatesInputSchema, ListCandidatesOutputSchema as AdoptionListCandidatesOutputSchema, AdoptionOutcomeSchema, ReleaseInputSchema as AdoptionReleaseInputSchema, AdoptionStatusSchema, AgentLoadSummarySchema, AirQualitySensorStatusSchema, AlarmArmModeSchema, AlarmPanelStatusSchema, AlarmStateSchema, AlertSchema, AlertSeveritySchema, AlertSourceSchema, AlertStatusSchema, AmbientLightSensorStatusSchema, AnalyticsLtsSeriesSchema, ApiKeyRecordSchema, ApiKeySummarySchema, AppleFmAvailabilitySchema, AppleFmUnavailableReasonSchema, ArchiveEntrySchema, ArchiveManifestSchema, ArchivedDebugNoteQueryInputSchema, ArchivedDebugNoteSchema, AttachmentMediaTypeSchema, AttachmentSchema, AudioAnalysisResultSchema, AudioAnalysisSettingsSchema, AudioAttachDeviceInputSchema, AudioAttachDeviceResultSchema, AudioChunkFormatSchema, AudioChunkInputSchema, AudioClassSummarySchema, AudioClassificationLabelSchema, AudioClassificationResultSchema, AudioClassifyOutcomeSchema, AudioCodecInfoSchema, AudioDecodeSessionConfigSchema, AudioDetachDeviceResultSchema, AudioEncodeSchema, AudioEncodeSessionConfigSchema, AudioEncodedChunkSchema, AudioEventSchema, AudioLevelSchema, AudioMetricsHistoryPointSchema, AudioMetricsHistorySchema, AudioMetricsSnapshotSchema, AudioPcmChunkSchema, AudioStreamPickSchema, AuthResultSchema, AutoUpdateSettingsSchema, AutomationActionSchema, AutomationConditionOperatorSchema, AutomationConditionSchema, AutomationControlStatusSchema, AutomationRecipeSchema, AutomationTriggerSchema, AvailableIntegrationTypeSchema, BASE_DEVICE_CAPS, BASE_LIVE_EGRESS_PROFILE, BATTERY_DEVICE_PROFILE, BATTERY_UNREACHABLE_AFTER_MS, BIRTH_DECISION_DEFAULT_LIMIT, BOOT_RECOVERY_BACKOFF_MS, BUILTIN_RESULT_KINDS, BackgroundRunRegistry, BacklightModeSchema, BackupDestinationInfoSchema, BackupEntrySchema, BackupRunPhaseSchema, BackupRunSchema, BackupRunStateSchema, BackupTriggerResultSchema, BaseAddon, BaseDevice, BaseDeviceProvider, BatteryStatusSchema, BinaryStatusSchema, BirthDecisionQueryInputSchema, BirthDecisionRecordSchema, BirthDecisionVerdictSchema, BoundingBoxSchema, BrightnessStatusSchema, AddInputSchema as BrokerAddInputSchema, BrokerAudioClientSchema, BrokerClientsSchema, BrokerConnectionDetailsSchema, BrokerConsumerAttributionSchema, BrokerConsumerKindSchema, BrokerDecodedClientSchema, BrokerEncodedClientSchema, GetStateInputSchema as BrokerGetStateInputSchema, BrokerInfoSchema, BrokerProviderInfoSchema, PublishInputSchema as BrokerPublishInputSchema, RegistryStatusSchema as BrokerRegistryStatusSchema, BrokerRtspClientSchema, BrokerStatsSchema, BrokerStatusEnum, BrokerStatusSchema, SubscribeInputSchema as BrokerSubscribeInputSchema, SubscribeResultSchema as BrokerSubscribeResultSchema, TestConnectionResultSchema as BrokerTestConnectionResultSchema, UnsubscribeInputSchema as BrokerUnsubscribeInputSchema, BulkRecordSchema, CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_SWITCH_CATALOG, CAMERA_SWITCH_ORDER, CAMERA_TRIGGER, CAM_PROFILE_ORDER, CAPABILITY_NAMES, CAPABILITY_ROUTER_KEYS, CAP_NAMES_WITH_STATUS, CAP_NODE_PIN_CONTEXT_KEY, CAP_PROVIDER_KIND_MAP, CLASS_MAP_MACRO_TARGETS, CLIP_BROKER_PACED_RATES, CLIP_PLAYBACK_OPTIONS, CLIP_REALTIME_SOURCE_RATES, CLIP_REASON_HEADER_MAX, CLIP_SEARCH_STRICTNESS, CLIP_STILL_DISPOSITION_HEADER, CLIP_STILL_REASON_CODE_HEADER, CLIP_STILL_REASON_HEADER, CLIP_STREAM_SOURCE_RATES, CLIP_STREAM_TRANSPORT_HEADER, CLIP_STRICTNESS_FACTOR, CLIP_VECTOR_INDEX_PATTERN, CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS, CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, COCO_80_LABELS, COCO_TO_MACRO, COMPOSED_DEVICE_STABLE_ID_PREFIX, COMPOSED_ITEM_FIXED_FIELDS, COMPOSER_ADDON_ID, COMPOSER_RUNNER_ID, COMPOSITION_EVENT_CATEGORY, COMPOSITION_ITEM_ARRAY_PATH, COMPOSITION_ITEM_KEY_RE, CONNECTION_TEST_TIMEOUT_MS, CONTAINER_CHILD_PRIORITY, CORE_BLOCKS_ADDON_ID, CORE_BLOCK_ADDON_PREFIX, CUSTOMIZATION_BLOCK_NAME_PREFIX, CamProfileSchema, CamStreamDescriptorSchema, CamStreamKindSchema, CamStreamResolutionSchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraCredentialsSchema, CameraCredentialsStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, CameraMotionStatusSchema, CameraOccupancySnapshotForDeviceSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSensorAttachmentSchema, CameraSensorRefSchema, CameraSensorsConfigSchema, CameraSensorsModeSchema, CameraSensorsNotForwardedSchema, CameraSensorsStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusDegradationReasonSchema, CameraStatusDegradationSchema, CameraStatusSchema, CameraStatusStageSchema, CameraStreamSchema, CameraSwitchAuthoritySchema, CameraSwitchGroupSchema, CameraSwitchIdSchema, CameraSwitchSchema, CameraSwitchUnavailableReasonSchema, CameraSwitchWarningSchema, CandidateQueryFilterSchema, CapScopeSchema, CapabilityBindingsSchema, CarbonMonoxideStatusSchema, ChargingStatus, ClaimOutcomeSchema, ClaimsListingSchema, ClientNetworkStatsSchema, ClimateControlStatusSchema, ClipBytesOfferSchema, ClipBytesSchema, ClipExportFailureSchema, ClipModelMetaSchema, ClipPlaybackOptionsSchema, ClipPlaybackSchema, ClipSchema, ClipSearchStrictnessSchema, ClipSourceAvailabilitySchema, ClipSourceSchema, ClipStillDispositionSchema, ClipStillRefusalCodeSchema, ClipStreamAudioReasonSchema, ClipStreamAudioSchema, ClipStreamDialSchema, ClipWakeSchema, ClusterAddonNodeDeploymentSchema, ClusterAddonStatusEntrySchema, ClusterModelChoiceSchema, CollectionColumnSchema, CollectionIndexSchema, ColorStatusSchema, ComposerApplyInputSchema, ComposerApplyResultSchema, ComposerBlockSchema, ComposerBlockVerdictSchema, ComposerUnreadableBlockSchema, CompositionBindingSchema, CompositionBlockInputSchema, CompositionBlockStateSchema, CompositionCodeSourceSchema, CompositionCommandTargetSchema, CompositionCustomizationReadSchema, CompositionEventPlanSchema, CompositionExistingTargetSchema, CompositionExpressionSourceSchema, CompositionFeatureModeSchema, CompositionFeaturePlanSchema, CompositionFeatureSchema, CompositionFieldItemSchema, CompositionFieldKindSchema, CompositionFieldPlanSchema, CompositionFieldReadSchema, CompositionFieldRoleSchema, CompositionFieldSourceSchema, CompositionFieldStateKindSchema, CompositionFieldStateSchema, CompositionFieldsFeatureSchema, CompositionForwardCommandSchema, CompositionFromSourceSchema, CompositionGetReadSchema, CompositionGraphError, CompositionItemEntrySchema, CompositionListReadSchema, CompositionLiteralBindingSchema, CompositionNewTargetSchema, CompositionPassthroughFeatureSchema, CompositionProblemCodeSchema, CompositionProblemSchema, CompositionRunStatusSchema, CompositionSchema, CompositionSourceRefSchema, CompositionStateReadSchema, CompositionTargetSchema, CompositionUnavailableModeSchema, CompositionValidationSchema, CompositionViewSchema, ConfigEntrySchema, ConfigSectionWithValuesSchema, ConfigTabDeclarationSchema, ConnectionTestDescriptorSchema, ConnectionTestInputSchema, ConnectionTestOutcomeSchema, ConnectivityStatusSchema, ConsumableItemSchema, ConsumableRemainingSchema, ConsumableRemainingUnitSchema, ConsumablesStatusSchema, ContactStatusSchema, ControlKindSchema, ControlStatusSchema, ConvertArtifactSchema, ConvertResultSchema, ConvertTargetSchema, CoreBlockCompileResultSchema, CoreBlockInputSchema, CoreBlockPlacementSchema, CoreBlockSchema, CoreBlockSourceSchema, CoreBlockStatusSchema, CoverStateSchema, CoverStatusSchema, CreateApiKeyInputSchema, CreateApiKeyResultSchema, CreateIntegrationInputSchema, CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, CreateUserInputSchema, CustomActionInputSchema, CustomModelDescriptorSchema, DATAPLANE_SECRET_HEADER, DAYS_PER_WEEK, DAY_NAMES, DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DEFAULT_ADDON_PLACEMENT, DEFAULT_AUDIO_ANALYZER_CONFIG, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_DECODER_HWACCEL_CONFIG, DEFAULT_DETAIL_CROP_CONVENTION, DEFAULT_EVENTS_BAND_BUFFER_SEC, DEFAULT_EVENT_COLOR, DEFAULT_FEATURES, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, DEFAULT_NATIVE_LEASE_SETTINGS, DEFAULT_OVERLAY_LAYERS, DEFAULT_POOL_MEMORY_POLICY, DEFAULT_RECORDING_PROFILES, DEFAULT_RETENTION, DEFAULT_RUNTIME_STATE_DURABILITY, DEFAULT_TIMELAPSE_PREVIEW_TEXT, DEFAULT_TOKEN_EXPIRY, DERIVED_CAMERA_SILENCED_CAP_NAMES, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, DETECTION_MACRO_CLASSES, DETECTION_PIPELINE_CAP_NAME, DEVICE_BACKEND_TO_FORMAT, DEVICE_CAP_NAMES, DEVICE_CHILDREN_BATCH_MAX, DEVICE_PROFILES, DEVICE_RESTORE_RETRY_CONCURRENCY, DEVICE_RESTORE_RETRY_DELAYS_MS, DEVICE_SCOPED_CAPS, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATE_READERS, DEVICE_STATUS_METHOD, DEVICE_TYPE_CONTROL_KIND, DEVICE_TYPE_INFO, DISPLAY_ICON_GROUPS, DISPLAY_ICON_KEYS, DISPLAY_ICON_OFFERED_KEYS, DISPLAY_ICON_VOCABULARY, DOORBELL_SOURCE_SLOT, EngineInfoSchema as DataStoreEngineInfoSchema, DayNightModeSchema, DayNightOptionsSchema, DayNightSettingsPatchSchema, DayNightStatusSchema, DeclaredDevices, DecodedAudioChunkSchema, DecodedFrameSchema, DecoderSessionConfigSchema, DecoderStatsSchema, DeleteIntegrationResultSchema, DetailCropConventionSchema, DetectionCatalogClassMapSchema, DetectionSourceSchema, DetectionSourcesSchema, DeviceAdminLinkSchema, DeviceCodeSeveritySchema, DeviceConfig, DeviceDiscoveryStatusSchema, ExposeInputSchema as DeviceExportExposeInputSchema, DeviceExportStatusSchema, UnexposeInputSchema as DeviceExportUnexposeInputSchema, DeviceFeature, DeviceInfoSchema, DeviceNetworkStatsSchema, DeviceRestoreRetryScheduler, DeviceRole, DeviceRuntimeState, DeviceSelectorSchema, DeviceStatusSchema, DeviceType, DiagnosticIdSchema, DiagnosticWindowPatchSchema, DiagnosticWindowSchema, DiscoveredChildDeviceSchema, DiscoveredChildStatusSchema, DiscoveredDeviceSchema, DiscoveredTargetSchema, DiskReconcileJobSchema, DisposerChain, DoorbellPressEventSchema, DoorbellSourceSlotValueSchema, DoorbellStatusSchema, EMBEDDING_MODEL_FAILED, EMBEDDING_REQUIREMENTS_FAILED, EMBEDDING_REQUIREMENTS_UNAVAILABLE, EVENTFUL_CAP_NAMES, EVENT_DENSITY_BATCH_MAX, EVENT_KIND_BY_CAP, EVENT_OWNER_TYPES, EVENT_PAD_MS, EVENT_TAXONOMY, EXPORT_DENSE_MAX_RANGES, EXPRESSION_BUILTINS, EXPRESSION_BUILTIN_NAMES, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, EXTENSION_HOST_DEVICE_TYPES, EXTENSION_SLOTS, EXTENSION_SLOT_IDS, EXTENSION_SLOT_LISTING_METHOD, EXTENSION_SLOT_REF_SEPARATOR, EffectiveTuningSchema, EgressEncodeSchema, EgressRateControlSchema, EgressTranscodeRequestSchema, EgressTranscodeSchema, ElementConfigStore, EmbeddingFailedModelSchema, EmbeddingFailedRequirementSchema, EmbeddingInfoSchema, EmbeddingRefusalCodeSchema, EmbeddingResultSchema, EmbeddingTowerSchema, EncodeProfileSchema, EncodedPacketSchema, EnrichedWidgetMetadataSchema, EnumSensorDateTimeFormatSchema, EnumSensorStatusSchema, EventCategory, EventDensityBucketSchema, EventDensityForDeviceSchema, EventEmitterStatusSchema, EventFireSchema, EventKindCategorySchema, EventKindDescriptorSchema, EventKindIconSchema, EventKindSchema, EventKindsForDeviceSchema, EventMediaArtifactSchema, EventMediaCoverageSchema, EventMediaKindSchema, EventMediaProductionSchema, EventOwnerTypeSchema, EventSourceType, ExportBytesSchema, ExportClipSubjectSchema, ExportDenseRangeSchema, ExportDenseSchema, ExportDownloadSchema, ExportFootageSubjectSchema, ExportOptionsSchema, ExportRecordSchema, ExportSetupFieldSchema, ExportSetupSchema, ExportSpeedSchema, ExportStateSchema, ExportSubjectSchema, ExportTimelapseSchema, ExposedDeviceSchema, ExposureModeSchema, ExpressionBindingSourceSchema, ExpressionEvalError, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionParseError, ExpressionSourceSchema, ExtensionCandidateSchema, ExtensionCandidatesSchema, ExtensionSetResultSchema, ExtensionSetSlotInputSchema, ExtensionSlotActivationSchema, ExtensionSlotIdSchema, ExtensionSlotRefInputSchema, ExtensionSlotRowSchema, ExtensionSlotSourceSchema, ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema, ExtensionSlotValueSchema, ExtensionSourceAvailabilitySchema, ExtensionSourceHealthSchema, ExtensionSourceSchema, FEEDER_EXAMPLE_ADDON_ID, FEEDER_EXAMPLE_HA_DEVICE_ID, FIRST_LEVEL_MACRO_CLASSES, FULL_IMAGE_BBOX, FailureContributionSchema, FailureCounters, FailureReasonCountSchema, FanControlStatusSchema, FanDirectionSchema, FeatureManifestSchema, FeatureProbeStatusSchema, FieldClaimModeSchema, FieldClaimSchema, FloodStatusSchema, Fmp4BoxSplitter, FrameHandleFormatSchema, FrameHandleSchema, FrameInputSchema, FrameLazyCountersSchema, FrameLazyMetricsSchema, G711_SCALE_CORRECTION_DB, GasStatusSchema, GetLoggingSettingsInputSchema, GetStreamWithCodecInputSchema, GlobalMetricsSchema, GridLayoutPatchSchema, GridLayoutViewSchema, HAP_AUDIO_BASE, HAP_AUDIO_BITRATE_KBPS, HAP_AUDIO_VBV_KBITS, HAP_KEYFRAME_INTERVAL_SEC, HF_BASE_URL, HF_REPO, HOURS_PER_DAY, HWACCEL_OPTIONS, HealthStatusSchema, HfModelResolutionSchema, HistoryPointSchema, HistoryResolutionEnum, HumidifierStatusSchema, HumiditySensorStatusSchema, HvacModeSchema, INFERENCE_DEVICE_EXCLUSION_REASONS, ImageContractSchema, ImageContractStateSchema, ImageRotateSchema, ImageSettingsOptionsSchema, ImageSettingsPatchSchema, ImageSettingsStatusSchema, ImageStatusSchema, InferenceDeviceExclusionReasonSchema, IngestOwnerSchema, InstalledPackageSchema, IntegrationLiteSchema, IntegrationWithStateSchema, IntercomAbilitySchema, IntercomStatusSchema, KNOWN_CAP_NAMES, KeyEventSchema, LEGACY_READ_ONLY_CONFIG_KEY, LINKED_DEVICES_SLOT, LOAD_CONTRIBUTION_ATTRIBUTIONS, LOAD_CONTRIBUTION_ROLES, LOCATION_DESCRIPTION_MAX, LOCATION_ICON_FALLBACK, LOCATION_ICON_IDS, LOG_CHANNEL_TICK_MS, LOG_LEVEL_RANK, LTS_SCOPE_CLASS_SEPARATOR, LabelAttributionSchema, LabelDefinitionSchema, LabelTierSchema, LawnMowerActivitySchema, LawnMowerControlStatusSchema, LedgerWalkDeviceReportSchema, LedgerWalkInputSchema, LedgerWalkRefusalSchema, LedgerWalkReportSchema, LedgerWalkSkipCountsSchema, LedgerWalkSkipReasonSchema, LegacyStorageLocationDefaultSchema, LinkedDeviceSchema, LinkedDevicesModeSchema, LinkedDevicesSlotValueSchema, LlmDefaultSchema, LlmDefaultSelectorSchema, LlmDownloadProgressSchema, LlmErrorCodeSchema, LlmGenerateBaseInputSchema, LlmGenerateErrSchema, LlmGenerateOkSchema, LlmGenerateResultSchema, LlmImageSchema, LlmNodeModelSchema, LlmProfileKindDescriptorSchema, LlmProfileKindSchema, LlmProfileSchema, LlmRefusalSourceSchema, LlmRetryPolicySchema, LlmRuntimeAppleCompleteInputSchema, LlmRuntimeCancelInputSchema, LlmRuntimeCompleteInputSchema, LlmRuntimeDiskUsageSchema, LlmRuntimeNodeSchema, LlmRuntimeStatusSchema, LlmTimeoutDefaults, LlmUsageRollupSchema, LlmUsageSchema, LoadContributionSchema, LocateSegmentResultSchema, LocationDescriptionAssignmentSchema, LocationIconAssignmentSchema, LocationIconIdSchema, LocationStatSchema, LockControlStatusSchema, LockStateSchema, LogChannelApplyResultSchema, LogChannelDescriptorSchema, LogChannelGate, LogChannelLevelSchema, LogChannelRegistry, LogChannelWindowPatchSchema, LogChannelWindowSchema, LogChannelWindowStateSchema, LogEntrySchema, LogLevelSchema, LogStreamEntrySchema, LoggingEffectiveSchema, LoggingExplicitSchema, LoggingLevelLayerSchema, LoggingLevelSourceSchema, LoggingScopeKindSchema, LoggingSettingsPatchSchema, LoggingSettingsStateSchema, LoginMethodContributionSchema, LoginStageEnum, LtsBucketSchema, MACRO_LABELS, MAX_ARCHIVED_DEBUG_NOTES, MAX_BIRTH_DECISION_RECORDS, MAX_BIRTH_LATENCY_PROXY_MS, MAX_CAMERA_SENSORS, MAX_CLIP_EVENT_IDS, MAX_CLIP_LABELS, MAX_COMPOSITION_CODE_LENGTH, MAX_COMPOSITION_FEATURES, MAX_COMPOSITION_FIELDS_PER_FEATURE, MAX_COMPOSITION_ITEMS, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_SOURCE_LENGTH, MAX_KEYS, MAX_REASONS_PER_KEY, MAX_SENSOR_TRIGGER_DEVICES, MAX_TRACK_DEBUG_NOTE_LEN, MEDIA_OWNER_TYPES, MEDIA_PRESENCE_OWNER_KINDS, METHOD_ACCESS_MAP, METHOD_DEVICE_SELECTORS, MINUTES_PER_DAY, MODEL_FORMATS, MODEL_HOSTING, MODEL_PROVIDER_IDS, MOTION_CLOSE_AFTER_MS, MOTION_SOURCE_LABELS, MOTION_TRIGGER_FEATURE, ManagedModelCatalogEntrySchema, ManagedModelExtraFileSchema, ManagedModelRefSchema, ManagedRuntimeConfigSchema, MaskGridDimsSchema, MaskGridShapeSchema, MaskLineShapeSchema, MaskPointSchema, MaskPolygonShapeSchema, MaskPolygonVerticesSchema, MaskRectShapeSchema, MaskShapeKindSchema, MaskShapeSchema, MediaFileInfoSchema, MediaFileKindEnum, MediaFileRefSchema, MediaFileSchema, MediaPlayerRepeatSchema, MediaPlayerStateSchema, MediaPlayerStatusSchema, MediaPresenceOwnerKindSchema, MediaRelocateModeSchema, MeshPeerSchema, MeshStatusSchema, MethodAccessSchema, MigrateDeviceResultSchema, MigrateSwitchOutcomeSchema, MigrateSwitchReportSchema, ModelCatalogEntrySchema, ModelConvertInputSchema, ModelConvertMetadataSchema, ModelDistributeInputSchema, ModelDistributeResultSchema, ModelExtraFileSchema, ModelFormatEntrySchema, ModelFormatsSchema, ModelLicenseSchema, ModelProviderIdSchema, ModelSubstitutionSchema, ModelVariantGroupSchema, MotionAnalysisResultSchema, MotionEventSchema, MotionOnMotionChangedDataSchema, MotionRegionSchema, MotionSourceEnum, MotionSourcesSchema, MotionStatusSchema, MotionTriggerRuntimeStateSchema, MotionTriggerStatusSchema, MotionTriggeredBySchema, MotionZoneOptionsSchema, MotionZonePatchSchema, MotionZoneRegionSchema, MotionZoneStatusSchema, StatusSchema as MqttBrokerStatusSchema, MutationFilterSchema, NATIVE_LEASE_ACTIVITY_FIELD, NATIVE_LEASE_ACTIVITY_KEY, NATIVE_LEASE_ADMISSION_FIELD, NATIVE_LEASE_ADMISSION_KEY, NATIVE_LEASE_BUDGET_FIELD, NATIVE_LEASE_BUDGET_KEY, NATIVE_LEASE_HOLD_FIELD, NATIVE_LEASE_HOLD_KEY, NATIVE_LEASE_SCENE_BUDGET_FIELD, NATIVE_LEASE_SCENE_BUDGET_KEY, NATIVE_LEASE_SECTION_ID, NATIVE_LEASE_TILE_BUDGET_FIELD, NATIVE_LEASE_TILE_BUDGET_KEY, NAVIGATION_ACTION_CATALOG, NAVIGATION_LIGHT_LEVEL_MAX, NAVIGATION_LIGHT_LEVEL_MIN, NC_ALARM_OPENING_EVENT_KINDS, NC_ALARM_SYSTEM_EVENT_KINDS, NC_AUDIO_CONFIRM_HITS_DEFAULT, NC_AUDIO_CONFIRM_HITS_MAX, NC_AUDIO_CONFIRM_HITS_MIN, NC_AUDIO_CONFIRM_WINDOW_MAX_SEC, NC_AUDIO_CONFIRM_WINDOW_MIN_SEC, NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT, NC_AUDIO_DBFS_FLOOR, NC_AUDIO_DB_MAX, NC_AUDIO_DB_MIN, NC_AUDIO_DB_OFFERED, NC_AUDIO_DB_STEP, NC_AUDIO_DEFAULTS, NC_AUDIO_HIT_PERCENT_MAX, NC_AUDIO_HIT_PERCENT_MIN, NC_AUDIO_SAMPLING_MAX_SEC, NC_AUDIO_SAMPLING_MIN_SEC, NC_AUDIO_SEED, NC_AUTHORABLE_SYSTEM_EVENT_KINDS, NC_BASE_CONDITION_KEYS, NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_CLIP_POST_ROLL_DEFAULT_SEC, NC_CLIP_PRE_ROLL_DEFAULT_SEC, NC_CLIP_RETENTION_MAX_SEC, NC_CONDITION_CATALOG, NC_CONFIRM_DEFAULT_MAX_IMAGE_PX, NC_CONFIRM_DEFAULT_TIMEOUT_MS, NC_CONFIRM_MAX_TIMEOUT_MS, NC_CONFIRM_MIN_TIMEOUT_MS, NC_CONSUMABLE_LOW_PERCENT_DEFAULT, NC_CONSUMABLE_LOW_PERCENT_MAX, NC_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_DEFAULT_SNOOZE_MINUTES, NC_HISTORY_LIMIT_DEFAULT, NC_HISTORY_LIMIT_MAX, NC_MAX_PER_TRACK_IMMEDIATE, NC_OCCUPANCY_DEFAULTS, NC_RULE_CLEARABLE_KEYS, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_RULE_SECTIONS, NC_SENSOR_RAISED_FIELD_BY_KIND, NC_SENSOR_TRANSITION_KINDS, NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, NC_SERVER_PACKAGE_NAME, NC_SNOOZE_MAX_MINUTES, NC_SYSTEM_DELIVERY, NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS, NC_SYSTEM_EVENT_FAMILIES, NC_SYSTEM_EVENT_FAMILY, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_FILTER_KEYS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, NC_SYSTEM_EVENT_SUMMARY_FAMILIES, NC_SYSTEM_RULE_KINDS, NC_TANK_SYSTEM_EVENT_KINDS, NC_TAXONOMY, NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, NC_UPDATE_EVENT_PACKAGE_NAMES, NETWORK_LINK_TYPES, NETWORK_LINK_UNKNOWN, NativeCropBboxSchema, NativeCropRefSchema, NativeCropResultSchema, NativeDetectionSchema, NativeLeaseAdmissionSchema, NativeLeaseSettingsSchema, NativeObjectClassEnum, NativeObjectDetectionOptionsSchema, NativeObjectDetectionRuntimeStateSchema, NativeObjectDetectionSettingsPatchSchema, NativeObjectDetectionStatusSchema, NativeObjectGeometryEnum, NavigationActionEntrySchema, NavigationActionIdSchema, NavigationEntryKindSchema, NavigationFeaturesSchema, NavigationLightModeSchema, NavigationModeSchema, NavigationMoveCommandSchema, NavigationPointSchema, NavigationRuntimeStateSchema, NavigationStatusSchema, NcAlarmConfigSchema, NcAlarmModeCoverageSchema, NcAlarmSettingsPatchSchema, NcAlarmSettingsSchema, NcAlarmSkipReasonSchema, NcAlarmSkippedDeviceSchema, NcAudioConditionSchema, NcClipRetentionAskSchema, NcClipRetentionPlanSchema, NcConditionDescriptorSchema, NcConditionsSchema, NcConfirmExpectSchema, NcConfirmSchema, NcCrossingSchema, NcDeliverySchema, NcDeviceStateConditionSchema, NcHistoryEntrySchema, NcHistoryFilterSchema, NcHistoryRecordKindSchema, NcHistoryStatusSchema, NcHistorySubjectSchema, NcLinkedCameraModeSchema, NcMediaFrameSchema, NcMediaPolicySchema, NcOccupancyConditionSchema, NcPlateMatcherSchema, NcRuleActionSchema, NcRuleActionSequenceSchema, NcRuleActionsSchema, NcRuleClearableKeySchema, NcRuleInputSchema, NcRuleKindSchema, NcRuleLastRunSchema, NcRuleLastRunsSchema, NcRuleNotificationButtonSchema, NcRulePatchSchema, NcRuleSchema, NcRuleTargetSchema, NcRuleUpdateInputSchema, NcSceneConditionSchema, NcScheduleSchema, NcScheduleWindowSchema, NcSensorTransitionSchema, NcSnoozeInputSchema, NcSnoozeSchema, NcSnoozeScopeSchema, NcSnoozeSuppressedSchema, NcStateSummaryPreviewSchema, NcStateSummaryPreviewSectionSchema, NcSystemEventConditionSchema, NcSystemEventDeliveryModeSchema, NcSystemEventDeliverySchema, NcSystemEventKindSchema, NcTaxonomyEntrySchema, NcTaxonomySchema, NcTemplateFamilySchema, NcTemplateFieldSchema, NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, NcTemplateVarContextSchema, NcTemplateVarDescriptorSchema, NcTemplateVarGroupSchema, NcTemplateVarKindSchema, NcTestResultSchema, NcThrottleGranularitySchema, NcThrottleSchema, NcZoneConditionSchema, NetworkAccessStatusSchema, NetworkAddressSchema, NetworkEndpointSchema, NetworkLinkStatusSchema, NodeDirectoryEntrySchema, NodeDirectorySchema, NotificationActionIconSchema, NotificationActionSchema, NotificationFormatSchema, NotificationSchema, NotifierStatusSchema, NumericSensorStatusSchema, OPERATOR_WRITTEN_STALE_MS, OPS_LOG_DEFAULT_LIMIT, OPS_LOG_RING_DEFAULT_MAX, OVERFLOW_REASON, OVERLAY_LAYERS, OWNER_ONLY_EVENT_CATEGORIES, OauthIntegrationDescriptorSchema, ObjectEventSchema, OccupancyBurstRefusalSchema, OnboardFieldSupportSchema, OnboardRecordTrackSchema, OnboardScheduleSupportSchema, OnboardStorageSchema, OnboardStorageVolumeSchema, OpsLogDomainSchema, OpsLogEntrySchema, OpsLogOpSchema, OpsLogQueryInputSchema, OpsLogReasonSchema, OrchestratorMetricsSchema, OsdOverlayKindEnum, OsdOverlayPatchSchema, OsdOverlaySchema, OsdPositionEnum, OsdRenderOutcomeEnum, OsdRenderResultSchema, OsdSlotBindingSchema, OsdSlotViewSchema, OsdSourceOptionSchema, OsdSourceSchema, OsdSourceValueTypeEnum, OsdStatusSchema, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PENDING_BLOCK_ID, PET_FEEDER_MANUAL_FEED_MAX, PET_FEEDER_MANUAL_FEED_MIN, PIPELINE_ANALYTICS_CAP_NAME, PIPELINE_FLOW_CAPABILITY_NAMES, PIPELINE_OWNER_CAPABILITY_NAMES, PRIVACY_MASK_CAP_NAME, PROVIDER_KIND_CAP_NAMES, PROVIDER_PIN_FIELD, PYTHON_SCRIPT, PackageUpdateSchema, PackageVersionInfoSchema, ParkRefusalSchema, ParkTrackFrameResultSchema, ParkedFrameKindSchema, ParkedTrackFrameSchema, PasskeyLoginMethodSchema, PasskeySummarySchema, PcmSampleFormatSchema, PeerBytesTicketSchema, PerScopeBreakdownSchema, PetFeederStatusSchema, PickStreamPreferencesSchema, PickStreamRequirementsSchema, PickedCamStreamSchema, PipelineAssignmentSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, PlaceholderReasonSchema, PolygonPointSchema, PoolMemoryWatchdog, PowerMeterStatusSchema, PresenceStatusSchema, PressureSensorStatusSchema, PrivacyMaskOptionsSchema, PrivacyMaskPatchSchema, PrivacyMaskRegionSchema, PrivacyMaskShapeSchema, PrivacyMaskStatusSchema, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, ProviderStatusSchema, PtzAutotrackRuntimeStateSchema, PtzAutotrackSettingsSchema, PtzAutotrackStatusSchema, PtzAutotrackTargetOptionSchema, PtzHomePresetSchema, PtzHomeReturnSchema, PtzMoveCommandSchema, PtzOptionsSchema, PtzPositionSchema, PtzPresetFunctionSchema, PtzPresetSchema, PtzStatusSchema, QueryFilterSchema, RATE_CONTROL_RELAXED, RATE_CONTROL_TIGHT, REACHABILITY_FAILURES_TO_OFFLINE, REACHABILITY_POLL_INTERVAL_MS, REACHABILITY_PROBE_TIMEOUT_MS, RECOGNITION_TYPES, RECORDING_AUDIO_TRIGGER_OFFERED_DBFS, RECORDING_EXPORT_MAX_READ_BYTES, RECORDING_SOURCE_CAMSTACK, RECORDING_SOURCE_CAMSTACK_ADDON, RECORDING_TIMELINE_BATCH_MAX, REDACTED_SECRET, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_SOURCES, RESTORED_CAP_NAMES, ROOM_EXAMPLE_MOTION_SOURCES, ROOM_EXAMPLE_TEMPERATURE_SOURCES, ROOM_OCCUPANCY_WINDOW_MS, ROOT_BUCKET_KEY, RUNTIME_DEFAULTS, RUNTIME_STATE_POLICY, RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS, RUNTIME_TO_FORMAT, RawStateResultSchema, ReadGopBytesResultSchema, ReadSegmentBytesResultSchema, ReadWindowBytesResultSchema, ReadinessRegistry, ReadinessTimeoutError, RebuildObjectEmbeddingsRefusalSchema, RecentTracksPageSchema, RecentTracksQueryInput, RecordTriggerSchema, RecordWindowSchema, RecordingAvailabilityForDeviceSchema, RecordingAvailabilitySchema, RecordingBandAudioSchema, RecordingBandModeSchema, RecordingBandSchema, RecordingBandTriggersSchema, RecordingConfigSchema, RecordingDaysForDeviceSchema, RecordingDaysSchema, RecordingDeviceUsageSchema, RecordingLocationUsageSchema, RecordingManifestSchema, RecordingObjectTriggerClassSchema, RecordingOnboardOptionsSchema, RecordingOnboardPatchSchema, RecordingOnboardStatusSchema, RecordingPlaybackSchema, RecordingRangeSchema, RecordingReadSchema, RecordingRebalanceInputSchema, RecordingRebalanceMoveSchema, RecordingRebalancePlanSchema, RecordingRebalanceSkipReasonSchema, RecordingRebalanceSkipSchema, RecordingRetentionSchema, RecordingSignalRuntimeStateSchema, RecordingSignalStatusSchema, RecordingSourceAvailabilitySchema, RecordingSourceOptionsSchema, RecordingSourceSchema, RecordingStatusSchema, RecordingStorageModeSchema, RecordingStorageUsageSchema, RecordingTriggersSchema, RecordingWeekdaySchema, RedirectLoginMethodSchema, RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, RelocateFootageClassSchema, RelocateFootageInputSchema, RelocateJobSchema, RelocateJobStateSchema, RelocateMediaInputSchema, RelocateResidueInputSchema, RelocateResidueSchema, RenderedAsSchema, ReportMotionInputSchema, ReportedFailureContributionSchema, ReportedLoadContributionSchema, RequestCensusGroupSchema, RequestCensusProcedureSchema, RequestCensusSnapshotSchema, RequestCensusStatusSchema, RetrainAnnotationDraftSchema, RetrainAnnotationKindSchema, RetrainAnnotationSchema, RetrainAnnotationSourceSchema, RetrainAssistResultSchema, RetrainAssistSubjectSchema, RetrainCopyRefusalSchema, RetrainFrameCandidateSchema, RetrainFrameListSchema, RetrainFrameSchema, RetrainFrameSelectionSchema, RetrainMacroClassSchema, RetrainStatusSchema, RetrainTrackSchema, RetrainTransitionResultSchema, RingBuffer, RtpSourceSchema, RtspRestreamEntrySchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerInferenceDeviceSchema, RunnerJumpStepProvisioningSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, SCENE_CONDITIONS, SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS, SCENE_DEFAULT_ANCHOR_THRESHOLD, SCENE_DEFAULT_CHECK_INTERVAL_SEC, SCENE_DEFAULT_OBSERVATION_SPACING_SEC, SCENE_DEFAULT_QUIET_SECONDS, SCENE_DEFAULT_UNCOVERED_POLICY, SCENE_DIVERGED, SCENE_RESET_RECAPTURES, SCOPE_PRESETS, SENSOR_FEATURES, SENSOR_MAP, SHARE_VIEW_KINDS, SOURCE_CAPS, SOURCE_CAP_ACTIVE_FIELD, SOURCE_CAP_CHANGED_AT_FIELD, SOURCE_DEVICE_TYPES, SOURCE_INFO_METADATA_KEY, STATIONARY_OVERLAY_STYLE, STORAGE_ACCESS_FALLBACK, STORAGE_BYTES_PER_GB, STORAGE_LOCATION_MODES, STREAM_PROFILE_META, STREAM_QUALITY_LABELS, SUB_DETECTION_TYPES, SYSTEM_CAP_NAMES, SYSTEM_SCOPE_DEVICE_METHODS, SceneCheckSchema, SceneConditionSchema, SceneConfirmSchema, SceneMonitorSchema, SceneMonitorStateSchema, SceneMonitorStatusForDeviceSchema, SceneMonitorStatusSchema, SceneReferenceSchema, SceneUnavailableSchema, SceneUncoveredPolicySchema, SceneVerdictSchema, ScopedTokenSchema, ScopedTokenSummarySchema, ScoredObjectEventSchema, ScriptRunnerStatusSchema, SearchResultSchema, SendEmailInputSchema, SendEmailResultSchema, SendResultSchema, SensorEventSchema, ServerBootModeSchema, ServerPackageStatusSchema, ServerRollbackInfoSchema, ServerUpdateActionResultSchema, ServerUpdateCheckResultSchema, ServerUpdateOutcomeSchema, ServerUpdateStateSchema, SetLoggingSettingsInputSchema, SetSiteLocationInputSchema, SettingsPatchSchema, SettingsRecordSchema, SettingsSchemaWithValuesSchema, SettingsUpdateResultSchema, ShmRingStatsSchema, SiteLocationSchema, SiteLocationSourceSchema, SiteLocationStatusSchema, SiteZoneSchema, SmokeStatusSchema, SmtpStatusSchema, SnapshotImageSchema, SourceInfoSchema, SpatialDetectionSchema, SsoBridgeClaimsSchema, StartEmbeddedInputSchema, StationaryObjectSchema, AbortUploadInputSchema as StorageAbortUploadInputSchema, StorageAccessSchema, BeginDownloadInputSchema as StorageBeginDownloadInputSchema, BeginDownloadResultSchema as StorageBeginDownloadResultSchema, BeginUploadInputSchema as StorageBeginUploadInputSchema, BeginUploadResultSchema as StorageBeginUploadResultSchema, StorageCleanupInputSchema, StorageCleanupJobSchema, StorageCleanupPhaseSchema, StorageCleanupStatusInputSchema, StorageDrainProgressSchema, EndDownloadInputSchema as StorageEndDownloadInputSchema, StorageEvictionPolicySchema, FinalizeUploadInputSchema as StorageFinalizeUploadInputSchema, StorageLocationDeclarationSchema, StorageLocationModeSchema, StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, StorageMigrationClassSchema, StorageMigrationDestinationsSchema, StorageMigrationDrainInputSchema, StorageMigrationFindingCodeSchema, StorageMigrationFindingSchema, StorageMigrationFootageMoveInputSchema, StorageMigrationInputSchema, StorageMigrationJobSchema, StorageMigrationLaneSchema, StorageMigrationLeaseInputSchema, StorageMigrationMediaMoveInputSchema, StorageMigrationModeSchema, StorageMigrationMoveProgressSchema, StorageMigrationMoveSchema, StorageMigrationMoverSchema, StorageMigrationParticipantSchema, StorageMigrationPhaseSchema, StorageMigrationPlanSchema, StorageMigrationResidueSchema, StorageMigrationSourcesSchema, StorageOccupancyReportSchema, ProviderInfoSchema as StorageProviderInfoSchema, ReadChunkInputSchema as StorageReadChunkInputSchema, TestLocationResultSchema as StorageTestLocationResultSchema, WriteChunkInputSchema as StorageWriteChunkInputSchema, StreamCodecSchema, StreamFormatSchema, StreamNetworkStatsSchema, StreamParamsOptionsSchema, StreamParamsStatusSchema, StreamProfileConfigSchema, StreamProfileOptionsSchema, StreamProfilePatchSchema, StreamProfileSchema, StreamSignalSchema, StreamSignalsStatusSchema, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, SubscribeFramesInputSchema, SubscribeFramesResultSchema, SwitchStatusSchema, SystemMetricsSchema, SystemMirror, TAXONOMY_COLORS, TIMELAPSE_DENSE_FLOOR_SEC, TIMEZONES, TRANSCODE_DOWN_MAX_BITRATE_KBPS, TRANSCODE_DOWN_MAX_HEIGHT, TamperStatusSchema, TankStatusSchema, TargetKindCapsSchema, TargetKindLevelSchema, TargetKindSchema, TargetSchema, TemperatureSensorStatusSchema, TerminalInstanceInfoSchema, TerminalLegacyCameraSchema, TerminalOutputBatchSchema, TerminalOutputEventSchema, TerminalProfileInfoSchema, TerminalSessionInfoSchema, TestConnectionResultSchema$1 as TestConnectionResultSchema, TestConnectionStatusEnum, TestResultSchema, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, ToastSchema, TokenScopeSchema, TopologyNodeSchema, TopologyProcessSchema, TopologyServiceSchema, TrackCascadeCountsSchema, TrackEnvelopeSchema, TrackFlagsPatchSchema, TrackFlagsSchema, TrackProjectionSchema, TrackSchema, TrackSourceSchema, TrackStateSchema, TrackZoneFilterSchema, TrackedDetectionSchema, TrainingExportDeviceTotalsSchema, TrainingExportSummarySchema, TransportPlaneCountsSchema, TransportPlaneSchema, TurnServerSchema, UNATTRIBUTED_BUCKET_KEY, UNIT_TABLE, BrokerInfoSchema$1 as UnifiedBrokerInfoSchema, UnitConversionError, UnstampedEventMediaCountSchema, UnstampedRowsSchema, UpdateIntegrationInputSchema, UpdateStatusSchema, UpdateUserInputSchema, UserRecordSchema, UserSummarySchema, VECTOR_INDEX_DIM_CONFLICT, VIDEOCLIPS_MAX_OFFER_BYTES, VIDEOCLIPS_MAX_READ_BYTES, VISIT_MERGE_GAP_MS, VacuumControlStatusSchema, VacuumStateSchema, ValveStateSchema, ValveStatusSchema, VectorDeclareIndexInputSchema, VectorDeleteByFilterInputSchema, VectorDeleteInputSchema, VectorDeleteResultSchema, VectorFilterSchema, VectorGetInputSchema, VectorGetResultSchema, VectorItemSchema, VectorMatchSchema, VectorMetadataSchema, VectorMetricSchema, VectorQueryInputSchema, VectorQueryResultSchema, VectorStatsInputSchema, VectorStatsResultSchema, VectorUpsertInputSchema, VectorUpsertResultSchema, VibrationStatusSchema, VideoEncodeSchema, WEBRTC_CLIMB_HOLD_CODES, WEBRTC_EGRESS_PROFILE, WEBRTC_TRY_BLOCKERS, WEEKLY_MASK_LENGTH, WELL_KNOWN_TABS, WELL_KNOWN_TAB_MAP, WaterHeaterStatusSchema, WeatherStatusSchema, WebrtcClimbHoldSchema, WebrtcLadderDecisionSchema, WebrtcSessionDebugSchema, WebrtcStreamChoiceSchema, WebrtcStreamTargetSchema, WebrtcTierFailureSchema, WhiteBalanceModeSchema, WidgetHostEnum, WidgetLoginMethodSchema, WidgetMetadataSchema, WidgetRemoteSchema, WidgetSizeEnum, WrapperActivationReadSchema, WrapperEvidenceSchema, WrapperIdentitySchema, WrapperKindSchema, YAMNET_TO_MACRO, ZoneCrossingDirectionSchema, ZoneCrossingSchema, ZoneKindEnum, ZoneRuleModeEnum, ZoneRuleSchema, ZoneRuleStageEnum, ZoneRulesArraySchema, ZoneSchema, ZoneScopeBreakdownSchema, __resetLogChannelRegistryForTests, accessoriesCapability, accessoryStableId, addonPagesCapability, addonPagesSourceCapability, addonRoutesCapability, addonSettingsCapability, addonWidgetsCapability, addonWidgetsSourceCapability, addonsCapability, adminUiCapability, airQualitySensorCapability, alarmPanelCapability, alertsCapability, ambientLightSensorCapability, asBoolean, asJsonArray, asJsonObject, asNumber, asString, assertTimelapseCadences, audioAnalysisCapability, audioAnalyzerCapability, audioChunkBytesPerSample, audioCodecCapability, audioIsFailClosed, audioKindId, audioLabelChoices, audioMetricsCapability, audioModeOf, audioOrDefaults, audioPlanFromEncodeProfile, audioScaleEraOf, authProviderCapability, autoAssignProfiles, automationControlCapability, backupCapability, bareAddonId, batteryCapability, bestLocationMatch, binaryCapability, bindAddonActions, brightnessCapability, brokerCapability, buildAddonRouteProvider, buildAudioArgs, buildCapabilityLookup, buildDeviceAdminUrl, buildEventKindDescriptor, buildFfmpegArgs, buildInputArgs, buildModelVariantGroups, buildNcTaxonomy, buildRoleScopes, buildStreamParamsConfigSchema, buildVideoArgs, buttonCapability, cameraCredentialsCapability, cameraGridLayoutCapability, cameraPipelineConfigCapability, cameraSensorRefKey, cameraStreamsCapability, canConvertUnit, canonicalEgressPlan, carbonMonoxideCapability, cellsToRects, classifyBearerPrincipal, classifyStream, classifyStreams, climateControlCapability, clipExportFailure, clipExportFailureOf, clipReasonHeaderValue, cloneStatefulExpressionMemory, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, codecIsAccepted, collectHydratedFieldEntries, collectHydratedFieldValues, collectSecretConfigKeys, colorCapability, colorForKind, commitWatchdogRestart, compareToTarget, compileExpression, compileExpressionSafe, composeSwitchedOff, composedDeviceRef, composedDeviceStableId, composerCapability, compositionEdges, compositionFeatureEnabled, compositionFieldKey, compositionItemFieldPath, compositionReadKey, compositionSliceKey, compositionSourceKey, compositionSourceRefs, conditionDepth, conditionExclusionReason, conditionVisibleForKind, connectionTestCapability, connectivityCapability, consumableLowPercentOf, consumablesCapability, contactCapability, controlCapability, convertUnit, coreBlockAddonId, coreBlockComposition, coreBlockIdFromAddonId, coreBlockSourceKind, coreBlocksCapability, cosineSimilarity, countConditionLeaves, coverCapability, createDeviceExtensionProvider, createDeviceProxy, createDurableState, createEvent, createEventBusSliceSource, createExpressionScope, createHwAccelCache, createLazyTrpcSource, createLogChannelsProvider, createMirrorSource, createRuntimeStateBridge, createSliceHandle, createStatefulExpressionMemory, createSystemProxy, customAction, customModelRegistryCapability, dataStoreProviderCapability, dayNightCapability, dayOfWeekToIndex, declarationOwnerNodeId, declareLogChannel, decodeVectorBase64, decoderCapability, defaultDeliveryForSection, defaultDeviceFor, defineCustomActions, defineExtensionSlotProvider, deriveBatteryPresence, deriveCameraSwitches, deriveDetailCropRect, deriveRecordingMode, describeCustomActions, describeModelVariant, describeOnboardClamp, describeOnboardRefusal, describeStateField, describeSystemEventDeliveryProblem, describeSystemEventFamilyProblem, describeTopLevelStateFields, detectAccessRole, detectionPipelineCapability, deviceAdminLinkCapability, deviceAdoptionCapability, deviceBackendToFormat, deviceCustomAction, deviceDiscoveryCapability, deviceExportCapability, deviceExtensionCapability, deviceManagerCapability, deviceMatchesProfile, deviceOpsCapability, deviceProviderCapability, deviceSelectorMatches, deviceStateCapability, deviceStatusCapability, displayIconEntry, displayIconsInGroup, doorbellCapability, droppedConditionsForKind, egressTranscodeSharingKey, egressTransportFromRequest, embeddingEncoderCapability, embeddingModelFailedError, embeddingModelFailedOf, embeddingRefusalOf, embeddingRequirementsFailedError, embeddingRequirementsUnavailableError, emitDownForOwnedCaps, emitReadiness, emitsCollectionSelector, encodeProfileFromStreamShape, encodeVectorBase64, enumSensorCapability, enumerateInferenceDevices, enumerateItemArrayFields, enumerateSchemaFields, errMsg, evaluateAst, evaluateCompositionField, evaluateCount, evaluateExpressionSource, evaluatePoolMemory, evaluateRose, evaluateSensorEdge, evaluateSensorLevelEdge, evaluateStatefulExpressionCall, evaluateZoneRules, event, eventEmitterCapability, evictionPolicyForMode, evictionPolicyOfLocation, expandAudioChunkToF32le, expandCapMethods, expandContainer, exportSubjectOf, expressionContainsBuiltinCall, extensionSlotRef, extractNestedAddonId, extractSourceInfoFromMetadata, faceGalleryCapability, failureContributionCapability, failureRate, fanControlCapability, featureFieldEntries, featureProbeCapability, featureSources, feederCustomizationExample, feederExampleSources, ffmpegRate, fieldReads, filesystemBrowseCapability, findCandidateCycles, findCompositionCycles, findTimezone, floodCapability, foldSnapshotByFunction, formatForRuntime, formatMediaOwnerKey, formatMinutes, formatParkedFor, gasCapability, gbToBytes, generateAutomationBlock, getAudioMacroClassIds, getByPath, getCapsByProviderKind, getLogChannelRegistry, getTaxonomyEntry, gifDeriveSpeed, gifFilterComplex, gifFromMp4Args, hasMotionTrigger, hfModelUrl, htmlToText, humidifierCapability, humiditySensorCapability, hydrateSchema, imageCapability, imageSettingsCapability, inferExpressionKinds, inferModelProvider, initialPoolMemoryState, integrationsCapability, intercomCapability, interpretStoredClusterModel, invalidClusterStepModelEntries, invocationFromEncodeProfile, isAgentOnlyPlacement, isArrayOutputSchema, isAudioChunkFormat, isAudioLabelSelected, isAudioRule, isBaseConditionKey, isBatteryPresenceFault, isClusterScopedStep, isCollectionArrayMethod, isDeployableToAgent, isDetectionMacroClass, isDeviceConfigCap, isDeviceScopedCap, isDisplayIconKey, isEmbeddingModelFailed, isEvent, isEventOwnerType, isFirstLevelMacroClass, isHeldBackTemplateVar, isIsolatedBuiltin, isKnownTemplateVar, isLocationEnabled, isMediaOwnerType, isNode, isObjectInput, isOccupancyRule, isOwnerOnlyEventCategory, isRestoredCap, isSameAddonId, isScheduleActive, isSecretConfigField, isSoftwareDecode, isSourceCap, isStatefulBuiltin, isStorageLocationMode, isSystemDelivery, isSystemEventFamily, isSystemEventSummaryRule, isSystemRuleKind, isVectorIndexDimConflict, isVoidInput, ituDbfsFromPreEpoch, jobKindSchema, kebabToCamel, kindOfValue, kindsForDiscriminator, knownValues, lawnMowerControlCapability, legacyAutoLinkIds, legacyModeOf, lifecycleJobSchema, lifecycleJobScopeSchema, lifecycleJobStateSchema, lifecycleTaskSchema, llmCapability, llmRuntimeCapability, loadContributionCapability, localNetworkCapability, locationIconKey, locationSimilarity, lockControlCapability, logBannerArgs, logChannelsCapability, logDestinationCapability, logLevelAtMost, loginMethodCapability, looseSchema, makeProfileBrokerId, makeSourceBrokerId, mapAudioLabelToMacro, markdownToHtmlLite, markdownToText, maskUrlCredentials, mayReadLocation, mayWriteToLocation, mediaPlayerCapability, mergeSourceInfo, meshNetworkCapability, method, methodAccessForHttpMethod, metricsProviderCapability, migrateLegacyDeviceSignalConfig, minutesToTimeOfDay, modeMayRead, modeMayWrite, modelConvertCapability, modelDistributorCapability, modelFormatForRuntime, motionCapability, motionDetectionCapability, motionSourceLabel, motionTriggerCapability, motionZonesCapability, mqttBrokerCapability, nativeObjectDetectionCapability, navigationCapability, networkAccessCapability, networkLinkCapability, networkQualityCapability, nodePickerItems, nodePin, nodesCapability, normalizeAddonInitResult, normalizeAudioLabel, normalizeNodeId, normalizeTokenScopes, normalizeUnit, notificationOutputCapability, notificationRulesCapability, notifierCapability, numericSensorCapability, oauthIntegrationCapability, objectInputDeclaresAddonId, objectInputDeclaresRequiredDeviceId, occupancyScope, optionalAncestors, optionalMethod, osdCapability, osdManagerCapability, overlayClusterStepSettings, packagePickerItems, parseAdminBase, parseCameraStreamConfig, parseExpression, parseJsonArray, parseJsonObject, parseJsonUnknown, parseMediaOwnerKey, parseOccupancyScope, parseProcStatus, parseProfileBrokerId, parseRuleSection, parseStreamParamsFormPatch, patchAudio, petFeederCapability, pickAccessoryControl, pickClusterStepModels, pickClusterStepSettings, pickDetailCropConvention, pickInvalidClusterStepModels, pickNativeLeaseOverride, pickPreferredRtspEntry, pickRestartCandidate, pickVideoEncoder, pickerForCondition, pipelineAnalyticsCapability, pipelineExecutorCapability, pipelineOrchestratorCapability, pipelineRunnerCapability, planComposition, planCompositionEvents, planItems, plateGalleryCapability, platformProbeCapability, poolMemoryThreshold, powerMeterCapability, prepareNotification, presenceCapability, pressureSensorCapability, principalMayReachAddon, privacyMaskCapability, procedureAuthKey, ptzAutotrackCapability, ptzCapability, publicEventCategories, pythonScriptForBackend, rankStreams, readClusterStepModels, readClusterStepSettings, readDetailCropConvention, readDeviceStateFrom, readMotionTriggeredBy, readNativeLeaseOverride, readNodePin, readTimelapseGeneratedAt, readinessKey, rebootCapability, recordingArchiveCapability, recordingCapability, recordingExportCapability, recordingOnboardCapability, recordingSignalCapability, rectsToCells, reducePoints, replacedFieldKeys, requiredTopLevelKeys, requiresPython, reservedSourceOwner, resetPoolBaseline, resolveAddonExecution, resolveAddonGroup, resolveAddonPlacement, resolveBucketMs, resolveCapMount, resolveClipSearchMinScore, resolveClusterStepModelId, resolveContainerPrimaryChild, resolveCreateExportSubject, resolveDeviceControlKind, resolveDeviceProfile, resolveEgressDecodeHwAccel, resolveExportProfiles, resolveFormat, resolveHydratedFieldValue, resolveLocationIcon, resolveLocationMode, resolveMethodAuth, resolveMutate, resolvePoolMemoryPolicy, resolveRecordingProfiles, resolveRunnerId, resolveStreamMaps, resolveVariantModelId, resolveViewableDeviceIds, roleSpec, roomCompositionExample, ruleBelongsToAlarm, ruleEditorSectionsForKind, ruleKindOf, ruleKindSpec, ruleMatchesSection, ruleSection, ruleSectionOf, ruleSeedForSection, runInferenceStep, runtimeDevices, runtimeStatePolicyFor, sceneMonitorCapability, scheduleForSendTimes, schemaDeclaresAnyField, scopeInherits, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, scoreRuntimes, scriptRunnerCapability, searchDisplayIcons, selectAssignedProfileSlots, sendTimesOfSchedule, sensorRaisedOf, sensorTransitionNeverFires, sensorTransitionOffered, servedTemplateVars, serverManagementCapability, setByPath, settingsStoreCapability, signalPercentFromBars, signalPercentFromRssi, siteZoneKey, sleep, sleepCancellable, sliceActiveValue, sliceChangedAt, smokeCapability, smtpProviderCapability, snapshotCapability, ssoBridgeCapability, startReachabilityPoll, stateVocabularyFor, stepModelRunsOnFormat, storageCapability, storageEvictableCapability, storageMigrationCapability, storageOccupancyCapability, storageProviderCapability, streamBrokerCapability, streamCatalogCapability, streamParamsCapability, streamPixels, streamQualityLabel, streamSignalsCapability, stripRetiredBandPreBufferSec, strippedOfLegacyReadOnly, subKindsOf, summarisePrivacyAudio, summarizeEffectiveScope, supportedRuntimes, switchCapability, switchedOffIds, synthesizeSourceInfo, systemCapability, systemEventDeliveryProblems, systemEventFamilyOf, systemEventFamilyProblems, systemEventFilterApplies, systemEventFilterAppliesToAnyKind, systemEventKindNamesOf, systemEventKindsOfFamily, systemEventSummaryScheduleOf, systemFamilyOfKind, systemRuleKindOf, tamperCapability, taskLogEntrySchema, taskPhaseSchema, taskTargetSchema, temperatureSensorCapability, templateCarriesSummary, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, templateVarsFor, terminalSessionCapability, textToHtml, timeOfDayToMinutes, toDeviceSummary, toExpressionValue, toNodeId, toStreamSourceEntry, toastCapability, toggleAudioLabel, tokenize, transcodeBody, tryConvertUnit, turnProviderCapability, unitDimension, unitsForDimension, unreachableExtensionSlotRow, unwrapSchema, updateCapability, userManagementCapability, userPasskeysCapability, vacuumControlCapability, validateComposition, validateExpressionSource, validateRecipeBounds, valveCapability, vectorDimFromBase64, vectorIndexDimConflictError, vectorStoreCapability, vibrationCapability, videoclipsCapability, viewerUiCapability, waterHeaterCapability, weatherCapability, webrtcClientHintsSchema, webrtcSessionCapability, weeklyMaskIndex, weeklyMaskIsUniform, weeklyMaskToWindows, windowsToWeeklyMask, wiringAddonHealthSchema, wiringHealthSnapshotSchema, wiringNodeHealthSchema, wiringProbeKindSchema, wiringProbeResultSchema, withLocationMode, zodEntriesToConfigUI, zoneAnalyticsCapability, zoneRulesCapability, zonesCapability };
68547
+ export { ACCESSORY_LABEL, ACCESS_ROLES, ALEXA_EGRESS_PROFILE, ALL_CAPABILITY_DEFINITIONS, APPLE_SA_TO_MACRO, ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT, AUDIO_ANALYSIS_CAP_NAME, AUDIO_BACKEND_CHOICES, AUDIO_CHUNK_FORMATS, AUDIO_MACRO_LABELS, AUDIO_NOT_CLASSIFIED_REASONS, AUDIO_PRESETS, AUDIO_SCALE_EPOCH_ISO, AUDIO_SCALE_EPOCH_MS, AccessoriesStatusSchema, AccessoryKind, AddBrokerInputSchema, AddonAutoUpdateSchema, AddonListItemSchema, AddonPageDeclarationSchema, AddonPageInfoSchema, AdminLinkTargetEnum, AdoptInputSchema as AdoptionAdoptInputSchema, AdoptResultSchema as AdoptionAdoptResultSchema, AdoptionCandidateResultSchema, AdoptionFilterSchema, GetCandidateInputSchema as AdoptionGetCandidateInputSchema, AdoptionJobSchema, AdoptionJobStateSchema, ListCandidatesInputSchema as AdoptionListCandidatesInputSchema, ListCandidatesOutputSchema as AdoptionListCandidatesOutputSchema, AdoptionOutcomeSchema, ReleaseInputSchema as AdoptionReleaseInputSchema, AdoptionStatusSchema, AgentLoadSummarySchema, AirQualitySensorStatusSchema, AlarmArmModeSchema, AlarmPanelStatusSchema, AlarmStateSchema, AlertSchema, AlertSeveritySchema, AlertSourceSchema, AlertStatusSchema, AmbientLightSensorStatusSchema, AnalyticsLtsSeriesSchema, ApiKeyRecordSchema, ApiKeySummarySchema, AppleFmAvailabilitySchema, AppleFmUnavailableReasonSchema, ArchiveEntrySchema, ArchiveManifestSchema, ArchivedDebugNoteQueryInputSchema, ArchivedDebugNoteSchema, AttachmentMediaTypeSchema, AttachmentSchema, AudioAnalysisResultSchema, AudioAnalysisSettingsSchema, AudioAttachDeviceInputSchema, AudioAttachDeviceResultSchema, AudioChunkFormatSchema, AudioChunkInputSchema, AudioClassSummarySchema, AudioClassificationLabelSchema, AudioClassificationResultSchema, AudioClassifyOutcomeSchema, AudioCodecInfoSchema, AudioDecodeSessionConfigSchema, AudioDetachDeviceResultSchema, AudioEncodeSchema, AudioEncodeSessionConfigSchema, AudioEncodedChunkSchema, AudioEventSchema, AudioLevelSchema, AudioMetricsHistoryPointSchema, AudioMetricsHistorySchema, AudioMetricsSnapshotSchema, AudioPcmChunkSchema, AudioStreamPickSchema, AuthResultSchema, AutoUpdateSettingsSchema, AutomationActionSchema, AutomationConditionOperatorSchema, AutomationConditionSchema, AutomationControlStatusSchema, AutomationRecipeSchema, AutomationTriggerSchema, AvailableIntegrationTypeSchema, BASE_DEVICE_CAPS, BASE_LIVE_EGRESS_PROFILE, BATTERY_DEVICE_PROFILE, BATTERY_UNREACHABLE_AFTER_MS, BIRTH_DECISION_DEFAULT_LIMIT, BOOT_RECOVERY_BACKOFF_MS, BUILTIN_RESULT_KINDS, BackgroundRunRegistry, BacklightModeSchema, BackupDestinationInfoSchema, BackupEntrySchema, BackupRunPhaseSchema, BackupRunSchema, BackupRunStateSchema, BackupTriggerResultSchema, BaseAddon, BaseDevice, BaseDeviceProvider, BatteryStatusSchema, BinaryStatusSchema, BirthDecisionQueryInputSchema, BirthDecisionRecordSchema, BirthDecisionVerdictSchema, BoundingBoxSchema, BrightnessStatusSchema, AddInputSchema as BrokerAddInputSchema, BrokerAudioClientSchema, BrokerClientsSchema, BrokerConnectionDetailsSchema, BrokerConsumerAttributionSchema, BrokerConsumerKindSchema, BrokerDecodedClientSchema, BrokerEncodedClientSchema, GetStateInputSchema as BrokerGetStateInputSchema, BrokerInfoSchema, BrokerProviderInfoSchema, PublishInputSchema as BrokerPublishInputSchema, RegistryStatusSchema as BrokerRegistryStatusSchema, BrokerRtspClientSchema, BrokerStatsSchema, BrokerStatusEnum, BrokerStatusSchema, SubscribeInputSchema as BrokerSubscribeInputSchema, SubscribeResultSchema as BrokerSubscribeResultSchema, TestConnectionResultSchema as BrokerTestConnectionResultSchema, UnsubscribeInputSchema as BrokerUnsubscribeInputSchema, BulkRecordSchema, CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_SWITCH_CATALOG, CAMERA_SWITCH_ORDER, CAMERA_TRIGGER, CAM_PROFILE_ORDER, CAPABILITY_NAMES, CAPABILITY_ROUTER_KEYS, CAP_NAMES_WITH_STATUS, CAP_NODE_PIN_CONTEXT_KEY, CAP_PROVIDER_KIND_MAP, CLASS_MAP_MACRO_TARGETS, CLIP_BROKER_PACED_RATES, CLIP_PLAYBACK_OPTIONS, CLIP_REALTIME_SOURCE_RATES, CLIP_REASON_HEADER_MAX, CLIP_SEARCH_STRICTNESS, CLIP_STILL_DISPOSITION_HEADER, CLIP_STILL_REASON_CODE_HEADER, CLIP_STILL_REASON_HEADER, CLIP_STREAM_SOURCE_RATES, CLIP_STREAM_TRANSPORT_HEADER, CLIP_STRICTNESS_FACTOR, CLIP_VECTOR_INDEX_PATTERN, CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS, CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, COCO_80_LABELS, COCO_TO_MACRO, COMPOSED_DEVICE_STABLE_ID_PREFIX, COMPOSED_ITEM_FIXED_FIELDS, COMPOSER_ADDON_ID, COMPOSER_RUNNER_ID, COMPOSITION_EVENT_CATEGORY, COMPOSITION_ITEM_ARRAY_PATH, COMPOSITION_ITEM_KEY_RE, CONNECTION_TEST_TIMEOUT_MS, CONTAINER_CHILD_PRIORITY, CORE_BLOCKS_ADDON_ID, CORE_BLOCK_ADDON_PREFIX, CUSTOMIZATION_BLOCK_NAME_PREFIX, CamProfileSchema, CamStreamDescriptorSchema, CamStreamKindSchema, CamStreamResolutionSchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraCredentialsSchema, CameraCredentialsStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, CameraMotionStatusSchema, CameraOccupancySnapshotForDeviceSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSensorAttachmentSchema, CameraSensorRefSchema, CameraSensorsConfigSchema, CameraSensorsModeSchema, CameraSensorsNotForwardedSchema, CameraSensorsStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusDegradationReasonSchema, CameraStatusDegradationSchema, CameraStatusSchema, CameraStatusStageSchema, CameraStreamSchema, CameraSwitchAuthoritySchema, CameraSwitchGroupSchema, CameraSwitchIdSchema, CameraSwitchSchema, CameraSwitchUnavailableReasonSchema, CameraSwitchWarningSchema, CandidateQueryFilterSchema, CapScopeSchema, CapabilityBindingsSchema, CarbonMonoxideStatusSchema, ChargingStatus, ClaimOutcomeSchema, ClaimsListingSchema, ClientNetworkStatsSchema, ClimateControlStatusSchema, ClipBytesOfferSchema, ClipBytesSchema, ClipExportFailureSchema, ClipModelMetaSchema, ClipPlaybackOptionsSchema, ClipPlaybackSchema, ClipSchema, ClipSearchStrictnessSchema, ClipSourceAvailabilitySchema, ClipSourceSchema, ClipStillDispositionSchema, ClipStillRefusalCodeSchema, ClipStreamAudioReasonSchema, ClipStreamAudioSchema, ClipStreamDialSchema, ClipWakeSchema, ClusterAddonNodeDeploymentSchema, ClusterAddonStatusEntrySchema, ClusterModelChoiceSchema, CollectionColumnSchema, CollectionIndexSchema, ColorStatusSchema, ComposableCapabilitiesSchema, ComposableCapabilitySchema, ComposableFieldSchema, ComposerApplyInputSchema, ComposerApplyResultSchema, ComposerBlockSchema, ComposerBlockVerdictSchema, ComposerUnreadableBlockSchema, CompositionBindingSchema, CompositionBlockInputSchema, CompositionBlockStateSchema, CompositionCodeSourceSchema, CompositionCommandTargetSchema, CompositionCustomizationReadSchema, CompositionEventPlanSchema, CompositionExistingTargetSchema, CompositionExpressionSourceSchema, CompositionFeatureModeSchema, CompositionFeaturePlanSchema, CompositionFeatureSchema, CompositionFieldItemSchema, CompositionFieldKindSchema, CompositionFieldPlanSchema, CompositionFieldReadSchema, CompositionFieldRoleSchema, CompositionFieldSourceSchema, CompositionFieldStateKindSchema, CompositionFieldStateSchema, CompositionFieldsFeatureSchema, CompositionForwardCommandSchema, CompositionFromSourceSchema, CompositionGetReadSchema, CompositionGraphError, CompositionItemEntrySchema, CompositionListReadSchema, CompositionLiteralBindingSchema, CompositionNewTargetSchema, CompositionPassthroughFeatureSchema, CompositionProblemCodeSchema, CompositionProblemSchema, CompositionRunStatusSchema, CompositionSchema, CompositionSourceRefSchema, CompositionStateReadSchema, CompositionTargetSchema, CompositionUnavailableModeSchema, CompositionValidationSchema, CompositionViewSchema, ConfigEntrySchema, ConfigSectionWithValuesSchema, ConfigTabDeclarationSchema, ConnectionTestDescriptorSchema, ConnectionTestInputSchema, ConnectionTestOutcomeSchema, ConnectivityStatusSchema, ConsumableItemSchema, ConsumableRemainingSchema, ConsumableRemainingUnitSchema, ConsumablesStatusSchema, ContactStatusSchema, ControlKindSchema, ControlStatusSchema, ConvertArtifactSchema, ConvertResultSchema, ConvertTargetSchema, CoreBlockCompileResultSchema, CoreBlockInputSchema, CoreBlockPlacementSchema, CoreBlockSchema, CoreBlockSourceSchema, CoreBlockStatusSchema, CoverStateSchema, CoverStatusSchema, CreateApiKeyInputSchema, CreateApiKeyResultSchema, CreateIntegrationInputSchema, CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, CreateUserInputSchema, CustomActionInputSchema, CustomModelDescriptorSchema, DATAPLANE_SECRET_HEADER, DAYS_PER_WEEK, DAY_NAMES, DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DEFAULT_ADDON_PLACEMENT, DEFAULT_AUDIO_ANALYZER_CONFIG, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_DECODER_HWACCEL_CONFIG, DEFAULT_DETAIL_CROP_CONVENTION, DEFAULT_EVENTS_BAND_BUFFER_SEC, DEFAULT_EVENT_COLOR, DEFAULT_FEATURES, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, DEFAULT_NATIVE_LEASE_SETTINGS, DEFAULT_OVERLAY_LAYERS, DEFAULT_POOL_MEMORY_POLICY, DEFAULT_RECORDING_PROFILES, DEFAULT_RETENTION, DEFAULT_RUNTIME_STATE_DURABILITY, DEFAULT_TIMELAPSE_PREVIEW_TEXT, DEFAULT_TOKEN_EXPIRY, DERIVED_CAMERA_SILENCED_CAP_NAMES, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, DETECTION_MACRO_CLASSES, DETECTION_PIPELINE_CAP_NAME, DEVICE_BACKEND_TO_FORMAT, DEVICE_CAP_NAMES, DEVICE_CHILDREN_BATCH_MAX, DEVICE_PROFILES, DEVICE_RESTORE_RETRY_CONCURRENCY, DEVICE_RESTORE_RETRY_DELAYS_MS, DEVICE_SCOPED_CAPS, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATE_READERS, DEVICE_STATUS_METHOD, DEVICE_TYPE_CONTROL_KIND, DEVICE_TYPE_INFO, DISPLAY_ICON_GROUPS, DISPLAY_ICON_KEYS, DISPLAY_ICON_OFFERED_KEYS, DISPLAY_ICON_VOCABULARY, DOORBELL_RISE_DEBOUNCE_MS, DOORBELL_SOURCE_SLOT, EngineInfoSchema as DataStoreEngineInfoSchema, DayNightModeSchema, DayNightOptionsSchema, DayNightSettingsPatchSchema, DayNightStatusSchema, DeclaredDevices, DecodedAudioChunkSchema, DecodedFrameSchema, DecoderSessionConfigSchema, DecoderStatsSchema, DeleteIntegrationResultSchema, DetailCropConventionSchema, DetectionCatalogClassMapSchema, DetectionSourceSchema, DetectionSourcesSchema, DeviceAdminLinkSchema, DeviceCodeSeveritySchema, DeviceConfig, DeviceDiscoveryStatusSchema, ExposeInputSchema as DeviceExportExposeInputSchema, DeviceExportStatusSchema, UnexposeInputSchema as DeviceExportUnexposeInputSchema, DeviceFeature, DeviceInfoSchema, DeviceNetworkStatsSchema, DeviceRestoreRetryScheduler, DeviceRole, DeviceRuntimeState, DeviceSelectorSchema, DeviceStatusSchema, DeviceType, DiagnosticIdSchema, DiagnosticWindowPatchSchema, DiagnosticWindowSchema, DiscoveredChildDeviceSchema, DiscoveredChildStatusSchema, DiscoveredDeviceSchema, DiscoveredTargetSchema, DiskReconcileJobSchema, DisposerChain, DoorbellPressEventSchema, DoorbellSourceSlotValueSchema, DoorbellStatusSchema, EMBEDDING_MODEL_FAILED, EMBEDDING_REQUIREMENTS_FAILED, EMBEDDING_REQUIREMENTS_UNAVAILABLE, EVENTFUL_CAP_NAMES, EVENT_DENSITY_BATCH_MAX, EVENT_KIND_BY_CAP, EVENT_OWNER_TYPES, EVENT_PAD_MS, EVENT_TAXONOMY, EXPORT_DENSE_MAX_RANGES, EXPRESSION_BUILTINS, EXPRESSION_BUILTIN_NAMES, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, EXTENSION_HOST_DEVICE_TYPES, EXTENSION_SLOTS, EXTENSION_SLOT_IDS, EXTENSION_SLOT_LISTING_METHOD, EXTENSION_SLOT_REF_SEPARATOR, EffectiveTuningSchema, EgressEncodeSchema, EgressRateControlSchema, EgressTranscodeRequestSchema, EgressTranscodeSchema, ElementConfigStore, EmbeddingFailedModelSchema, EmbeddingFailedRequirementSchema, EmbeddingInfoSchema, EmbeddingRefusalCodeSchema, EmbeddingResultSchema, EmbeddingTowerSchema, EncodeProfileSchema, EncodedPacketSchema, EnrichedWidgetMetadataSchema, EnumSensorDateTimeFormatSchema, EnumSensorStatusSchema, EventCategory, EventDensityBucketSchema, EventDensityForDeviceSchema, EventEmitterStatusSchema, EventFireSchema, EventKindCategorySchema, EventKindDescriptorSchema, EventKindIconSchema, EventKindSchema, EventKindsForDeviceSchema, EventMediaArtifactSchema, EventMediaCoverageSchema, EventMediaKindSchema, EventMediaProductionSchema, EventOwnerTypeSchema, EventSourceType, ExportBytesSchema, ExportClipSubjectSchema, ExportDenseRangeSchema, ExportDenseSchema, ExportDownloadSchema, ExportFootageSubjectSchema, ExportOptionsSchema, ExportRecordSchema, ExportSetupFieldSchema, ExportSetupSchema, ExportSpeedSchema, ExportStateSchema, ExportSubjectSchema, ExportTimelapseSchema, ExposedDeviceSchema, ExposureModeSchema, ExpressionBindingSourceSchema, ExpressionEvalError, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionParseError, ExpressionSourceSchema, ExtensionCandidateSchema, ExtensionCandidatesSchema, ExtensionSetResultSchema, ExtensionSetSlotInputSchema, ExtensionSlotActivationSchema, ExtensionSlotIdSchema, ExtensionSlotRefInputSchema, ExtensionSlotRowSchema, ExtensionSlotSourceSchema, ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema, ExtensionSlotValueSchema, ExtensionSourceAvailabilitySchema, ExtensionSourceHealthSchema, ExtensionSourceSchema, FEEDER_EXAMPLE_ADDON_ID, FEEDER_EXAMPLE_HA_DEVICE_ID, FFMPEG_PATH_ENV, FIRST_LEVEL_MACRO_CLASSES, FULL_IMAGE_BBOX, FailureContributionSchema, FailureCounters, FailureReasonCountSchema, FanControlStatusSchema, FanDirectionSchema, FeatureManifestSchema, FeatureProbeStatusSchema, FieldClaimModeSchema, FieldClaimSchema, FloodStatusSchema, Fmp4BoxSplitter, FrameHandleFormatSchema, FrameHandleSchema, FrameInputSchema, FrameLazyCountersSchema, FrameLazyMetricsSchema, G711_SCALE_CORRECTION_DB, GasStatusSchema, GetLoggingSettingsInputSchema, GetStreamWithCodecInputSchema, GlobalMetricsSchema, GridLayoutPatchSchema, GridLayoutViewSchema, HAP_AUDIO_BASE, HAP_AUDIO_BITRATE_KBPS, HAP_AUDIO_VBV_KBITS, HAP_KEYFRAME_INTERVAL_SEC, HF_BASE_URL, HF_REPO, HOURS_PER_DAY, HWACCEL_OPTIONS, HealthStatusSchema, HfModelResolutionSchema, HistoryPointSchema, HistoryResolutionEnum, HumidifierStatusSchema, HumiditySensorStatusSchema, HvacModeSchema, INFERENCE_DEVICE_EXCLUSION_REASONS, ImageContractSchema, ImageContractStateSchema, ImageRotateSchema, ImageSettingsOptionsSchema, ImageSettingsPatchSchema, ImageSettingsStatusSchema, ImageStatusSchema, InferenceDeviceExclusionReasonSchema, IngestOwnerSchema, InstalledPackageSchema, IntegrationLiteSchema, IntegrationWithStateSchema, IntercomAbilitySchema, IntercomStatusSchema, KNOWN_CAP_NAMES, KeyEventSchema, LEGACY_READ_ONLY_CONFIG_KEY, LINKED_DEVICES_SLOT, LOAD_CONTRIBUTION_ATTRIBUTIONS, LOAD_CONTRIBUTION_ROLES, LOCATION_DESCRIPTION_MAX, LOCATION_ICON_FALLBACK, LOCATION_ICON_IDS, LOG_CHANNEL_TICK_MS, LOG_LEVEL_RANK, LTS_SCOPE_CLASS_SEPARATOR, LabelAttributionSchema, LabelDefinitionSchema, LabelTierSchema, LawnMowerActivitySchema, LawnMowerControlStatusSchema, LedgerWalkDeviceReportSchema, LedgerWalkInputSchema, LedgerWalkRefusalSchema, LedgerWalkReportSchema, LedgerWalkSkipCountsSchema, LedgerWalkSkipReasonSchema, LegacyStorageLocationDefaultSchema, LinkedDeviceSchema, LinkedDevicesModeSchema, LinkedDevicesSlotValueSchema, LlmDefaultSchema, LlmDefaultSelectorSchema, LlmDownloadProgressSchema, LlmErrorCodeSchema, LlmGenerateBaseInputSchema, LlmGenerateErrSchema, LlmGenerateOkSchema, LlmGenerateResultSchema, LlmImageSchema, LlmNodeModelSchema, LlmProfileKindDescriptorSchema, LlmProfileKindSchema, LlmProfileSchema, LlmRefusalSourceSchema, LlmRetryPolicySchema, LlmRuntimeAppleCompleteInputSchema, LlmRuntimeCancelInputSchema, LlmRuntimeCompleteInputSchema, LlmRuntimeDiskUsageSchema, LlmRuntimeNodeSchema, LlmRuntimeStatusSchema, LlmTimeoutDefaults, LlmUsageRollupSchema, LlmUsageSchema, LoadContributionSchema, LocateSegmentResultSchema, LocationDescriptionAssignmentSchema, LocationIconAssignmentSchema, LocationIconIdSchema, LocationStatSchema, LockControlStatusSchema, LockStateSchema, LogChannelApplyResultSchema, LogChannelDescriptorSchema, LogChannelGate, LogChannelLevelSchema, LogChannelRegistry, LogChannelWindowPatchSchema, LogChannelWindowSchema, LogChannelWindowStateSchema, LogEntrySchema, LogLevelSchema, LogStreamEntrySchema, LoggingEffectiveSchema, LoggingExplicitSchema, LoggingLevelLayerSchema, LoggingLevelSourceSchema, LoggingScopeKindSchema, LoggingSettingsPatchSchema, LoggingSettingsStateSchema, LoginMethodContributionSchema, LoginStageEnum, LtsBucketSchema, MACRO_LABELS, MAX_ARCHIVED_DEBUG_NOTES, MAX_BIRTH_DECISION_RECORDS, MAX_BIRTH_LATENCY_PROXY_MS, MAX_CAMERA_SENSORS, MAX_CLIP_EVENT_IDS, MAX_CLIP_LABELS, MAX_COMPOSITION_CODE_LENGTH, MAX_COMPOSITION_FEATURES, MAX_COMPOSITION_FIELDS_PER_FEATURE, MAX_COMPOSITION_ITEMS, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_SOURCE_LENGTH, MAX_KEYS, MAX_REASONS_PER_KEY, MAX_SENSOR_TRIGGER_DEVICES, MAX_TRACK_DEBUG_NOTE_LEN, MEDIA_OWNER_TYPES, MEDIA_PRESENCE_OWNER_KINDS, METHOD_ACCESS_MAP, METHOD_DEVICE_SELECTORS, MINUTES_PER_DAY, MODEL_FORMATS, MODEL_HOSTING, MODEL_PROVIDER_IDS, MOTION_CLOSE_AFTER_MS, MOTION_SOURCE_LABELS, MOTION_TRIGGER_FEATURE, ManagedModelCatalogEntrySchema, ManagedModelExtraFileSchema, ManagedModelRefSchema, ManagedRuntimeConfigSchema, MaskGridDimsSchema, MaskGridShapeSchema, MaskLineShapeSchema, MaskPointSchema, MaskPolygonShapeSchema, MaskPolygonVerticesSchema, MaskRectShapeSchema, MaskShapeKindSchema, MaskShapeSchema, MediaFileInfoSchema, MediaFileKindEnum, MediaFileRefSchema, MediaFileSchema, MediaPlayerRepeatSchema, MediaPlayerStateSchema, MediaPlayerStatusSchema, MediaPresenceOwnerKindSchema, MediaRelocateModeSchema, MeshPeerSchema, MeshStatusSchema, MethodAccessSchema, MigrateDeviceResultSchema, MigrateSwitchOutcomeSchema, MigrateSwitchReportSchema, ModelCatalogEntrySchema, ModelConvertInputSchema, ModelConvertMetadataSchema, ModelDistributeInputSchema, ModelDistributeResultSchema, ModelExtraFileSchema, ModelFormatEntrySchema, ModelFormatsSchema, ModelLicenseSchema, ModelProviderIdSchema, ModelSubstitutionSchema, ModelVariantGroupSchema, MotionAnalysisResultSchema, MotionEventSchema, MotionOnMotionChangedDataSchema, MotionRegionSchema, MotionSourceEnum, MotionSourcesSchema, MotionStatusSchema, MotionTriggerRuntimeStateSchema, MotionTriggerStatusSchema, MotionTriggeredBySchema, MotionZoneOptionsSchema, MotionZonePatchSchema, MotionZoneRegionSchema, MotionZoneStatusSchema, StatusSchema as MqttBrokerStatusSchema, MutationFilterSchema, NATIVE_LEASE_ACTIVITY_FIELD, NATIVE_LEASE_ACTIVITY_KEY, NATIVE_LEASE_ADMISSION_FIELD, NATIVE_LEASE_ADMISSION_KEY, NATIVE_LEASE_BUDGET_FIELD, NATIVE_LEASE_BUDGET_KEY, NATIVE_LEASE_HOLD_FIELD, NATIVE_LEASE_HOLD_KEY, NATIVE_LEASE_SCENE_BUDGET_FIELD, NATIVE_LEASE_SCENE_BUDGET_KEY, NATIVE_LEASE_SECTION_ID, NATIVE_LEASE_TILE_BUDGET_FIELD, NATIVE_LEASE_TILE_BUDGET_KEY, NAVIGATION_ACTION_CATALOG, NAVIGATION_LIGHT_LEVEL_MAX, NAVIGATION_LIGHT_LEVEL_MIN, NC_ALARM_OPENING_EVENT_KINDS, NC_ALARM_SYSTEM_EVENT_KINDS, NC_AUDIO_CONFIRM_HITS_DEFAULT, NC_AUDIO_CONFIRM_HITS_MAX, NC_AUDIO_CONFIRM_HITS_MIN, NC_AUDIO_CONFIRM_WINDOW_MAX_SEC, NC_AUDIO_CONFIRM_WINDOW_MIN_SEC, NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT, NC_AUDIO_DBFS_FLOOR, NC_AUDIO_DB_MAX, NC_AUDIO_DB_MIN, NC_AUDIO_DB_OFFERED, NC_AUDIO_DB_STEP, NC_AUDIO_DEFAULTS, NC_AUDIO_HIT_PERCENT_MAX, NC_AUDIO_HIT_PERCENT_MIN, NC_AUDIO_SAMPLING_MAX_SEC, NC_AUDIO_SAMPLING_MIN_SEC, NC_AUDIO_SEED, NC_AUTHORABLE_SYSTEM_EVENT_KINDS, NC_BASE_CONDITION_KEYS, NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_CLIP_POST_ROLL_DEFAULT_SEC, NC_CLIP_PRE_ROLL_DEFAULT_SEC, NC_CLIP_RETENTION_MAX_SEC, NC_CONDITION_CATALOG, NC_CONFIRM_DEFAULT_MAX_IMAGE_PX, NC_CONFIRM_DEFAULT_TIMEOUT_MS, NC_CONFIRM_MAX_TIMEOUT_MS, NC_CONFIRM_MIN_TIMEOUT_MS, NC_CONSUMABLE_LOW_PERCENT_DEFAULT, NC_CONSUMABLE_LOW_PERCENT_MAX, NC_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_DEFAULT_SNOOZE_MINUTES, NC_HISTORY_LIMIT_DEFAULT, NC_HISTORY_LIMIT_MAX, NC_MAX_PER_TRACK_IMMEDIATE, NC_OCCUPANCY_DEFAULTS, NC_RULE_CLEARABLE_KEYS, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_RULE_SECTIONS, NC_SENSOR_RAISED_FIELD_BY_KIND, NC_SENSOR_TRANSITION_KINDS, NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, NC_SERVER_PACKAGE_NAME, NC_SNOOZE_MAX_MINUTES, NC_SYSTEM_DELIVERY, NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS, NC_SYSTEM_EVENT_FAMILIES, NC_SYSTEM_EVENT_FAMILY, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_FILTER_KEYS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, NC_SYSTEM_EVENT_SUMMARY_FAMILIES, NC_SYSTEM_RULE_KINDS, NC_TANK_SYSTEM_EVENT_KINDS, NC_TAXONOMY, NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, NC_UPDATE_EVENT_PACKAGE_NAMES, NETWORK_LINK_TYPES, NETWORK_LINK_UNKNOWN, NativeCropBboxSchema, NativeCropRefSchema, NativeCropResultSchema, NativeDetectionSchema, NativeLeaseAdmissionSchema, NativeLeaseSettingsSchema, NativeObjectClassEnum, NativeObjectDetectionOptionsSchema, NativeObjectDetectionRuntimeStateSchema, NativeObjectDetectionSettingsPatchSchema, NativeObjectDetectionStatusSchema, NativeObjectGeometryEnum, NavigationActionEntrySchema, NavigationActionIdSchema, NavigationEntryKindSchema, NavigationFeaturesSchema, NavigationLightModeSchema, NavigationModeSchema, NavigationMoveCommandSchema, NavigationPointSchema, NavigationRuntimeStateSchema, NavigationStatusSchema, NcAlarmConfigSchema, NcAlarmModeCoverageSchema, NcAlarmSettingsPatchSchema, NcAlarmSettingsSchema, NcAlarmSkipReasonSchema, NcAlarmSkippedDeviceSchema, NcAudioConditionSchema, NcClipRetentionAskSchema, NcClipRetentionPlanSchema, NcConditionDescriptorSchema, NcConditionsSchema, NcConfirmExpectSchema, NcConfirmSchema, NcCrossingSchema, NcDeliverySchema, NcDeviceStateConditionSchema, NcHistoryEntrySchema, NcHistoryFilterSchema, NcHistoryRecordKindSchema, NcHistoryStatusSchema, NcHistorySubjectSchema, NcLinkedCameraModeSchema, NcMediaFrameSchema, NcMediaPolicySchema, NcOccupancyConditionSchema, NcPlateMatcherSchema, NcRuleActionSchema, NcRuleActionSequenceSchema, NcRuleActionsSchema, NcRuleClearableKeySchema, NcRuleInputSchema, NcRuleKindSchema, NcRuleLastRunSchema, NcRuleLastRunsSchema, NcRuleNotificationButtonSchema, NcRulePatchSchema, NcRuleSchema, NcRuleTargetSchema, NcRuleUpdateInputSchema, NcSceneConditionSchema, NcScheduleSchema, NcScheduleWindowSchema, NcSensorTransitionSchema, NcSnoozeInputSchema, NcSnoozeSchema, NcSnoozeScopeSchema, NcSnoozeSuppressedSchema, NcStateSummaryPreviewSchema, NcStateSummaryPreviewSectionSchema, NcSystemEventConditionSchema, NcSystemEventDeliveryModeSchema, NcSystemEventDeliverySchema, NcSystemEventKindSchema, NcTaxonomyEntrySchema, NcTaxonomySchema, NcTemplateFamilySchema, NcTemplateFieldSchema, NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, NcTemplateVarContextSchema, NcTemplateVarDescriptorSchema, NcTemplateVarGroupSchema, NcTemplateVarKindSchema, NcTestResultSchema, NcThrottleGranularitySchema, NcThrottleSchema, NcZoneConditionSchema, NetworkAccessStatusSchema, NetworkAddressSchema, NetworkEndpointSchema, NetworkLinkStatusSchema, NodeDirectoryEntrySchema, NodeDirectorySchema, NotificationActionIconSchema, NotificationActionSchema, NotificationFormatSchema, NotificationSchema, NotifierStatusSchema, NumericSensorStatusSchema, OPERATOR_WRITTEN_STALE_MS, OPS_LOG_DEFAULT_LIMIT, OPS_LOG_RING_DEFAULT_MAX, OVERFLOW_REASON, OVERLAY_LAYERS, OWNER_ONLY_EVENT_CATEGORIES, OauthIntegrationDescriptorSchema, ObjectEventSchema, OccupancyBurstRefusalSchema, OnboardFieldSupportSchema, OnboardRecordTrackSchema, OnboardScheduleSupportSchema, OnboardStorageSchema, OnboardStorageVolumeSchema, OpsLogDomainSchema, OpsLogEntrySchema, OpsLogOpSchema, OpsLogQueryInputSchema, OpsLogReasonSchema, OrchestratorMetricsSchema, OsdOverlayKindEnum, OsdOverlayPatchSchema, OsdOverlaySchema, OsdPositionEnum, OsdRenderOutcomeEnum, OsdRenderResultSchema, OsdSlotBindingSchema, OsdSlotViewSchema, OsdSourceOptionSchema, OsdSourceSchema, OsdSourceValueTypeEnum, OsdStatusSchema, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PENDING_BLOCK_ID, PET_FEEDER_MANUAL_FEED_MAX, PET_FEEDER_MANUAL_FEED_MIN, PIPELINE_ANALYTICS_CAP_NAME, PIPELINE_FLOW_CAPABILITY_NAMES, PIPELINE_OWNER_CAPABILITY_NAMES, PRIVACY_MASK_CAP_NAME, PROVIDER_KIND_CAP_NAMES, PROVIDER_PIN_FIELD, PYTHON_SCRIPT, PackageUpdateSchema, PackageVersionInfoSchema, ParkRefusalSchema, ParkTrackFrameResultSchema, ParkedFrameKindSchema, ParkedTrackFrameSchema, PasskeyLoginMethodSchema, PasskeySummarySchema, PcmSampleFormatSchema, PeerBytesTicketSchema, PerScopeBreakdownSchema, PetFeederStatusSchema, PickStreamPreferencesSchema, PickStreamRequirementsSchema, PickedCamStreamSchema, PipelineAssignmentSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, PlaceholderReasonSchema, PolygonPointSchema, PoolMemoryWatchdog, PowerMeterStatusSchema, PresenceStatusSchema, PressureSensorStatusSchema, PrivacyMaskOptionsSchema, PrivacyMaskPatchSchema, PrivacyMaskRegionSchema, PrivacyMaskShapeSchema, PrivacyMaskStatusSchema, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, ProviderStatusSchema, PtzAutotrackRuntimeStateSchema, PtzAutotrackSettingsSchema, PtzAutotrackStatusSchema, PtzAutotrackTargetOptionSchema, PtzHomePresetSchema, PtzHomeReturnSchema, PtzMoveCommandSchema, PtzOptionsSchema, PtzPositionSchema, PtzPresetFunctionSchema, PtzPresetSchema, PtzStatusSchema, QueryFilterSchema, RATE_CONTROL_RELAXED, RATE_CONTROL_TIGHT, REACHABILITY_FAILURES_TO_OFFLINE, REACHABILITY_POLL_INTERVAL_MS, REACHABILITY_PROBE_TIMEOUT_MS, RECOGNITION_TYPES, RECORDING_AUDIO_TRIGGER_OFFERED_DBFS, RECORDING_EXPORT_MAX_READ_BYTES, RECORDING_SOURCE_CAMSTACK, RECORDING_SOURCE_CAMSTACK_ADDON, RECORDING_TIMELINE_BATCH_MAX, REDACTED_SECRET, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_SOURCES, RESTORED_CAP_NAMES, ROOM_EXAMPLE_MOTION_SOURCES, ROOM_EXAMPLE_TEMPERATURE_SOURCES, ROOM_OCCUPANCY_WINDOW_MS, ROOT_BUCKET_KEY, RUNTIME_DEFAULTS, RUNTIME_STATE_POLICY, RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS, RUNTIME_TO_FORMAT, RawStateResultSchema, ReadGopBytesResultSchema, ReadSegmentBytesResultSchema, ReadWindowBytesResultSchema, ReadinessRegistry, ReadinessTimeoutError, RebuildObjectEmbeddingsRefusalSchema, RecentTracksPageSchema, RecentTracksQueryInput, RecordTriggerSchema, RecordWindowSchema, RecordingAvailabilityForDeviceSchema, RecordingAvailabilitySchema, RecordingBandAudioSchema, RecordingBandModeSchema, RecordingBandSchema, RecordingBandTriggersSchema, RecordingConfigSchema, RecordingDaysForDeviceSchema, RecordingDaysSchema, RecordingDeviceUsageSchema, RecordingLocationUsageSchema, RecordingManifestSchema, RecordingObjectTriggerClassSchema, RecordingOnboardOptionsSchema, RecordingOnboardPatchSchema, RecordingOnboardStatusSchema, RecordingPlaybackSchema, RecordingRangeSchema, RecordingReadSchema, RecordingRebalanceInputSchema, RecordingRebalanceMoveSchema, RecordingRebalancePlanSchema, RecordingRebalanceSkipReasonSchema, RecordingRebalanceSkipSchema, RecordingRetentionSchema, RecordingSignalRuntimeStateSchema, RecordingSignalStatusSchema, RecordingSourceAvailabilitySchema, RecordingSourceOptionsSchema, RecordingSourceSchema, RecordingStatusSchema, RecordingStorageModeSchema, RecordingStorageUsageSchema, RecordingTriggersSchema, RecordingWeekdaySchema, RedirectLoginMethodSchema, RelocatableMediaCountInputSchema, RelocatableMediaCountSchema, RelocateFootageClassSchema, RelocateFootageInputSchema, RelocateJobSchema, RelocateJobStateSchema, RelocateMediaInputSchema, RelocateResidueInputSchema, RelocateResidueSchema, RenderedAsSchema, ReportMotionInputSchema, ReportedFailureContributionSchema, ReportedLoadContributionSchema, RequestCensusGroupSchema, RequestCensusProcedureSchema, RequestCensusSnapshotSchema, RequestCensusStatusSchema, RetrainAnnotationDraftSchema, RetrainAnnotationKindSchema, RetrainAnnotationSchema, RetrainAnnotationSourceSchema, RetrainAssistResultSchema, RetrainAssistSubjectSchema, RetrainCopyRefusalSchema, RetrainFrameCandidateSchema, RetrainFrameListSchema, RetrainFrameSchema, RetrainFrameSelectionSchema, RetrainMacroClassSchema, RetrainStatusSchema, RetrainTrackSchema, RetrainTransitionResultSchema, RingBuffer, RtpSourceSchema, RtspRestreamEntrySchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerInferenceDeviceSchema, RunnerJumpStepProvisioningSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, SCENE_CONDITIONS, SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS, SCENE_DEFAULT_ANCHOR_THRESHOLD, SCENE_DEFAULT_CHECK_INTERVAL_SEC, SCENE_DEFAULT_OBSERVATION_SPACING_SEC, SCENE_DEFAULT_QUIET_SECONDS, SCENE_DEFAULT_UNCOVERED_POLICY, SCENE_DIVERGED, SCENE_RESET_RECAPTURES, SCOPE_PRESETS, SENSOR_FEATURES, SENSOR_MAP, SHARE_VIEW_KINDS, SOURCE_CAPS, SOURCE_CAP_ACTIVE_FIELD, SOURCE_CAP_CHANGED_AT_FIELD, SOURCE_DEVICE_TYPES, SOURCE_INFO_METADATA_KEY, STATIONARY_OVERLAY_STYLE, STORAGE_ACCESS_FALLBACK, STORAGE_BYTES_PER_GB, STORAGE_LOCATION_MODES, STREAM_PROFILE_META, STREAM_QUALITY_LABELS, SUB_DETECTION_TYPES, SYSTEM_CAP_NAMES, SYSTEM_SCOPE_DEVICE_METHODS, SceneCheckSchema, SceneConditionSchema, SceneConfirmSchema, SceneMonitorSchema, SceneMonitorStateSchema, SceneMonitorStatusForDeviceSchema, SceneMonitorStatusSchema, SceneReferenceSchema, SceneUnavailableSchema, SceneUncoveredPolicySchema, SceneVerdictSchema, ScopedTokenSchema, ScopedTokenSummarySchema, ScoredObjectEventSchema, ScriptRunnerStatusSchema, SearchResultSchema, SendEmailInputSchema, SendEmailResultSchema, SendResultSchema, SensorEventSchema, ServerBootModeSchema, ServerPackageStatusSchema, ServerRollbackInfoSchema, ServerUpdateActionResultSchema, ServerUpdateCheckResultSchema, ServerUpdateOutcomeSchema, ServerUpdateStateSchema, SetCameraSensorsInputSchema, SetLoggingSettingsInputSchema, SetSiteLocationInputSchema, SettingsPatchSchema, SettingsRecordSchema, SettingsSchemaWithValuesSchema, SettingsUpdateResultSchema, ShmRingStatsSchema, SiteLocationSchema, SiteLocationSourceSchema, SiteLocationStatusSchema, SiteZoneSchema, SmokeStatusSchema, SmtpStatusSchema, SnapshotImageSchema, SourceInfoSchema, SpatialDetectionSchema, SsoBridgeClaimsSchema, StartEmbeddedInputSchema, StationaryObjectSchema, AbortUploadInputSchema as StorageAbortUploadInputSchema, StorageAccessSchema, BeginDownloadInputSchema as StorageBeginDownloadInputSchema, BeginDownloadResultSchema as StorageBeginDownloadResultSchema, BeginUploadInputSchema as StorageBeginUploadInputSchema, BeginUploadResultSchema as StorageBeginUploadResultSchema, StorageCleanupInputSchema, StorageCleanupJobSchema, StorageCleanupPhaseSchema, StorageCleanupStatusInputSchema, StorageDrainProgressSchema, EndDownloadInputSchema as StorageEndDownloadInputSchema, StorageEvictionPolicySchema, FinalizeUploadInputSchema as StorageFinalizeUploadInputSchema, StorageLocationDeclarationSchema, StorageLocationModeSchema, StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, StorageMigrationClassSchema, StorageMigrationDestinationsSchema, StorageMigrationDrainInputSchema, StorageMigrationFindingCodeSchema, StorageMigrationFindingSchema, StorageMigrationFootageMoveInputSchema, StorageMigrationInputSchema, StorageMigrationJobSchema, StorageMigrationLaneSchema, StorageMigrationLeaseInputSchema, StorageMigrationMediaMoveInputSchema, StorageMigrationModeSchema, StorageMigrationMoveProgressSchema, StorageMigrationMoveSchema, StorageMigrationMoverSchema, StorageMigrationParticipantSchema, StorageMigrationPhaseSchema, StorageMigrationPlanSchema, StorageMigrationResidueSchema, StorageMigrationSourcesSchema, StorageOccupancyReportSchema, ProviderInfoSchema as StorageProviderInfoSchema, ReadChunkInputSchema as StorageReadChunkInputSchema, TestLocationResultSchema as StorageTestLocationResultSchema, WriteChunkInputSchema as StorageWriteChunkInputSchema, StreamCodecSchema, StreamFormatSchema, StreamNetworkStatsSchema, StreamParamsOptionsSchema, StreamParamsStatusSchema, StreamProfileConfigSchema, StreamProfileOptionsSchema, StreamProfilePatchSchema, StreamProfileSchema, StreamSignalSchema, StreamSignalsStatusSchema, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, SubscribeFramesInputSchema, SubscribeFramesResultSchema, SwitchStatusSchema, SystemMetricsSchema, SystemMirror, TAXONOMY_COLORS, TIMELAPSE_DENSE_FLOOR_SEC, TIMEZONES, TRANSCODE_DOWN_MAX_BITRATE_KBPS, TRANSCODE_DOWN_MAX_HEIGHT, TamperStatusSchema, TankStatusSchema, TargetKindCapsSchema, TargetKindLevelSchema, TargetKindSchema, TargetSchema, TemperatureSensorStatusSchema, TerminalInstanceInfoSchema, TerminalLegacyCameraSchema, TerminalOutputBatchSchema, TerminalOutputEventSchema, TerminalProfileInfoSchema, TerminalSessionInfoSchema, TestConnectionResultSchema$1 as TestConnectionResultSchema, TestConnectionStatusEnum, TestResultSchema, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, ToastSchema, TokenScopeSchema, TopologyNodeSchema, TopologyProcessSchema, TopologyServiceSchema, TrackCascadeCountsSchema, TrackEnvelopeSchema, TrackFlagsPatchSchema, TrackFlagsSchema, TrackProjectionSchema, TrackSchema, TrackSourceSchema, TrackStateSchema, TrackZoneFilterSchema, TrackedDetectionSchema, TrainingExportDeviceTotalsSchema, TrainingExportSummarySchema, TransportPlaneCountsSchema, TransportPlaneSchema, TurnServerSchema, UNATTRIBUTED_BUCKET_KEY, UNIT_TABLE, BrokerInfoSchema$1 as UnifiedBrokerInfoSchema, UnitConversionError, UnstampedEventMediaCountSchema, UnstampedRowsSchema, UpdateIntegrationInputSchema, UpdateStatusSchema, UpdateUserInputSchema, UserRecordSchema, UserSummarySchema, VECTOR_INDEX_DIM_CONFLICT, VIDEOCLIPS_MAX_OFFER_BYTES, VIDEOCLIPS_MAX_READ_BYTES, VISIT_MERGE_GAP_MS, VacuumControlStatusSchema, VacuumStateSchema, ValveStateSchema, ValveStatusSchema, VectorDeclareIndexInputSchema, VectorDeleteByFilterInputSchema, VectorDeleteInputSchema, VectorDeleteResultSchema, VectorFilterSchema, VectorGetInputSchema, VectorGetResultSchema, VectorItemSchema, VectorMatchSchema, VectorMetadataSchema, VectorMetricSchema, VectorQueryInputSchema, VectorQueryResultSchema, VectorStatsInputSchema, VectorStatsResultSchema, VectorUpsertInputSchema, VectorUpsertResultSchema, VibrationStatusSchema, VideoEncodeSchema, WEBRTC_CLIMB_HOLD_CODES, WEBRTC_EGRESS_PROFILE, WEBRTC_TRY_BLOCKERS, WEEKLY_MASK_LENGTH, WELL_KNOWN_TABS, WELL_KNOWN_TAB_MAP, WaterHeaterStatusSchema, WeatherStatusSchema, WebrtcClimbHoldSchema, WebrtcLadderDecisionSchema, WebrtcSessionDebugSchema, WebrtcStreamChoiceSchema, WebrtcStreamTargetSchema, WebrtcTierFailureSchema, WhiteBalanceModeSchema, WidgetHostEnum, WidgetLoginMethodSchema, WidgetMetadataSchema, WidgetRemoteSchema, WidgetSizeEnum, WrapperActivationReadSchema, WrapperEvidenceSchema, WrapperIdentitySchema, WrapperKindSchema, YAMNET_TO_MACRO, ZoneCrossingDirectionSchema, ZoneCrossingSchema, ZoneKindEnum, ZoneRuleModeEnum, ZoneRuleSchema, ZoneRuleStageEnum, ZoneRulesArraySchema, ZoneSchema, ZoneScopeBreakdownSchema, __resetLogChannelRegistryForTests, accessoriesCapability, accessoryStableId, addonPagesCapability, addonPagesSourceCapability, addonRoutesCapability, addonSettingsCapability, addonWidgetsCapability, addonWidgetsSourceCapability, addonsCapability, adminUiCapability, airQualitySensorCapability, alarmPanelCapability, alertsCapability, ambientLightSensorCapability, asBoolean, asJsonArray, asJsonObject, asNumber, asString, assertTimelapseCadences, audioAnalysisCapability, audioAnalyzerCapability, audioChunkBytesPerSample, audioCodecCapability, audioIsFailClosed, audioKindId, audioLabelChoices, audioMetricsCapability, audioModeOf, audioOrDefaults, audioPlanFromEncodeProfile, audioScaleEraOf, authProviderCapability, autoAssignProfiles, automationControlCapability, backupCapability, bareAddonId, batteryCapability, bestLocationMatch, binaryCapability, bindAddonActions, brightnessCapability, brokerCapability, buildAddonRouteProvider, buildAudioArgs, buildCapabilityLookup, buildDeviceAdminUrl, buildDoorbellCompositionFeature, buildEventKindDescriptor, buildFfmpegArgs, buildInputArgs, buildModelVariantGroups, buildNcTaxonomy, buildRoleScopes, buildStreamParamsConfigSchema, buildVideoArgs, builtCapabilityBlockers, buttonCapability, cameraCredentialsCapability, cameraGridLayoutCapability, cameraPipelineConfigCapability, cameraSensorRefKey, cameraStreamsCapability, canConvertUnit, canonicalEgressPlan, carbonMonoxideCapability, cellsToRects, classifyBearerPrincipal, classifyStream, classifyStreams, climateControlCapability, clipExportFailure, clipExportFailureOf, clipReasonHeaderValue, cloneStatefulExpressionMemory, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, codecIsAccepted, collectHydratedFieldEntries, collectHydratedFieldValues, collectSecretConfigKeys, colorCapability, colorForKind, commitWatchdogRestart, compareToTarget, compileExpression, compileExpressionSafe, composeSwitchedOff, composedDeviceRef, composedDeviceStableId, composerCapability, compositionEdges, compositionFeatureEnabled, compositionFieldKey, compositionItemFieldPath, compositionReadKey, compositionSliceKey, compositionSourceKey, compositionSourceRefs, conditionDepth, conditionExclusionReason, conditionVisibleForKind, connectionTestCapability, connectivityCapability, consumableLowPercentOf, consumablesCapability, contactCapability, controlCapability, convertUnit, coreBlockAddonId, coreBlockComposition, coreBlockIdFromAddonId, coreBlockSourceKind, coreBlocksCapability, cosineSimilarity, countConditionLeaves, coverCapability, createDeviceExtensionProvider, createDeviceProxy, createDurableState, createEvent, createEventBusSliceSource, createExpressionScope, createHwAccelCache, createLazyTrpcSource, createLogChannelsProvider, createMirrorSource, createRuntimeStateBridge, createSliceHandle, createStatefulExpressionMemory, createSystemProxy, customAction, customModelRegistryCapability, dataStoreProviderCapability, dayNightCapability, dayOfWeekToIndex, declarationOwnerNodeId, declareLogChannel, decodeVectorBase64, decoderCapability, defaultDeliveryForSection, defaultDeviceFor, defineCustomActions, defineExtensionSlotProvider, deriveBatteryPresence, deriveCameraSwitches, deriveDetailCropRect, deriveRecordingMode, describeComposableCaps, describeCustomActions, describeModelVariant, describeOnboardClamp, describeOnboardRefusal, describeStateField, describeSystemEventDeliveryProblem, describeSystemEventFamilyProblem, describeTopLevelStateFields, detectAccessRole, detectionPipelineCapability, deviceAdminLinkCapability, deviceAdoptionCapability, deviceBackendToFormat, deviceCustomAction, deviceDiscoveryCapability, deviceExportCapability, deviceExtensionCapability, deviceManagerCapability, deviceMatchesProfile, deviceOpsCapability, deviceProviderCapability, deviceSelectorMatches, deviceStateCapability, deviceStatusCapability, displayIconEntry, displayIconsInGroup, doorbellCapability, doorbellFeatureSources, droppedConditionsForKind, egressTranscodeSharingKey, egressTransportFromRequest, embeddingEncoderCapability, embeddingModelFailedError, embeddingModelFailedOf, embeddingRefusalOf, embeddingRequirementsFailedError, embeddingRequirementsUnavailableError, emitDownForOwnedCaps, emitReadiness, emitsCollectionSelector, encodeProfileFromStreamShape, encodeVectorBase64, enumSensorCapability, enumerateInferenceDevices, enumerateItemArrayFields, enumerateSchemaFields, errMsg, evaluateAst, evaluateCompositionField, evaluateCount, evaluateExpressionSource, evaluatePoolMemory, evaluateRose, evaluateSensorEdge, evaluateSensorLevelEdge, evaluateStatefulExpressionCall, evaluateZoneRules, event, eventEmitterCapability, evictionPolicyForMode, evictionPolicyOfLocation, expandAudioChunkToF32le, expandCapMethods, expandContainer, exportSubjectOf, expressionContainsBuiltinCall, extensionSlotRef, extractNestedAddonId, extractSourceInfoFromMetadata, faceGalleryCapability, failureContributionCapability, failureRate, fanControlCapability, featureFieldEntries, featureProbeCapability, featureSources, feederCustomizationExample, feederExampleSources, ffmpegRate, fieldReads, filesystemBrowseCapability, findCandidateCycles, findCompositionCycles, findTimezone, floodCapability, foldSnapshotByFunction, formatForRuntime, formatMediaOwnerKey, formatMinutes, formatParkedFor, gasCapability, gbToBytes, generateAutomationBlock, getAudioMacroClassIds, getByPath, getCapsByProviderKind, getLogChannelRegistry, getTaxonomyEntry, gifDeriveSpeed, gifFilterComplex, gifFromMp4Args, hasMotionTrigger, hfModelUrl, htmlToText, humidifierCapability, humiditySensorCapability, hydrateSchema, imageCapability, imageSettingsCapability, inferExpressionKinds, inferModelProvider, initialPoolMemoryState, integrationsCapability, intercomCapability, interpretStoredClusterModel, invalidClusterStepModelEntries, invocationFromEncodeProfile, isAgentOnlyPlacement, isArrayOutputSchema, isAudioChunkFormat, isAudioLabelSelected, isAudioRule, isBaseConditionKey, isBatteryPresenceFault, isClusterScopedStep, isCollectionArrayMethod, isDeployableToAgent, isDetectionMacroClass, isDeviceConfigCap, isDeviceScopedCap, isDisplayIconKey, isEmbeddingModelFailed, isEvent, isEventOwnerType, isFirstLevelMacroClass, isHeldBackTemplateVar, isIsolatedBuiltin, isKnownTemplateVar, isLocationEnabled, isMediaOwnerType, isNode, isObjectInput, isOccupancyRule, isOwnerOnlyEventCategory, isRestoredCap, isSameAddonId, isScheduleActive, isSecretConfigField, isSoftwareDecode, isSourceCap, isStatefulBuiltin, isStorageLocationMode, isSystemDelivery, isSystemEventFamily, isSystemEventSummaryRule, isSystemRuleKind, isVectorIndexDimConflict, isVoidInput, ituDbfsFromPreEpoch, jobKindSchema, kebabToCamel, kindOfValue, kindsForDiscriminator, knownValues, lawnMowerControlCapability, legacyAutoLinkIds, legacyModeOf, lifecycleJobSchema, lifecycleJobScopeSchema, lifecycleJobStateSchema, lifecycleTaskSchema, llmCapability, llmRuntimeCapability, loadContributionCapability, localNetworkCapability, locationIconKey, locationSimilarity, lockControlCapability, logBannerArgs, logChannelsCapability, logDestinationCapability, logLevelAtMost, loginMethodCapability, looseSchema, makeProfileBrokerId, makeSourceBrokerId, mapAudioLabelToMacro, markdownToHtmlLite, markdownToText, maskUrlCredentials, mayReadLocation, mayWriteToLocation, mediaPlayerCapability, memoizePinnedFfmpeg, mergeSourceInfo, meshNetworkCapability, method, methodAccessForHttpMethod, metricsProviderCapability, migrateLegacyDeviceSignalConfig, minutesToTimeOfDay, modeMayRead, modeMayWrite, modelConvertCapability, modelDistributorCapability, modelFormatForRuntime, motionCapability, motionDetectionCapability, motionSourceLabel, motionTriggerCapability, motionZonesCapability, mqttBrokerCapability, nativeObjectDetectionCapability, navigationCapability, networkAccessCapability, networkLinkCapability, networkQualityCapability, nodePickerItems, nodePin, nodesCapability, normalizeAddonInitResult, normalizeAudioLabel, normalizeNodeId, normalizeTokenScopes, normalizeUnit, notificationOutputCapability, notificationRulesCapability, notifierCapability, numericSensorCapability, oauthIntegrationCapability, objectInputDeclaresAddonId, objectInputDeclaresRequiredDeviceId, occupancyScope, optionalAncestors, optionalMethod, osdCapability, osdManagerCapability, overlayClusterStepSettings, packagePickerItems, parseAdminBase, parseCameraStreamConfig, parseExpression, parseJsonArray, parseJsonObject, parseJsonUnknown, parseMediaOwnerKey, parseOccupancyScope, parseProcStatus, parseProfileBrokerId, parseRuleSection, parseStreamParamsFormPatch, patchAudio, petFeederCapability, pickAccessoryControl, pickClusterStepModels, pickClusterStepSettings, pickDetailCropConvention, pickInvalidClusterStepModels, pickNativeLeaseOverride, pickPreferredRtspEntry, pickRestartCandidate, pickVideoEncoder, pickerForCondition, pipelineAnalyticsCapability, pipelineExecutorCapability, pipelineOrchestratorCapability, pipelineRunnerCapability, planComposition, planCompositionEvents, planItems, plateGalleryCapability, platformProbeCapability, poolMemoryThreshold, powerMeterCapability, prepareNotification, presenceCapability, pressureSensorCapability, principalMayReachAddon, privacyMaskCapability, procedureAuthKey, ptzAutotrackCapability, ptzCapability, publicEventCategories, pythonScriptForBackend, rankStreams, readClusterStepModels, readClusterStepSettings, readDetailCropConvention, readDeviceStateFrom, readMotionTriggeredBy, readNativeLeaseOverride, readNodePin, readTimelapseGeneratedAt, readinessKey, rebootCapability, recordingArchiveCapability, recordingCapability, recordingExportCapability, recordingOnboardCapability, recordingSignalCapability, rectsToCells, reducePoints, replacedFieldKeys, requiredTopLevelKeys, requiresPython, reservedSourceOwner, resetPoolBaseline, resolveAddonExecution, resolveAddonGroup, resolveAddonPlacement, resolveBucketMs, resolveCapMount, resolveClipSearchMinScore, resolveClusterStepModelId, resolveContainerPrimaryChild, resolveCreateExportSubject, resolveDeviceControlKind, resolveDeviceProfile, resolveEgressDecodeHwAccel, resolveExportProfiles, resolveFormat, resolveHydratedFieldValue, resolveLocationIcon, resolveLocationMode, resolveMethodAuth, resolveMutate, resolvePoolMemoryPolicy, resolveRecordingProfiles, resolveRunnerId, resolveStreamMaps, resolveVariantModelId, resolveViewableDeviceIds, roleSpec, roomCompositionExample, ruleBelongsToAlarm, ruleEditorSectionsForKind, ruleKindOf, ruleKindSpec, ruleMatchesSection, ruleSection, ruleSectionOf, ruleSeedForSection, runInferenceStep, runtimeDevices, runtimeStatePolicyFor, sceneMonitorCapability, scheduleForSendTimes, schemaDeclaresAnyField, scopeInherits, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, scoreRuntimes, scriptRunnerCapability, searchDisplayIcons, selectAssignedProfileSlots, sendTimesOfSchedule, sensorRaisedOf, sensorTransitionNeverFires, sensorTransitionOffered, servedTemplateVars, serverManagementCapability, setByPath, settingsStoreCapability, signalPercentFromBars, signalPercentFromRssi, siteZoneKey, sleep, sleepCancellable, sliceActiveValue, sliceChangedAt, smokeCapability, smtpProviderCapability, snapshotCapability, ssoBridgeCapability, startReachabilityPoll, stateVocabularyFor, stepModelRunsOnFormat, storageCapability, storageEvictableCapability, storageMigrationCapability, storageOccupancyCapability, storageProviderCapability, streamBrokerCapability, streamCatalogCapability, streamParamsCapability, streamPixels, streamQualityLabel, streamSignalsCapability, stripRetiredBandPreBufferSec, strippedOfLegacyReadOnly, subKindsOf, summarisePrivacyAudio, summarizeEffectiveScope, supportedRuntimes, switchCapability, switchedOffIds, synthesizeSourceInfo, systemCapability, systemEventDeliveryProblems, systemEventFamilyOf, systemEventFamilyProblems, systemEventFilterApplies, systemEventFilterAppliesToAnyKind, systemEventKindNamesOf, systemEventKindsOfFamily, systemEventSummaryScheduleOf, systemFamilyOfKind, systemRuleKindOf, tamperCapability, taskLogEntrySchema, taskPhaseSchema, taskTargetSchema, temperatureSensorCapability, templateCarriesSummary, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, templateVarsFor, terminalSessionCapability, textToHtml, timeOfDayToMinutes, toDeviceSummary, toExpressionValue, toNodeId, toStreamSourceEntry, toastCapability, toggleAudioLabel, tokenize, transcodeBody, tryConvertUnit, turnProviderCapability, unitDimension, unitsForDimension, unreachableExtensionSlotRow, unwrapSchema, updateCapability, userManagementCapability, userPasskeysCapability, vacuumControlCapability, validateComposition, validateExpressionSource, validateRecipeBounds, valveCapability, vectorDimFromBase64, vectorIndexDimConflictError, vectorStoreCapability, vibrationCapability, videoclipsCapability, viewerUiCapability, waterHeaterCapability, weatherCapability, webrtcClientHintsSchema, webrtcSessionCapability, weeklyMaskIndex, weeklyMaskIsUniform, weeklyMaskToWindows, windowsToWeeklyMask, wiringAddonHealthSchema, wiringHealthSnapshotSchema, wiringNodeHealthSchema, wiringProbeKindSchema, wiringProbeResultSchema, withLocationMode, zodEntriesToConfigUI, zoneAnalyticsCapability, zoneRulesCapability, zonesCapability };