@camstack/types 1.2.275 → 1.2.277

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,4 +1,4 @@
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";
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-gU6hqv4_.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
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";
@@ -2001,6 +2001,98 @@ var ArchivedDebugNoteQueryInputSchema = z.object({
2001
2001
  limit: z.number().int().min(1).max(1e3).optional()
2002
2002
  });
2003
2003
  //#endregion
2004
+ //#region src/interfaces/track-relations.ts
2005
+ /**
2006
+ * Ground truth for the tracking bench, as debug marks (D681, spec §4).
2007
+ *
2008
+ * Identity over live tracks, not boxes: "A and B are the same subject",
2009
+ * "A and B are different subjects", and one track's purity ("mixed" — two
2010
+ * subjects, optionally switching at an instant — or "not a subject"). Rows
2011
+ * reference tracks as PROVENANCE: they outlive the tracks by design.
2012
+ *
2013
+ * Bounded by COUNT, never by age (the D405 argument): ground truth is most
2014
+ * valuable when it is old enough for the pattern to have repeated.
2015
+ */
2016
+ var MAX_TRACK_RELATIONS = 2e4;
2017
+ var MAX_TRACK_PURITIES = 5e3;
2018
+ var TRACK_RELATIONS_DEFAULT_LIMIT = 500;
2019
+ var TrackRelationKindSchema = z.enum(["same-subject", "different-subjects"]);
2020
+ var TrackSideSchema = z.enum(["before", "after"]);
2021
+ var TrackPurityValueSchema = z.enum(["mixed", "not-a-subject"]);
2022
+ var TrackRelationSchema = z.object({
2023
+ id: z.string(),
2024
+ deviceId: z.number().int(),
2025
+ leftTrackId: z.string(),
2026
+ rightTrackId: z.string(),
2027
+ leftSide: TrackSideSchema.nullable(),
2028
+ rightSide: TrackSideSchema.nullable(),
2029
+ relation: TrackRelationKindSchema,
2030
+ presence: z.literal("continuous").nullable(),
2031
+ leftStartedAt: z.number().int().nullable(),
2032
+ rightStartedAt: z.number().int().nullable(),
2033
+ createdAt: z.number().int(),
2034
+ updatedAt: z.number().int(),
2035
+ author: z.string().nullable()
2036
+ });
2037
+ var TrackPuritySchema = z.object({
2038
+ id: z.string(),
2039
+ deviceId: z.number().int(),
2040
+ sourceTrackId: z.string(),
2041
+ purity: TrackPurityValueSchema,
2042
+ switchAtMs: z.number().int().nullable(),
2043
+ startedAt: z.number().int().nullable(),
2044
+ createdAt: z.number().int(),
2045
+ updatedAt: z.number().int(),
2046
+ author: z.string().nullable()
2047
+ });
2048
+ var SetTrackRelationInputSchema = z.object({
2049
+ deviceId: z.number().int(),
2050
+ trackId: z.string().min(1),
2051
+ otherTrackId: z.string().min(1),
2052
+ relation: TrackRelationKindSchema,
2053
+ presence: z.literal("continuous").optional(),
2054
+ trackSide: TrackSideSchema.optional(),
2055
+ otherSide: TrackSideSchema.optional()
2056
+ });
2057
+ var ClearTrackRelationInputSchema = z.object({
2058
+ deviceId: z.number().int(),
2059
+ trackId: z.string().min(1),
2060
+ otherTrackId: z.string().min(1)
2061
+ });
2062
+ var ClearTrackRelationResultSchema = z.object({ cleared: z.boolean() });
2063
+ var SetTrackPurityInputSchema = z.object({
2064
+ deviceId: z.number().int(),
2065
+ trackId: z.string().min(1),
2066
+ purity: z.enum([
2067
+ "pure",
2068
+ "mixed",
2069
+ "not-a-subject"
2070
+ ]),
2071
+ switchAtMs: z.number().int().optional()
2072
+ });
2073
+ /** `null` when `pure` cleared the row. */
2074
+ var SetTrackPurityResultSchema = z.object({ purity: TrackPuritySchema.nullable() });
2075
+ var ListTrackRelationsInputSchema = z.object({
2076
+ deviceId: z.number().int(),
2077
+ trackId: z.string().optional(),
2078
+ since: z.number().int().optional(),
2079
+ until: z.number().int().optional(),
2080
+ limit: z.number().int().min(1).max(5e3).optional()
2081
+ });
2082
+ var ListTrackRelationsResultSchema = z.object({
2083
+ relations: z.array(TrackRelationSchema).readonly(),
2084
+ purities: z.array(TrackPuritySchema).readonly(),
2085
+ truncated: z.boolean()
2086
+ });
2087
+ var TrackRelationRefusalSchema = z.enum([
2088
+ "unknown-track",
2089
+ "cross-device",
2090
+ "self-relation",
2091
+ "contradiction",
2092
+ "switch-outside-track",
2093
+ "switch-needs-mixed"
2094
+ ]);
2095
+ //#endregion
2004
2096
  //#region src/interfaces/device-capabilities/camera.ts
2005
2097
  /** Friendly display labels for stream quality IDs. */
2006
2098
  var STREAM_QUALITY_LABELS = {
@@ -9789,251 +9881,1180 @@ var CompositionBlockStateSchema = z.object({
9789
9881
  fields: z.array(CompositionFieldStateSchema)
9790
9882
  });
9791
9883
  //#endregion
9792
- //#region src/capabilities/core-blocks.cap.ts
9793
- /**
9794
- * core-blocks — user-authored TypeScript, stored in the kernel and executed in
9795
- * its own process.
9796
- *
9797
- * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
9798
- *
9799
- * The first use is **owning devices without being a device provider**: a block
9800
- * declares devices under a system or custom integration and drives their state,
9801
- * with the same `ctx` an addon gets. Automations come later; nothing here
9802
- * models a trigger.
9803
- *
9804
- * **Stated plainly, because it does not change by being true:** a block has an
9805
- * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
9806
- * with no review step. What makes that survivable is not a sandbox, it is
9807
- * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
9808
- * so a block that throws or never returns is marked `failed` and visible
9809
- * instead of taking the hub with it (D6). Every method here is admin-only, and
9810
- * must stay so.
9811
- */
9812
- /**
9813
- * Prefix for a block's generated addon id AND its runner id — one addon, one
9814
- * process, so the two are the same string (D2).
9815
- *
9816
- * It lives on the CONTRACT rather than beside the code that materialises the
9817
- * package, because it is not an implementation detail: the operator surface
9818
- * reads a block's logs by asking `logs.query` for `addonId = core-block-<id>`,
9819
- * with no cap and no store of its own. Two copies of this string is one copy
9820
- * too many — a drift would show as a logs pane that is simply always empty.
9821
- */
9822
- var CORE_BLOCK_ADDON_PREFIX = "core-block-";
9884
+ //#region src/composition/plan-result.ts
9885
+ function problem(code, path, message) {
9886
+ return {
9887
+ code,
9888
+ path,
9889
+ message
9890
+ };
9891
+ }
9892
+ function refused(...problems) {
9893
+ return {
9894
+ problems,
9895
+ fields: [],
9896
+ features: [],
9897
+ events: []
9898
+ };
9899
+ }
9900
+ /** Where a planned field sits in the composition: `features[N].fields.<path>` or `features[N].items.<key>.fields.<path>`. */
9901
+ function compositionFieldAt(field) {
9902
+ const inner = field.item === void 0 ? "fields" : `items.${field.item.key}.fields`;
9903
+ return `features[${field.featureIndex}].${inner}.${field.path}`;
9904
+ }
9905
+ //#endregion
9906
+ //#region src/composition/expression-kinds.ts
9907
+ var NUMBER = {
9908
+ kind: "fixed",
9909
+ result: ["number"]
9910
+ };
9911
+ var BOOLEAN = {
9912
+ kind: "fixed",
9913
+ result: ["boolean"]
9914
+ };
9915
+ /** One rule per builtin. `expression-kinds.spec.ts` fails for a builtin missing here. */
9916
+ var BUILTIN_RESULT_KINDS = Object.freeze({
9917
+ min: NUMBER,
9918
+ max: NUMBER,
9919
+ abs: NUMBER,
9920
+ floor: NUMBER,
9921
+ ceil: NUMBER,
9922
+ sqrt: NUMBER,
9923
+ round: NUMBER,
9924
+ pow: NUMBER,
9925
+ clamp: NUMBER,
9926
+ avg: NUMBER,
9927
+ sum: NUMBER,
9928
+ age: NUMBER,
9929
+ convert: NUMBER,
9930
+ coalesce: { kind: "coalesce" },
9931
+ any: BOOLEAN,
9932
+ all: BOOLEAN,
9933
+ within: BOOLEAN,
9934
+ latest: {
9935
+ kind: "fixed",
9936
+ result: ["number", "null"]
9937
+ },
9938
+ number: {
9939
+ kind: "fixed",
9940
+ result: ["number", "null"]
9941
+ },
9942
+ rose: {
9943
+ kind: "fixed",
9944
+ result: ["number", "null"]
9945
+ },
9946
+ count: NUMBER
9947
+ });
9948
+ var KindInferenceError = class extends Error {};
9949
+ function kindOfValue(value) {
9950
+ if (value === null) return "null";
9951
+ if (typeof value === "number") return "number";
9952
+ if (typeof value === "string") return "string";
9953
+ return "boolean";
9954
+ }
9955
+ function only(kind) {
9956
+ return new Set([kind]);
9957
+ }
9958
+ function union(...sets) {
9959
+ return new Set(sets.flatMap((s) => [...s]));
9960
+ }
9961
+ function withoutNull(set) {
9962
+ return new Set([...set].filter((k) => k !== "null"));
9963
+ }
9964
+ function binaryKinds(op, left, right) {
9965
+ if (op === "+") {
9966
+ const all = [...left, ...right];
9967
+ if (all.every((k) => k === "string")) return only("string");
9968
+ if (all.every((k) => k === "number")) return only("number");
9969
+ return new Set(["number", "string"]);
9970
+ }
9971
+ if (op === "-" || op === "*" || op === "/" || op === "%") return only("number");
9972
+ return only("boolean");
9973
+ }
9974
+ /** "exactly N" / "at least N" / "N–M", for an arity refusal that says what IS allowed. */
9975
+ function arityRange(builtin) {
9976
+ if (builtin.minArgs === builtin.maxArgs) return `exactly ${builtin.minArgs}`;
9977
+ if (builtin.maxArgs === Number.POSITIVE_INFINITY) return `at least ${builtin.minArgs}`;
9978
+ return `${builtin.minArgs}–${builtin.maxArgs}`;
9979
+ }
9980
+ function callKinds(callee, args) {
9981
+ const builtin = EXPRESSION_BUILTINS[callee];
9982
+ 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)}`);
9983
+ const rule = BUILTIN_RESULT_KINDS[callee];
9984
+ if (rule === void 0) throw new KindInferenceError(`no result-kind rule for builtin '${callee}'`);
9985
+ if (rule.kind === "fixed") return new Set(rule.result);
9986
+ const nonNull = union(...args.map(withoutNull));
9987
+ return args.every((a) => a.has("null")) ? union(nonNull, only("null")) : nonNull;
9988
+ }
9989
+ function kindsOf(node, bindings) {
9990
+ switch (node.kind) {
9991
+ case "literal": return only(kindOfValue(node.value));
9992
+ case "identifier": {
9993
+ if (node.name === "now") return only("number");
9994
+ const bound = bindings.get(node.name);
9995
+ if (bound === void 0) throw new KindInferenceError(`unbound identifier '${node.name}'`);
9996
+ return bound;
9997
+ }
9998
+ case "unary": return only(node.op === "!" ? "boolean" : "number");
9999
+ case "binary": return binaryKinds(node.op, kindsOf(node.left, bindings), kindsOf(node.right, bindings));
10000
+ case "logical": return union(kindsOf(node.left, bindings), kindsOf(node.right, bindings));
10001
+ case "conditional": return union(kindsOf(node.consequent, bindings), kindsOf(node.alternate, bindings));
10002
+ case "call": return callKinds(node.callee, node.args.map((a) => kindsOf(a, bindings)));
10003
+ }
10004
+ }
10005
+ function nodeContainsCall(node, callee) {
10006
+ switch (node.kind) {
10007
+ case "literal":
10008
+ case "identifier": return false;
10009
+ case "unary": return nodeContainsCall(node.operand, callee);
10010
+ case "binary":
10011
+ case "logical": return nodeContainsCall(node.left, callee) || nodeContainsCall(node.right, callee);
10012
+ case "conditional": return nodeContainsCall(node.test, callee) || nodeContainsCall(node.consequent, callee) || nodeContainsCall(node.alternate, callee);
10013
+ case "call": return node.callee === callee || node.args.some((arg) => nodeContainsCall(arg, callee));
10014
+ }
10015
+ }
10016
+ function expressionContainsBuiltinCall(expr, callee) {
10017
+ const compiled = compileExpressionSafe(expr);
10018
+ return compiled.ok && nodeContainsCall(compiled.parsed.ast, callee);
10019
+ }
10020
+ function inferExpressionKinds(input) {
10021
+ const compiled = compileExpressionSafe(input.expr);
10022
+ if (!compiled.ok) return {
10023
+ ok: false,
10024
+ error: compiled.error
10025
+ };
10026
+ try {
10027
+ return {
10028
+ ok: true,
10029
+ kinds: kindsOf(compiled.parsed.ast, input.bindingKinds)
10030
+ };
10031
+ } catch (err) {
10032
+ if (err instanceof KindInferenceError) return {
10033
+ ok: false,
10034
+ error: err.message
10035
+ };
10036
+ throw err;
10037
+ }
10038
+ }
10039
+ //#endregion
10040
+ //#region src/composition/field-kinds.ts
9823
10041
  /**
9824
- * The builtin's own addon id — and, because of that, the OWNER of the
9825
- * integration every block's devices hang from.
9826
- *
9827
- * A block cannot own one. Every integration read is gated on the installed-addon
9828
- * set (`addon-registry.service.ts` → `createFilteredRegistry`) and a block's
9829
- * `core-block-<uuid>` is never in it, so its `getIntegrationByAddonId` answers
9830
- * null forever while the write succeeds — one invisible, undeletable row per
9831
- * start. `core-blocks` IS installed, so it reconciles one shared integration and
9832
- * a block names it by id (`DeclaredDevicesSpec.integrationId`), minting nothing.
9833
- *
9834
- * Exported from the contract, next to the runner prefix and for the same reason:
9835
- * a block reads it as
9836
- * `ctx.api.integrations.getByAddonId.query({ addonId: CORE_BLOCKS_ADDON_ID })`,
9837
- * so a second copy of the string is a block that silently declares into nowhere.
10042
+ * The kind half of planning a composition field (D659): which kinds a source
10043
+ * can produce, whether they fit a target field, and the field's role.
10044
+ * Shared by the top-level planner (`validate-composition.ts`) and the item
10045
+ * planner (`composition-items.ts`). Internal to the composition module — NOT
10046
+ * in the barrel: these are planner internals, not a published contract.
9838
10047
  */
9839
- var CORE_BLOCKS_ADDON_ID = "core-blocks";
9840
- /** The addon/runner id a block's process runs under. */
9841
- function coreBlockAddonId(blockId) {
9842
- return `${CORE_BLOCK_ADDON_PREFIX}${blockId}`;
10048
+ function readKinds(read, lookupCap) {
10049
+ const def = lookupCap(read.cap);
10050
+ const schema = def?.runtimeState ?? def?.status?.schema;
10051
+ if (def === null || schema === void 0) return {
10052
+ ok: false,
10053
+ code: "source-field-unknown",
10054
+ message: `no capability \`${read.cap}\` with state to read`
10055
+ };
10056
+ const field = describeStateField(schema, read.fieldPath);
10057
+ if (field === null) return {
10058
+ ok: false,
10059
+ code: "source-field-unknown",
10060
+ message: `\`${read.cap}\` has no field \`${read.fieldPath}\``
10061
+ };
10062
+ const base = field.kind === "enum" ? "string" : field.kind;
10063
+ return {
10064
+ ok: true,
10065
+ kinds: new Set(field.nullable ? [base, "null"] : [base])
10066
+ };
9843
10067
  }
9844
- /** The block id behind a generated addon/runner id, or null when the id belongs
9845
- * to something else. The inverse of {@link coreBlockAddonId}. */
9846
- function coreBlockIdFromAddonId(addonId) {
9847
- if (!addonId.startsWith("core-block-")) return null;
9848
- const rest = addonId.slice(11);
9849
- return rest.length > 0 ? rest : null;
10068
+ function sourceKinds(source, lookupCap) {
10069
+ if (source.kind === "from") return readKinds(source, lookupCap);
10070
+ if (source.kind === "code") return {
10071
+ ok: false,
10072
+ code: "reserved-variant",
10073
+ message: "code fields arrive in slice 4"
10074
+ };
10075
+ const bindingKinds = /* @__PURE__ */ new Map();
10076
+ for (const [name, binding] of Object.entries(source.bindings)) {
10077
+ if (binding.kind === "literal") {
10078
+ bindingKinds.set(name, new Set([kindOfValue(binding.value)]));
10079
+ continue;
10080
+ }
10081
+ const kinds = readKinds(binding, lookupCap);
10082
+ if (!kinds.ok) return {
10083
+ ...kinds,
10084
+ message: `binding \`${name}\`: ${kinds.message}`
10085
+ };
10086
+ bindingKinds.set(name, kinds.kinds);
10087
+ }
10088
+ const inferred = inferExpressionKinds({
10089
+ expr: source.expr,
10090
+ bindingKinds
10091
+ });
10092
+ return inferred.ok ? {
10093
+ ok: true,
10094
+ kinds: inferred.kinds
10095
+ } : {
10096
+ ok: false,
10097
+ code: "expression-invalid",
10098
+ message: inferred.error
10099
+ };
10100
+ }
10101
+ function compatibility(cap, target, kinds, at) {
10102
+ const allowed = target.kind === "enum" ? "string" : target.kind;
10103
+ const offending = [...kinds].filter((k) => k !== "null" && k !== allowed);
10104
+ const problems = [];
10105
+ if (offending.length > 0) problems.push(problem("kind-mismatch", at, `\`${cap}.${target.path}\` is a ${target.kind}; this source can produce ${offending.join(" or ")}`));
10106
+ 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`));
10107
+ return problems;
9850
10108
  }
9851
- /** Where a block runs. The operator chooses — a block driving a device on an
9852
- * agent is the reason placement is not fixed to the hub. */
9853
- var CoreBlockPlacementSchema = z.union([z.literal("hub"), z.string().min(1)]);
9854
- /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
9855
- * a failing block reads the same way a failing addon does. `degraded` is a
9856
- * composition on an existing device with a field handed back to the native
9857
- * provider while its source is unavailable (S1b, D663); the error names it. */
9858
- var CoreBlockStatusSchema = z.enum([
9859
- "stopped",
9860
- "starting",
9861
- "running",
9862
- "degraded",
9863
- "failed"
9864
- ]);
9865
- /** Client-authored fields. */
9866
- var CoreBlockInputSchema = z.object({
9867
- name: z.string().min(1).max(120),
9868
- /** TypeScript source. Compiled server-side before it is ever stored — a
9869
- * block that does not compile is a fork failure the operator would meet
9870
- * minutes later, in a log, instead of in the editor. */
9871
- code: z.string().max(2e5),
9872
- enabled: z.boolean(),
9873
- placement: CoreBlockPlacementSchema,
9874
- /**
9875
- * Integration the block's devices hang from. Absent = the system integration
9876
- * blocks share. A block may declare its own instead.
9877
- */
9878
- integrationId: z.string().optional()
9879
- });
9880
10109
  /**
9881
- * What a block IS (D659). Absent means `code` — every row stored before this
9882
- * union keeps working unchanged.
9883
- * - `code`: the TypeScript in `code`, compiled and run in its own runner;
9884
- * - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
9885
- * - `composition`: declarative, run by the shared `composer`; `code` is `''`.
10110
+ * A string a source produces WITHOUT reading any device — a field-level
10111
+ * `expression` source whose compiled AST is a bare string literal (`"red"`,
10112
+ * never `a` or `a + "x"`). Anything else that can only produce `'string'` at
10113
+ * the kind level (a `from` read of an enum-typed source field, a computed
10114
+ * expression) is NOT checked against the target's `enumValues` here: the
10115
+ * kind inference already collapsed it to the coarse `'string'` kind, losing
10116
+ * whichever enum it actually came from, so membership can only be judged at
10117
+ * write time against the runtime-state schema. Known limitation — see the
10118
+ * fix report for Task 6 round 1.
9886
10119
  */
9887
- var CoreBlockSourceSchema = z.discriminatedUnion("kind", [
9888
- z.object({ kind: z.literal("code") }),
9889
- z.object({
9890
- kind: z.literal("recipe"),
9891
- recipe: AutomationRecipeSchema
9892
- }),
9893
- z.object({
9894
- kind: z.literal("composition"),
9895
- composition: CompositionSchema
9896
- })
9897
- ]);
10120
+ function literalStringValue(source) {
10121
+ if (source.kind !== "expression") return null;
10122
+ const compiled = compileExpressionSafe(source.expr);
10123
+ if (!compiled.ok) return null;
10124
+ const ast = compiled.parsed.ast;
10125
+ return ast.kind === "literal" && typeof ast.value === "string" ? ast.value : null;
10126
+ }
9898
10127
  /**
9899
- * The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7).
9900
- *
9901
- * `name`: REQUIRED for a `new` target — the block's name IS the device's name
9902
- * (D659). ABSENT for an `existing` target — a customization has no name of its
9903
- * own; the server derives one (`customizationBlockName`, D663) and refuses a
9904
- * client-sent name by name.
10128
+ * An enum target whose source is a save-time-KNOWN string literal outside its
10129
+ * `enumValues` is refused now rather than left to fail the write later. A
10130
+ * dynamic source (a `from` read, a non-literal expression) is left to
10131
+ * runtime — see {@link literalStringValue}.
9905
10132
  */
9906
- var CompositionBlockInputSchema = z.object({
9907
- name: z.string().min(1).max(120).optional(),
9908
- enabled: z.boolean(),
9909
- composition: CompositionSchema
9910
- });
9911
- /** A stored block. */
9912
- var CoreBlockSchema = CoreBlockInputSchema.extend({
9913
- id: z.string(),
9914
- createdAt: z.number(),
9915
- updatedAt: z.number(),
9916
- /** Server-stamped author. */
9917
- createdBy: z.string(),
9918
- status: CoreBlockStatusSchema,
9919
- /**
9920
- * Why the block is not running, when it is not. The operator's ONLY window
9921
- * into a block that failed at load — a block that is silently absent is the
9922
- * failure mode this whole feature has to avoid.
9923
- */
9924
- lastError: z.string().optional(),
9925
- /** Ms epoch of the last state change. */
9926
- lastChangedAt: z.number(),
9927
- /** What the block is. Absent means `code` (D659). */
9928
- source: CoreBlockSourceSchema.optional()
9929
- });
9930
- function coreBlockSourceKind(block) {
9931
- return block.source?.kind ?? "code";
10133
+ function enumLiteralProblem(cap, target, source, at) {
10134
+ if (target.kind !== "enum" || target.enumValues === void 0) return null;
10135
+ const value = literalStringValue(source);
10136
+ if (value === null || target.enumValues.includes(value)) return null;
10137
+ const allowed = target.enumValues.map((v) => `\`${v}\``).join(", ");
10138
+ return problem("kind-mismatch", at, `\`${cap}.${target.path}\` accepts only ${allowed}; this source is the literal \`${value}\``);
9932
10139
  }
9933
- function coreBlockComposition(block) {
9934
- return block.source?.kind === "composition" ? block.source.composition : null;
10140
+ function roleOf(source) {
10141
+ if (source.kind !== "expression") return "derived";
10142
+ if (expressionContainsBuiltinCall(source.expr, "count")) return "accumulator";
10143
+ if (fieldReads(source).length > 0) return "derived";
10144
+ const compiled = compileExpressionSafe(source.expr);
10145
+ return compiled.ok && compiled.parsed.identifiers.has("now") ? "clock" : "constant";
9935
10146
  }
9936
- /** What the composer said, or that it could not be asked. Unknown never looks like absent (D315). */
9937
- var CompositionStateReadSchema = z.discriminatedUnion("kind", [z.object({
9938
- kind: z.literal("answered"),
9939
- state: CompositionBlockStateSchema.nullable()
9940
- }), z.object({
9941
- kind: z.literal("unreachable"),
9942
- error: z.string()
9943
- })]);
9944
- /** A stored composition block and what the composer says about it. */
9945
- var CompositionViewSchema = z.object({
9946
- block: CoreBlockSchema,
9947
- state: CompositionStateReadSchema
9948
- });
9949
10147
  /**
9950
- * A read of the stored compositions. `not-loaded` while the `core_blocks`
9951
- * table has not been READ: an empty answer then would make "not yet known"
9952
- * look like "none", and invite the operator to recreate what exists (D315).
10148
+ * How a planned field says "unavailable", per feature mode and AFTER `roleOf`
10149
+ * (D393, D663 rulings S1 + S1b). The composer cannot take a device it does not
10150
+ * own offline, and D393 forbids a stale number, so on an existing target a
10151
+ * field that READS a source never gets `offline`.
9953
10152
  */
9954
- var CompositionsNotLoadedSchema = z.object({
9955
- state: z.literal("not-loaded"),
9956
- reason: z.string()
9957
- });
9958
- var CompositionListReadSchema = z.discriminatedUnion("state", [z.object({
9959
- state: z.literal("loaded"),
9960
- views: z.array(CompositionViewSchema)
9961
- }), CompositionsNotLoadedSchema]);
9962
- var CompositionGetReadSchema = z.discriminatedUnion("state", [z.object({
9963
- state: z.literal("loaded"),
9964
- view: CompositionViewSchema.nullable()
9965
- }), CompositionsNotLoadedSchema]);
9966
- /** The customization of one existing device, found by its TARGET, or `not-loaded` (D315). */
9967
- var CompositionCustomizationReadSchema = z.discriminatedUnion("state", [z.object({
9968
- state: z.literal("loaded"),
9969
- view: CompositionViewSchema.nullable()
9970
- }), CompositionsNotLoadedSchema]);
9971
- /** What a compile attempt produced. */
9972
- var CoreBlockCompileResultSchema = z.object({
9973
- ok: z.boolean(),
9974
- /** Present when `ok` is false — the first error, in the author's words. */
9975
- error: z.string().optional(),
9976
- line: z.number().optional(),
9977
- column: z.number().optional()
9978
- });
9979
- var coreBlocksCapability = {
9980
- name: "core-blocks",
9981
- scope: "system",
9982
- mode: "singleton",
9983
- methods: {
9984
- list: method(z.object({}), z.object({ blocks: z.array(CoreBlockSchema) }), { auth: "admin" }),
9985
- get: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }),
9986
- /**
9987
- * Create a block. The code is COMPILED first: storing source that does not
9988
- * compile turns an editor error into a fork failure the operator meets
9989
- * minutes later in a log.
9990
- */
9991
- create: method(z.object({ block: CoreBlockInputSchema }), z.object({ block: CoreBlockSchema }), {
9992
- kind: "mutation",
9993
- auth: "admin",
9994
- caller: "required"
9995
- }),
9996
- update: method(z.object({
9997
- blockId: z.string(),
9998
- block: CoreBlockInputSchema.partial()
9999
- }), z.object({ block: CoreBlockSchema }), {
10000
- kind: "mutation",
10001
- auth: "admin",
10002
- caller: "required"
10003
- }),
10004
- delete: method(z.object({ blockId: z.string() }), z.object({ success: z.literal(true) }), {
10005
- kind: "mutation",
10006
- auth: "admin"
10007
- }),
10008
- setEnabled: method(z.object({
10009
- blockId: z.string(),
10010
- enabled: z.boolean()
10011
- }), z.object({ block: CoreBlockSchema }), {
10012
- kind: "mutation",
10013
- auth: "admin"
10014
- }),
10015
- /**
10016
- * Stop this block's runner and let the supervisor bring it back.
10017
- *
10018
- * **It stores nothing.** There is no "restart requested" flag and no second
10019
- * lifecycle field: the supervisor already stops and respawns a runner when
10020
- * the code hash changes, and this exposes that same path deliberately
10021
- * (D62 — a switch writes the authority that already owned the function).
10022
- * The next reconcile pass remains the authority, so a restart that lost a
10023
- * race is corrected within one pass rather than leaving a stale flag behind.
10024
- *
10025
- * Refused for a DISABLED block: nothing would come back, and a button that
10026
- * silently does nothing is worse than one that says why.
10027
- */
10028
- restart: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema }), {
10029
- kind: "mutation",
10030
- auth: "admin"
10031
- }),
10032
- /**
10033
- * Type-check without saving — what the editor calls as the author types, so
10034
- * the compiler's verdict is the same one the server will reach.
10035
- */
10036
- compile: method(z.object({ code: z.string() }), CoreBlockCompileResultSchema, {
10153
+ function unavailableFor(tf, role, mode, cap, at) {
10154
+ if (mode === "replace" && (role === "derived" || role === "accumulator")) return {
10155
+ ok: true,
10156
+ unavailable: "release"
10157
+ };
10158
+ if (mode === "new" || role !== "derived") return {
10159
+ ok: true,
10160
+ unavailable: tf.nullable ? "null" : "offline"
10161
+ };
10162
+ if (tf.nullable) return {
10163
+ ok: true,
10164
+ unavailable: "null"
10165
+ };
10166
+ if (tf.enumValues?.includes("unknown") === true) return {
10167
+ ok: true,
10168
+ unavailable: "unknown"
10169
+ };
10170
+ return {
10171
+ ok: false,
10172
+ 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)`)
10173
+ };
10174
+ }
10175
+ //#endregion
10176
+ //#region src/composition/composition-items.ts
10177
+ /** Item fields the composer writes itself, with the value it writes. */
10178
+ var COMPOSED_ITEM_FIXED_FIELDS = { resettable: false };
10179
+ function reservedItemFields(itemArray) {
10180
+ return new Set([
10181
+ itemArray.keyField,
10182
+ ...itemArray.labelField === void 0 ? [] : [itemArray.labelField],
10183
+ ...Object.keys(COMPOSED_ITEM_FIXED_FIELDS)
10184
+ ]);
10185
+ }
10186
+ /** A required leaf under an optional parent is required only once something writes that parent. */
10187
+ function leafRequired(itemArray, path, written) {
10188
+ const described = describeStateField(itemArray.itemSchema, path);
10189
+ if (described === null || !described.required) return false;
10190
+ return optionalAncestors(itemArray.itemSchema, path).every((parent) => written.some((w) => w.startsWith(`${parent}.`)));
10191
+ }
10192
+ function missingLeaves({ capName, itemArray, reserved }, item, at) {
10193
+ const written = Object.keys(item.fields);
10194
+ return enumerateSchemaFields(itemArray.itemSchema).flatMap((leaf) => {
10195
+ if (reserved.has(leaf.path) || leaf.path in item.fields) return [];
10196
+ if (!leafRequired(itemArray, leaf.path, written)) return [];
10197
+ const described = describeStateField(itemArray.itemSchema, leaf.path);
10198
+ if (described === null || described.nullable) return [];
10199
+ return [problem("missing-field", `${at}.fields.${leaf.path}`, `\`${capName}.${itemArray.path}[].${leaf.path}\` is required and has no source`)];
10200
+ });
10201
+ }
10202
+ function planItemField(ctx, leaf) {
10203
+ const { capName, itemArray, featureIndex, lookupCap } = ctx;
10204
+ const { key, label, path, source } = leaf;
10205
+ const at = `features[${featureIndex}].items.${key}.fields.${path}`;
10206
+ 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`));
10207
+ const tf = describeStateField(itemArray.itemSchema, path);
10208
+ if (tf === null) return refused(problem("unknown-field", at, `a \`${capName}\` item has no field \`${path}\``));
10209
+ const kinds = sourceKinds(source, lookupCap);
10210
+ if (!kinds.ok) return refused(problem(kinds.code, at, kinds.message));
10211
+ const role = roleOf(source);
10212
+ const unavailable = unavailableFor(tf, role, ctx.mode, capName, at);
10213
+ if (!unavailable.ok) return refused(unavailable.problem);
10214
+ const plan = {
10215
+ cap: capName,
10216
+ path,
10217
+ item: {
10218
+ arrayPath: itemArray.path,
10219
+ key,
10220
+ label
10221
+ },
10222
+ featureIndex,
10223
+ kind: tf.kind,
10224
+ nullable: tf.nullable,
10225
+ required: tf.required,
10226
+ unavailable: unavailable.unavailable,
10227
+ role,
10228
+ source,
10229
+ reads: [...fieldReads(source)]
10230
+ };
10231
+ const enumProblem = enumLiteralProblem(capName, tf, source, at);
10232
+ return {
10233
+ problems: [...compatibility(capName, tf, kinds.kinds, at), ...enumProblem === null ? [] : [enumProblem]],
10234
+ fields: [plan],
10235
+ features: [],
10236
+ events: []
10237
+ };
10238
+ }
10239
+ function planItems(def, feature, featureIndex, lookupCap, mode = "new") {
10240
+ const at = `features[${featureIndex}].items`;
10241
+ const itemArray = def.status?.itemArray;
10242
+ if (itemArray === void 0) return refused(problem("not-item-array", at, `\`${def.name}\` has no item array — it takes no \`items\``));
10243
+ 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`));
10244
+ const ctx = {
10245
+ capName: def.name,
10246
+ itemArray,
10247
+ reserved: reservedItemFields(itemArray),
10248
+ featureIndex,
10249
+ lookupCap,
10250
+ mode
10251
+ };
10252
+ const results = Object.entries(feature.items ?? {}).flatMap(([key, item]) => [{
10253
+ problems: missingLeaves(ctx, item, `${at}.${key}`),
10254
+ fields: [],
10255
+ features: [],
10256
+ events: []
10257
+ }, ...Object.entries(item.fields).map(([path, source]) => planItemField(ctx, {
10258
+ key,
10259
+ label: item.label,
10260
+ path,
10261
+ source
10262
+ }))]);
10263
+ return {
10264
+ problems: results.flatMap((r) => r.problems),
10265
+ fields: results.flatMap((r) => r.fields),
10266
+ features: [],
10267
+ events: []
10268
+ };
10269
+ }
10270
+ //#endregion
10271
+ //#region src/composition/composition-graph.ts
10272
+ /**
10273
+ * The field graph across every composition, and the cycles in it (D659).
10274
+ *
10275
+ * A node is ONE field of ONE device (`<addon>/<stableId>#<cap>.<field>`); an
10276
+ * edge points from a composed field to each field it reads. A cycle, direct or
10277
+ * through another composition, is refused at save by name (spec §2).
10278
+ *
10279
+ * The graph is built for ONE save: the CANDIDATE composition (the one being
10280
+ * validated) plus every STORED composition. The candidate replaces its own old
10281
+ * version, identified BY BLOCK ID wherever it sits in `stored` — whether a save
10282
+ * introduces or removes a cycle must never depend on array order. A DIFFERENT
10283
+ * block targeting the candidate's device is refused by name: one composition
10284
+ * per device (D663). Two different stored peers that (wrongly) target the same
10285
+ * device are corrupted state, not a cycle to resolve by picking one silently;
10286
+ * that is refused by name too (D391).
10287
+ *
10288
+ * A customization of an EXISTING device reads that device's NATIVE value for a
10289
+ * field it replaces or does not write ("Invert state" reads the `on` it
10290
+ * replaces): such a self-read is no edge, so it is never a cycle (D663).
10291
+ * Another composition reading that field reads the customizer's output.
10292
+ *
10293
+ * `findCompositionCycles` reports at least one cycle per cycle-SET (the DFS
10294
+ * marks a node `done` after its first expansion) — not every elementary cycle
10295
+ * through a shared node, so the path it names may AVOID the candidate while
10296
+ * one through it goes unreported. What a save refuses is therefore decided per
10297
+ * strongly connected component (`findCandidateCycles`, C-1). A dotted
10298
+ * `fieldPath` is matched only as an exact string: a write to `state.value` and
10299
+ * a read of `state` would not connect (no nested field writes exist yet).
10300
+ *
10301
+ * An item leaf is its own node, `…#consumables.items[desiccant].status`
10302
+ * (`featureFieldEntries`), so two items sharing an inner path never merge. No
10303
+ * READ can name an array element (`describeStateField` never describes one),
10304
+ * so an item node is write-only: its edges to sources are what the check needs.
10305
+ */
10306
+ /** Two blocks' compositions target the same device — refused by name, never silently resolved. */
10307
+ var CompositionGraphError = class extends Error {};
10308
+ /** `"cap.field"` of every field a peer writes — the same spelling as `compositionFieldKey`. */
10309
+ function writtenFields(peer) {
10310
+ return new Set(peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath }) => `${feature.cap}.${fieldPath}`)));
10311
+ }
10312
+ /** A read of the peer's OWN device is an edge only when it reads the peer's own output (rule 5, D663). */
10313
+ function readsComposedValue(peer, written, read) {
10314
+ if (compositionSourceKey(read.source) !== compositionSourceKey(peer.target)) return true;
10315
+ const field = `${read.cap}.${read.fieldPath}`;
10316
+ return written.has(field) && peer.replaced?.has(field) !== true;
10317
+ }
10318
+ function peerEdges(peer) {
10319
+ const written = writtenFields(peer);
10320
+ return peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath, source }) => [compositionReadKey({
10321
+ source: peer.target,
10322
+ cap: feature.cap,
10323
+ fieldPath
10324
+ }), fieldReads(source).filter((read) => readsComposedValue(peer, written, read)).map(compositionReadKey)]));
10325
+ }
10326
+ /**
10327
+ * Every peer that actually takes part in the graph: each stored peer minus the
10328
+ * candidate's own old version (same block id — the drop happens before any
10329
+ * edge is built, so its old edges never enter the map), plus the candidate
10330
+ * itself, exactly once. Throws {@link CompositionGraphError} when a DIFFERENT
10331
+ * block targets the candidate's device, or two stored peers share a device.
10332
+ */
10333
+ function resolvedPeers(candidate, stored) {
10334
+ const candidateKey = compositionSourceKey(candidate.target);
10335
+ const survivors = /* @__PURE__ */ new Map();
10336
+ for (const peer of stored) {
10337
+ if (peer.blockId === candidate.blockId) continue;
10338
+ const key = compositionSourceKey(peer.target);
10339
+ 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`);
10340
+ const clash = survivors.get(key);
10341
+ if (clash !== void 0) throw new CompositionGraphError(`two stored compositions (\`${clash.blockId}\`, \`${peer.blockId}\`) both target device \`${key}\` — refusing to build the field graph`);
10342
+ survivors.set(key, peer);
10343
+ }
10344
+ return [...survivors.values(), candidate];
10345
+ }
10346
+ function compositionEdges(candidate, stored) {
10347
+ const edges = resolvedPeers(candidate, stored).flatMap(peerEdges);
10348
+ return new Map(edges);
10349
+ }
10350
+ function findCompositionCycles(candidate, stored) {
10351
+ const edges = compositionEdges(candidate, stored);
10352
+ const marks = /* @__PURE__ */ new Map();
10353
+ const found = /* @__PURE__ */ new Map();
10354
+ const visit = (node, stack) => {
10355
+ const mark = marks.get(node);
10356
+ if (mark === "done") return;
10357
+ if (mark === "visiting") {
10358
+ const path = [...stack.slice(stack.indexOf(node)), node];
10359
+ const id = [...new Set(path)].toSorted().join("|");
10360
+ if (!found.has(id)) found.set(id, { path });
10361
+ return;
10362
+ }
10363
+ marks.set(node, "visiting");
10364
+ for (const next of edges.get(node) ?? []) visit(next, [...stack, node]);
10365
+ marks.set(node, "done");
10366
+ };
10367
+ for (const node of edges.keys()) visit(node, []);
10368
+ return [...found.values()];
10369
+ }
10370
+ /** Tarjan's strongly connected components over every node of the graph (sources included). */
10371
+ function stronglyConnected(edges) {
10372
+ const index = /* @__PURE__ */ new Map();
10373
+ const low = /* @__PURE__ */ new Map();
10374
+ const onStack = /* @__PURE__ */ new Set();
10375
+ const stack = [];
10376
+ const components = [];
10377
+ const connect = (node) => {
10378
+ index.set(node, index.size);
10379
+ low.set(node, index.get(node) ?? 0);
10380
+ stack.push(node);
10381
+ onStack.add(node);
10382
+ for (const next of edges.get(node) ?? []) if (!index.has(next)) {
10383
+ connect(next);
10384
+ low.set(node, Math.min(low.get(node) ?? 0, low.get(next) ?? 0));
10385
+ } else if (onStack.has(next)) low.set(node, Math.min(low.get(node) ?? 0, index.get(next) ?? 0));
10386
+ if (low.get(node) !== index.get(node)) return;
10387
+ const component = [];
10388
+ for (let member = stack.pop(); member !== void 0; member = stack.pop()) {
10389
+ onStack.delete(member);
10390
+ component.push(member);
10391
+ if (member === node) break;
10392
+ }
10393
+ components.push(component);
10394
+ };
10395
+ for (const node of edges.keys()) if (!index.has(node)) connect(node);
10396
+ return components;
10397
+ }
10398
+ /** The shortest walk from `start` back to itself inside `component` (one exists: the component has a cycle). */
10399
+ function cycleThrough(start, component, edges) {
10400
+ const parent = /* @__PURE__ */ new Map();
10401
+ const queue = [start];
10402
+ for (let head = 0; head < queue.length; head += 1) {
10403
+ const node = queue[head];
10404
+ if (node === void 0) break;
10405
+ for (const next of edges.get(node) ?? []) {
10406
+ if (next === start) {
10407
+ const chain = [];
10408
+ for (let at = node; at !== void 0 && at !== start; at = parent.get(at)) chain.push(at);
10409
+ return [
10410
+ start,
10411
+ ...chain.reverse(),
10412
+ start
10413
+ ];
10414
+ }
10415
+ if (!component.has(next) || parent.has(next)) continue;
10416
+ parent.set(next, node);
10417
+ queue.push(next);
10418
+ }
10419
+ }
10420
+ return [start, start];
10421
+ }
10422
+ /**
10423
+ * The cycles THIS save closes, decided per strongly connected component — never
10424
+ * per reported DFS path, which names one back-edge per revisit and can report a
10425
+ * component's cycle by a path that avoids the candidate while the one through it
10426
+ * goes unreported. A component refuses when it holds a candidate node and a
10427
+ * cycle (more than one node, or a self-loop). Components without a candidate
10428
+ * node are not this save's cycles.
10429
+ */
10430
+ function findCandidateCycles(candidate, stored) {
10431
+ const edges = compositionEdges(candidate, stored);
10432
+ const prefix = `${compositionSourceKey(candidate.target)}#`;
10433
+ return stronglyConnected(edges).flatMap((members) => {
10434
+ const start = members.find((n) => n.startsWith(prefix));
10435
+ if (start === void 0) return [];
10436
+ const component = new Set(members);
10437
+ const selfLoop = members.length === 1 && (edges.get(start) ?? []).includes(start);
10438
+ if (members.length === 1 && !selfLoop) return [];
10439
+ return [{
10440
+ path: cycleThrough(start, component, edges),
10441
+ component
10442
+ }];
10443
+ });
10444
+ }
10445
+ //#endregion
10446
+ //#region src/composition/validate-composition.ts
10447
+ function buildCapabilityLookup(defs) {
10448
+ const byName = new Map(defs.map((d) => [d.name, d]));
10449
+ return (capName) => byName.get(capName) ?? null;
10450
+ }
10451
+ /** Caps every `BaseDevice` registers on itself; a second registration throws. */
10452
+ var BASE_DEVICE_CAPS = new Set(["device-status", "feature-probe"]);
10453
+ var PENDING_SELF = {
10454
+ addonId: COMPOSER_ADDON_ID,
10455
+ stableId: `${COMPOSED_DEVICE_STABLE_ID_PREFIX}(unsaved)`
10456
+ };
10457
+ /** The candidate's block id before its first save. Stored block ids are `randomUUID()`, so none can carry it. */
10458
+ var PENDING_BLOCK_ID = "(unsaved)";
10459
+ function composableCap(feature, at, lookupCap) {
10460
+ const def = lookupCap(feature.cap);
10461
+ if (def === null) return problem("unknown-capability", `${at}.cap`, `no capability is named \`${feature.cap}\``);
10462
+ 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`);
10463
+ const state = def.runtimeState;
10464
+ if (def.scope !== "device" || state === void 0) return problem("not-composable", `${at}.cap`, `\`${def.name}\` has no per-device state to compose`);
10465
+ return {
10466
+ def,
10467
+ state,
10468
+ fields: describeTopLevelStateFields(state)
10469
+ };
10470
+ }
10471
+ /**
10472
+ * A capability BUILT by the composition (a new device, or one ADDED to an
10473
+ * existing device) must fit the device type, serve no command, and have every
10474
+ * required field. A REPLACE needs none of it: the cap is bound (a fact), the
10475
+ * native keeps serving its methods, and only the named fields are owned (D663).
10476
+ */
10477
+ function builtCapProblems({ def, state, fields: targetFields }, feature, at, deviceType) {
10478
+ const problems = [];
10479
+ 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(", ")})`));
10480
+ const served = Object.entries(def.methods).filter(([name, m]) => m.systemOnly !== true && def.composedMethods?.[name] === void 0).map(([name]) => `\`${name}\``);
10481
+ 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)`));
10482
+ const itemArrayPath = feature.items === void 0 ? null : def.status?.itemArray?.path ?? null;
10483
+ for (const key of requiredTopLevelKeys(state)) {
10484
+ if (key === itemArrayPath) continue;
10485
+ 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`));
10486
+ else if (!(key in feature.fields)) problems.push(problem("missing-field", `${at}.fields.${key}`, `\`${def.name}.${key}\` is required and has no source`));
10487
+ }
10488
+ return problems;
10489
+ }
10490
+ function planTopLevelField({ def, fields }, field, mode, lookupCap) {
10491
+ const { featureIndex, path, source } = field;
10492
+ const fieldAt = `features[${featureIndex}].fields.${path}`;
10493
+ if (path.includes(".")) return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — nested fields arrive in a later slice`));
10494
+ const tf = fields.get(path);
10495
+ if (tf === void 0) return refused(problem("unknown-field", fieldAt, `\`${def.name}\` has no field \`${path}\``));
10496
+ const kinds = sourceKinds(source, lookupCap);
10497
+ if (!kinds.ok) return refused(problem(kinds.code, fieldAt, kinds.message));
10498
+ const role = roleOf(source);
10499
+ const unavailable = unavailableFor(tf, role, mode, def.name, fieldAt);
10500
+ if (!unavailable.ok) return refused(unavailable.problem);
10501
+ const plan = {
10502
+ cap: def.name,
10503
+ path,
10504
+ featureIndex,
10505
+ kind: tf.kind,
10506
+ nullable: tf.nullable,
10507
+ required: tf.required,
10508
+ unavailable: unavailable.unavailable,
10509
+ role,
10510
+ source,
10511
+ reads: [...fieldReads(source)]
10512
+ };
10513
+ const enumProblem = enumLiteralProblem(def.name, tf, source, fieldAt);
10514
+ return {
10515
+ problems: [...compatibility(def.name, tf, kinds.kinds, fieldAt), ...enumProblem === null ? [] : [enumProblem]],
10516
+ fields: [plan],
10517
+ features: [],
10518
+ events: []
10519
+ };
10520
+ }
10521
+ function planFeature(feature, featureIndex, target, lookupCap) {
10522
+ const at = `features[${featureIndex}]`;
10523
+ const cap = composableCap(feature, at, lookupCap);
10524
+ if ("code" in cap) return refused(cap);
10525
+ const capProblems = target.mode === "replace" ? [] : [...builtCapProblems(cap, feature, at, target.deviceType)];
10526
+ if (feature.commands !== void 0 && Object.keys(feature.commands).length > 0) capProblems.push(problem("reserved-variant", `${at}.commands`, "commands (`forward`) arrive in slice 3"));
10527
+ const perField = Object.entries(feature.fields).map(([path, source]) => planTopLevelField(cap, {
10528
+ featureIndex,
10529
+ path,
10530
+ source
10531
+ }, target.mode, lookupCap));
10532
+ const items = feature.items === void 0 ? [] : [planItems(cap.def, feature, featureIndex, lookupCap, target.mode)];
10533
+ const all = [...perField, ...items];
10534
+ const fields = all.flatMap((result) => result.fields);
10535
+ const featurePlan = {
10536
+ featureIndex,
10537
+ cap: cap.def.name,
10538
+ mode: target.mode
10539
+ };
10540
+ const eventPlan = planCompositionEvents(cap.def, featurePlan, fields);
10541
+ return {
10542
+ problems: [
10543
+ ...capProblems,
10544
+ ...all.flatMap((r) => r.problems),
10545
+ ...eventPlan.problems
10546
+ ],
10547
+ fields,
10548
+ features: [featurePlan],
10549
+ events: eventPlan.events
10550
+ };
10551
+ }
10552
+ /** A cap the device serves itself; one the composer grafted (an earlier ADD) is not native. */
10553
+ function isNativeCap(target, cap) {
10554
+ const owner = target.nativeCaps.get(cap);
10555
+ return owner !== void 0 && owner !== "composer";
10556
+ }
10557
+ /** The target read, or the refusal that replaces the whole plan when it could not be (D391). */
10558
+ function planTargetOf(composition, target) {
10559
+ if (composition.target.kind === "new") return {
10560
+ kind: "new",
10561
+ type: composition.target.type
10562
+ };
10563
+ const key = compositionSourceKey(composition.target.device);
10564
+ if (target === void 0) return problem("target-unreadable", "target", `target device \`${key}\` was not read — the save is refused rather than stored unchecked`);
10565
+ if (target.kind === "absent") return problem("target-missing", "target", `target device \`${key}\` does not exist`);
10566
+ 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`);
10567
+ return {
10568
+ kind: "existing",
10569
+ found: target
10570
+ };
10571
+ }
10572
+ function featureTargetOf(target, cap) {
10573
+ if (target.kind === "new") return {
10574
+ mode: "new",
10575
+ deviceType: target.type
10576
+ };
10577
+ return {
10578
+ mode: isNativeCap(target.found, cap) ? "replace" : "add",
10579
+ deviceType: target.found.type
10580
+ };
10581
+ }
10582
+ /**
10583
+ * The static plan. `target` describes an EXISTING target device (one read);
10584
+ * it is ignored for a new one. On an existing target each feature REPLACES a
10585
+ * cap the device has natively, else ADDS it (D663).
10586
+ */
10587
+ function planComposition(composition, lookupCap, target) {
10588
+ const planTarget = planTargetOf(composition, target);
10589
+ if ("code" in planTarget) return refused(planTarget);
10590
+ const results = composition.features.map((feature, index) => {
10591
+ 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);
10592
+ return compositionFeatureEnabled(feature) ? result : {
10593
+ problems: result.problems,
10594
+ fields: [],
10595
+ features: [],
10596
+ events: []
10597
+ };
10598
+ });
10599
+ return {
10600
+ problems: results.flatMap((r) => r.problems),
10601
+ fields: results.flatMap((r) => r.fields),
10602
+ features: results.flatMap((r) => r.features),
10603
+ events: results.flatMap((r) => r.events)
10604
+ };
10605
+ }
10606
+ function compositionSourceRefs(composition) {
10607
+ const refs = composition.features.flatMap((f) => compositionFeatureEnabled(f) && f.kind === "fields" ? featureSources(f).flatMap(fieldReads).map((r) => r.source) : []);
10608
+ return [...new Map(refs.map((r) => [compositionSourceKey(r), r])).values()];
10609
+ }
10610
+ /**
10611
+ * The candidate's device: the existing target itself, else `self`, else a
10612
+ * placeholder that cannot collide with a stored target. An existing target is
10613
+ * known even on create, so a second customization of it is refused on create too.
10614
+ */
10615
+ function candidateSelf(composition, ctx, plan) {
10616
+ return {
10617
+ ref: composition.target.kind === "existing" ? composition.target.device : ctx.self ?? PENDING_SELF,
10618
+ native: composition.target.kind === "existing" && ctx.target?.kind === "found" ? ctx.target : null,
10619
+ replaced: replacedFieldKeys(plan)
10620
+ };
10621
+ }
10622
+ /**
10623
+ * `compositionFieldKey` of every field a REPLACE feature of `plan` owns — the
10624
+ * candidate's own, and a stored peer's `CompositionPeer.replaced` (D663): one
10625
+ * derivation, so the graph reads both the same way.
10626
+ */
10627
+ function replacedFieldKeys(plan) {
10628
+ const replacing = new Set(plan.features.filter((f) => f.mode === "replace").map((f) => f.featureIndex));
10629
+ return new Set(plan.fields.filter((f) => replacing.has(f.featureIndex)).map(compositionFieldKey));
10630
+ }
10631
+ /**
10632
+ * A read of the candidate's own device. Its own composed output (a new device's
10633
+ * field, an ADDED field) is the slice-1 own-field rule; on an existing target
10634
+ * every other field — replaced, or not composed at all — is the NATIVE value,
10635
+ * valid when the device serves that cap natively (D663, rule 5).
10636
+ */
10637
+ function selfReadProblems(read, at, fields, self) {
10638
+ const readKey = `${read.cap}.${read.fieldPath}`;
10639
+ if (fields.some((f) => compositionFieldKey(f) === readKey && !self.replaced.has(readKey))) return [];
10640
+ if (self.native === null) return [problem("source-field-unknown", at, `this device has no composed field \`${read.cap}.${read.fieldPath}\``)];
10641
+ if (isNativeCap(self.native, read.cap)) return [];
10642
+ return [problem("source-capability-missing", at, `the target device (device ${self.native.deviceId}) has no native \`${read.cap}\``)];
10643
+ }
10644
+ function sourceProblems(fields, ctx, self) {
10645
+ const selfKey = compositionSourceKey(self.ref);
10646
+ return fields.flatMap((field) => field.reads.flatMap((read) => {
10647
+ const at = compositionFieldAt(field);
10648
+ const key = compositionSourceKey(read.source);
10649
+ if (key === selfKey) return selfReadProblems(read, at, fields, self);
10650
+ const desc = ctx.sources.get(key);
10651
+ 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`)];
10652
+ if (desc.kind === "absent") return [problem("source-missing", at, `source \`${key}\` does not exist`)];
10653
+ if (!desc.caps.has(read.cap)) return [problem("source-capability-missing", at, `source \`${key}\` (device ${desc.deviceId}) has no \`${read.cap}\``)];
10654
+ return [];
10655
+ }));
10656
+ }
10657
+ /**
10658
+ * A cycle's node keys are `compositionReadKey` strings:
10659
+ * `<addonId>/<stableId>#<cap>.<fieldPath>`. When a node belongs to the
10660
+ * CANDIDATE itself (this composition being saved), pull its `cap`/`fieldPath`
10661
+ * back out so the refusal can point at that exact field, matching the
10662
+ * documented `features[N].fields.<path>` convention. A cap name has no `.`,
10663
+ * so splitting `rest` on the FIRST `.` is exact; an item leaf's remainder
10664
+ * (`items[desiccant].status`) is matched through `compositionFieldKey`.
10665
+ */
10666
+ function candidateFieldOfNode(nodeKey, candidateKey) {
10667
+ const prefix = `${candidateKey}#`;
10668
+ if (!nodeKey.startsWith(prefix)) return null;
10669
+ const rest = nodeKey.slice(prefix.length);
10670
+ const dot = rest.indexOf(".");
10671
+ if (dot === -1) return null;
10672
+ return {
10673
+ cap: rest.slice(0, dot),
10674
+ fieldPath: rest.slice(dot + 1)
10675
+ };
10676
+ }
10677
+ /** The first node of a cycle's path that is one of THIS composition's own
10678
+ * planned fields, as a documented-convention path; `'features'` when the
10679
+ * cycle runs entirely through other stored compositions. */
10680
+ function cyclePath(nodePath, candidateKey, fields) {
10681
+ for (const nodeKey of nodePath) {
10682
+ const hit = candidateFieldOfNode(nodeKey, candidateKey);
10683
+ if (hit === null) continue;
10684
+ const hitKey = `${hit.cap}.${hit.fieldPath}`;
10685
+ const field = fields.find((f) => compositionFieldKey(f) === hitKey);
10686
+ if (field !== void 0) return compositionFieldAt(field);
10687
+ }
10688
+ return "features";
10689
+ }
10690
+ /** The first unread device any of `nodes` belongs to; null when none does. */
10691
+ function unreadDeviceOf(nodes, unread) {
10692
+ for (const [key, error] of unread) if (nodes.some((node) => node.startsWith(`${key}#`))) return {
10693
+ key,
10694
+ error
10695
+ };
10696
+ return null;
10697
+ }
10698
+ /**
10699
+ * Cycle check runs against the CANDIDATE (this composition, as block
10700
+ * `ctx.blockId`, writing `self.ref`) plus every OTHER stored composition,
10701
+ * decided per strongly connected component (`findCandidateCycles`): a cyclic
10702
+ * component holding a candidate node refuses, with one representative cycle
10703
+ * through it; one without is not this save's cycle. A
10704
+ * stored composition of the same block is its old version; another block on
10705
+ * the same device, or two stored peers sharing a device, make
10706
+ * `compositionEdges` throw `CompositionGraphError` — refused BY NAME as
10707
+ * `duplicate-target` (D391, D663) instead of escaping as an uncaught throw.
10708
+ */
10709
+ function cycleProblems(composition, ctx, fields, self) {
10710
+ const candidate = {
10711
+ blockId: ctx.blockId ?? "(unsaved)",
10712
+ target: self.ref,
10713
+ composition,
10714
+ replaced: self.replaced
10715
+ };
10716
+ const candidateKey = compositionSourceKey(candidate.target);
10717
+ const unread = ctx.unreadTargets ?? /* @__PURE__ */ new Map();
10718
+ try {
10719
+ return findCandidateCycles(candidate, ctx.peers).map((c) => {
10720
+ const at = cyclePath(c.path, candidateKey, fields);
10721
+ const through = unreadDeviceOf([...c.component], unread);
10722
+ 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(" → ")}`);
10723
+ });
10724
+ } catch (err) {
10725
+ if (err instanceof CompositionGraphError) return [problem("duplicate-target", "features", err.message)];
10726
+ throw err;
10727
+ }
10728
+ }
10729
+ function validateComposition(composition, ctx) {
10730
+ const plan = planComposition(composition, ctx.lookupCap, ctx.target ?? void 0);
10731
+ const self = candidateSelf(composition, ctx, plan);
10732
+ const cycles = cycleProblems(composition, ctx, plan.fields, self);
10733
+ const problems = [
10734
+ ...plan.problems,
10735
+ ...sourceProblems(plan.fields, ctx, self),
10736
+ ...cycles
10737
+ ];
10738
+ return {
10739
+ ok: problems.length === 0,
10740
+ problems,
10741
+ fields: [...plan.fields],
10742
+ features: [...plan.features],
10743
+ events: [...plan.events]
10744
+ };
10745
+ }
10746
+ //#endregion
10747
+ //#region src/composition/composable-caps.ts
10748
+ /**
10749
+ * What a composition may BUILD on a device type (G2, D676): the caps a new
10750
+ * device of that type, or an existing one that lacks them, can be given. The
10751
+ * blockers are the validator's own refusal codes, and a spec compares this
10752
+ * listing with `planComposition` for every capability — the editor can never
10753
+ * offer a feature the save would refuse for the same reason.
10754
+ */
10755
+ var ComposableFieldSchema = z.object({
10756
+ path: z.string(),
10757
+ kind: CompositionFieldKindSchema,
10758
+ nullable: z.boolean(),
10759
+ required: z.boolean(),
10760
+ enumValues: z.array(z.string()).optional()
10761
+ });
10762
+ var ComposableCapabilitySchema = z.object({
10763
+ cap: z.string(),
10764
+ fields: z.array(ComposableFieldSchema),
10765
+ /** Present for an item-array cap (`consumables.items`). */
10766
+ itemArray: z.object({
10767
+ path: z.string(),
10768
+ keyField: z.string()
10769
+ }).optional()
10770
+ });
10771
+ var ComposableCapabilitiesSchema = z.object({ caps: z.array(ComposableCapabilitySchema) });
10772
+ /** Why a cap cannot be BUILT (new device, or added to an existing one) on `deviceType`; [] = it can. */
10773
+ function builtCapabilityBlockers(def, deviceType) {
10774
+ if (BASE_DEVICE_CAPS.has(def.name)) return ["not-composable"];
10775
+ const state = def.runtimeState;
10776
+ if (def.scope !== "device" || state === void 0) return ["not-composable"];
10777
+ const blockers = [];
10778
+ if (def.deviceTypes !== void 0 && !def.deviceTypes.includes(deviceType)) blockers.push("wrong-device-type");
10779
+ if (Object.entries(def.methods).filter(([name, m]) => m.systemOnly !== true && def.composedMethods?.[name] === void 0).length > 0) blockers.push("has-commands");
10780
+ const fields = describeTopLevelStateFields(state);
10781
+ const itemArrayPath = def.status?.itemArray?.path ?? null;
10782
+ if (requiredTopLevelKeys(state).some((key) => key !== itemArrayPath && !fields.has(key))) blockers.push("not-composable");
10783
+ if (planCompositionEvents(def, {
10784
+ featureIndex: 0,
10785
+ cap: def.name,
10786
+ mode: "new"
10787
+ }, []).problems.some((p) => p.code === "not-composable") && !blockers.includes("not-composable")) blockers.push("not-composable");
10788
+ return blockers;
10789
+ }
10790
+ /** Every cap with no blocker, sorted by name. */
10791
+ function describeComposableCaps(defs, deviceType) {
10792
+ return defs.filter((def) => builtCapabilityBlockers(def, deviceType).length === 0).map((def) => {
10793
+ const state = def.runtimeState;
10794
+ const fields = state === void 0 ? [] : [...describeTopLevelStateFields(state).values()];
10795
+ const itemArray = def.status?.itemArray;
10796
+ return {
10797
+ cap: def.name,
10798
+ fields: fields.map((f) => ({
10799
+ path: f.path,
10800
+ kind: f.kind,
10801
+ nullable: f.nullable,
10802
+ required: f.required,
10803
+ ...f.enumValues === void 0 ? {} : { enumValues: [...f.enumValues] }
10804
+ })),
10805
+ ...itemArray === void 0 ? {} : { itemArray: {
10806
+ path: itemArray.path,
10807
+ keyField: itemArray.keyField
10808
+ } }
10809
+ };
10810
+ }).toSorted((a, b) => a.cap.localeCompare(b.cap));
10811
+ }
10812
+ //#endregion
10813
+ //#region src/capabilities/core-blocks.cap.ts
10814
+ /**
10815
+ * core-blocks — user-authored TypeScript, stored in the kernel and executed in
10816
+ * its own process.
10817
+ *
10818
+ * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
10819
+ *
10820
+ * The first use is **owning devices without being a device provider**: a block
10821
+ * declares devices under a system or custom integration and drives their state,
10822
+ * with the same `ctx` an addon gets. Automations come later; nothing here
10823
+ * models a trigger.
10824
+ *
10825
+ * **Stated plainly, because it does not change by being true:** a block has an
10826
+ * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
10827
+ * with no review step. What makes that survivable is not a sandbox, it is
10828
+ * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
10829
+ * so a block that throws or never returns is marked `failed` and visible
10830
+ * instead of taking the hub with it (D6). Every method here is admin-only, and
10831
+ * must stay so.
10832
+ */
10833
+ /**
10834
+ * Prefix for a block's generated addon id AND its runner id — one addon, one
10835
+ * process, so the two are the same string (D2).
10836
+ *
10837
+ * It lives on the CONTRACT rather than beside the code that materialises the
10838
+ * package, because it is not an implementation detail: the operator surface
10839
+ * reads a block's logs by asking `logs.query` for `addonId = core-block-<id>`,
10840
+ * with no cap and no store of its own. Two copies of this string is one copy
10841
+ * too many — a drift would show as a logs pane that is simply always empty.
10842
+ */
10843
+ var CORE_BLOCK_ADDON_PREFIX = "core-block-";
10844
+ /**
10845
+ * The builtin's own addon id — and, because of that, the OWNER of the
10846
+ * integration every block's devices hang from.
10847
+ *
10848
+ * A block cannot own one. Every integration read is gated on the installed-addon
10849
+ * set (`addon-registry.service.ts` → `createFilteredRegistry`) and a block's
10850
+ * `core-block-<uuid>` is never in it, so its `getIntegrationByAddonId` answers
10851
+ * null forever while the write succeeds — one invisible, undeletable row per
10852
+ * start. `core-blocks` IS installed, so it reconciles one shared integration and
10853
+ * a block names it by id (`DeclaredDevicesSpec.integrationId`), minting nothing.
10854
+ *
10855
+ * Exported from the contract, next to the runner prefix and for the same reason:
10856
+ * a block reads it as
10857
+ * `ctx.api.integrations.getByAddonId.query({ addonId: CORE_BLOCKS_ADDON_ID })`,
10858
+ * so a second copy of the string is a block that silently declares into nowhere.
10859
+ */
10860
+ var CORE_BLOCKS_ADDON_ID = "core-blocks";
10861
+ /** The addon/runner id a block's process runs under. */
10862
+ function coreBlockAddonId(blockId) {
10863
+ return `${CORE_BLOCK_ADDON_PREFIX}${blockId}`;
10864
+ }
10865
+ /** The block id behind a generated addon/runner id, or null when the id belongs
10866
+ * to something else. The inverse of {@link coreBlockAddonId}. */
10867
+ function coreBlockIdFromAddonId(addonId) {
10868
+ if (!addonId.startsWith("core-block-")) return null;
10869
+ const rest = addonId.slice(11);
10870
+ return rest.length > 0 ? rest : null;
10871
+ }
10872
+ /** Where a block runs. The operator chooses — a block driving a device on an
10873
+ * agent is the reason placement is not fixed to the hub. */
10874
+ var CoreBlockPlacementSchema = z.union([z.literal("hub"), z.string().min(1)]);
10875
+ /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
10876
+ * a failing block reads the same way a failing addon does. `degraded` is a
10877
+ * composition on an existing device with a field handed back to the native
10878
+ * provider while its source is unavailable (S1b, D663); the error names it. */
10879
+ var CoreBlockStatusSchema = z.enum([
10880
+ "stopped",
10881
+ "starting",
10882
+ "running",
10883
+ "degraded",
10884
+ "failed"
10885
+ ]);
10886
+ /** Client-authored fields. */
10887
+ var CoreBlockInputSchema = z.object({
10888
+ name: z.string().min(1).max(120),
10889
+ /** TypeScript source. Compiled server-side before it is ever stored — a
10890
+ * block that does not compile is a fork failure the operator would meet
10891
+ * minutes later, in a log, instead of in the editor. */
10892
+ code: z.string().max(2e5),
10893
+ enabled: z.boolean(),
10894
+ placement: CoreBlockPlacementSchema,
10895
+ /**
10896
+ * Integration the block's devices hang from. Absent = the system integration
10897
+ * blocks share. A block may declare its own instead.
10898
+ */
10899
+ integrationId: z.string().optional()
10900
+ });
10901
+ /**
10902
+ * What a block IS (D659). Absent means `code` — every row stored before this
10903
+ * union keeps working unchanged.
10904
+ * - `code`: the TypeScript in `code`, compiled and run in its own runner;
10905
+ * - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
10906
+ * - `composition`: declarative, run by the shared `composer`; `code` is `''`.
10907
+ */
10908
+ var CoreBlockSourceSchema = z.discriminatedUnion("kind", [
10909
+ z.object({ kind: z.literal("code") }),
10910
+ z.object({
10911
+ kind: z.literal("recipe"),
10912
+ recipe: AutomationRecipeSchema
10913
+ }),
10914
+ z.object({
10915
+ kind: z.literal("composition"),
10916
+ composition: CompositionSchema
10917
+ })
10918
+ ]);
10919
+ /**
10920
+ * The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7).
10921
+ *
10922
+ * `name`: REQUIRED for a `new` target — the block's name IS the device's name
10923
+ * (D659). ABSENT for an `existing` target — a customization has no name of its
10924
+ * own; the server derives one (`customizationBlockName`, D663) and refuses a
10925
+ * client-sent name by name.
10926
+ */
10927
+ var CompositionBlockInputSchema = z.object({
10928
+ name: z.string().min(1).max(120).optional(),
10929
+ enabled: z.boolean(),
10930
+ composition: CompositionSchema
10931
+ });
10932
+ /** A stored block. */
10933
+ var CoreBlockSchema = CoreBlockInputSchema.extend({
10934
+ id: z.string(),
10935
+ createdAt: z.number(),
10936
+ updatedAt: z.number(),
10937
+ /** Server-stamped author. */
10938
+ createdBy: z.string(),
10939
+ status: CoreBlockStatusSchema,
10940
+ /**
10941
+ * Why the block is not running, when it is not. The operator's ONLY window
10942
+ * into a block that failed at load — a block that is silently absent is the
10943
+ * failure mode this whole feature has to avoid.
10944
+ */
10945
+ lastError: z.string().optional(),
10946
+ /** Ms epoch of the last state change. */
10947
+ lastChangedAt: z.number(),
10948
+ /** What the block is. Absent means `code` (D659). */
10949
+ source: CoreBlockSourceSchema.optional()
10950
+ });
10951
+ function coreBlockSourceKind(block) {
10952
+ return block.source?.kind ?? "code";
10953
+ }
10954
+ function coreBlockComposition(block) {
10955
+ return block.source?.kind === "composition" ? block.source.composition : null;
10956
+ }
10957
+ /** What the composer said, or that it could not be asked. Unknown never looks like absent (D315). */
10958
+ var CompositionStateReadSchema = z.discriminatedUnion("kind", [z.object({
10959
+ kind: z.literal("answered"),
10960
+ state: CompositionBlockStateSchema.nullable()
10961
+ }), z.object({
10962
+ kind: z.literal("unreachable"),
10963
+ error: z.string()
10964
+ })]);
10965
+ /** A stored composition block and what the composer says about it. */
10966
+ var CompositionViewSchema = z.object({
10967
+ block: CoreBlockSchema,
10968
+ state: CompositionStateReadSchema
10969
+ });
10970
+ /**
10971
+ * A read of the stored compositions. `not-loaded` while the `core_blocks`
10972
+ * table has not been READ: an empty answer then would make "not yet known"
10973
+ * look like "none", and invite the operator to recreate what exists (D315).
10974
+ */
10975
+ var CompositionsNotLoadedSchema = z.object({
10976
+ state: z.literal("not-loaded"),
10977
+ reason: z.string()
10978
+ });
10979
+ var CompositionListReadSchema = z.discriminatedUnion("state", [z.object({
10980
+ state: z.literal("loaded"),
10981
+ views: z.array(CompositionViewSchema)
10982
+ }), CompositionsNotLoadedSchema]);
10983
+ var CompositionGetReadSchema = z.discriminatedUnion("state", [z.object({
10984
+ state: z.literal("loaded"),
10985
+ view: CompositionViewSchema.nullable()
10986
+ }), CompositionsNotLoadedSchema]);
10987
+ /** The customization of one existing device, found by its TARGET, or `not-loaded` (D315). */
10988
+ var CompositionCustomizationReadSchema = z.discriminatedUnion("state", [z.object({
10989
+ state: z.literal("loaded"),
10990
+ view: CompositionViewSchema.nullable()
10991
+ }), CompositionsNotLoadedSchema]);
10992
+ /** What a compile attempt produced. */
10993
+ var CoreBlockCompileResultSchema = z.object({
10994
+ ok: z.boolean(),
10995
+ /** Present when `ok` is false — the first error, in the author's words. */
10996
+ error: z.string().optional(),
10997
+ line: z.number().optional(),
10998
+ column: z.number().optional()
10999
+ });
11000
+ var coreBlocksCapability = {
11001
+ name: "core-blocks",
11002
+ scope: "system",
11003
+ mode: "singleton",
11004
+ methods: {
11005
+ list: method(z.object({}), z.object({ blocks: z.array(CoreBlockSchema) }), { auth: "admin" }),
11006
+ get: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }),
11007
+ /**
11008
+ * Create a block. The code is COMPILED first: storing source that does not
11009
+ * compile turns an editor error into a fork failure the operator meets
11010
+ * minutes later in a log.
11011
+ */
11012
+ create: method(z.object({ block: CoreBlockInputSchema }), z.object({ block: CoreBlockSchema }), {
11013
+ kind: "mutation",
11014
+ auth: "admin",
11015
+ caller: "required"
11016
+ }),
11017
+ update: method(z.object({
11018
+ blockId: z.string(),
11019
+ block: CoreBlockInputSchema.partial()
11020
+ }), z.object({ block: CoreBlockSchema }), {
11021
+ kind: "mutation",
11022
+ auth: "admin",
11023
+ caller: "required"
11024
+ }),
11025
+ delete: method(z.object({ blockId: z.string() }), z.object({ success: z.literal(true) }), {
11026
+ kind: "mutation",
11027
+ auth: "admin"
11028
+ }),
11029
+ setEnabled: method(z.object({
11030
+ blockId: z.string(),
11031
+ enabled: z.boolean()
11032
+ }), z.object({ block: CoreBlockSchema }), {
11033
+ kind: "mutation",
11034
+ auth: "admin"
11035
+ }),
11036
+ /**
11037
+ * Stop this block's runner and let the supervisor bring it back.
11038
+ *
11039
+ * **It stores nothing.** There is no "restart requested" flag and no second
11040
+ * lifecycle field: the supervisor already stops and respawns a runner when
11041
+ * the code hash changes, and this exposes that same path deliberately
11042
+ * (D62 — a switch writes the authority that already owned the function).
11043
+ * The next reconcile pass remains the authority, so a restart that lost a
11044
+ * race is corrected within one pass rather than leaving a stale flag behind.
11045
+ *
11046
+ * Refused for a DISABLED block: nothing would come back, and a button that
11047
+ * silently does nothing is worse than one that says why.
11048
+ */
11049
+ restart: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema }), {
11050
+ kind: "mutation",
11051
+ auth: "admin"
11052
+ }),
11053
+ /**
11054
+ * Type-check without saving — what the editor calls as the author types, so
11055
+ * the compiler's verdict is the same one the server will reach.
11056
+ */
11057
+ compile: method(z.object({ code: z.string() }), CoreBlockCompileResultSchema, {
10037
11058
  kind: "mutation",
10038
11059
  auth: "admin"
10039
11060
  }),
@@ -10086,6 +11107,14 @@ var coreBlocksCapability = {
10086
11107
  stableId: z.string().min(1)
10087
11108
  }), CompositionCustomizationReadSchema, { auth: "admin" }),
10088
11109
  /**
11110
+ * The capabilities a composition may BUILD on a device of `deviceType`
11111
+ * (a new device, or added to an existing one), with their fields — the
11112
+ * editor's feature list and the presets' availability (G2, D676). Built
11113
+ * from the validator's own blockers; a replace of a BOUND cap is not
11114
+ * listed here (the device's bindings say what it has).
11115
+ */
11116
+ listComposableCaps: method(z.object({ deviceType: z.enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }),
11117
+ /**
10089
11118
  * Validate without saving — the same verdict the save reaches. A mutation
10090
11119
  * for its body size; it writes nothing, so its access is `view`.
10091
11120
  */
@@ -23076,6 +24105,25 @@ var pipelineAnalyticsCapability = {
23076
24105
  */
23077
24106
  listArchivedDebugNotes: method(ArchivedDebugNoteQueryInputSchema, z.array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }),
23078
24107
  /**
24108
+ * Tracking-bench ground truth (D681): "this track and that one are the
24109
+ * same subject" / "different subjects". One row per unordered pair —
24110
+ * re-marking replaces it — and a mark that contradicts an existing chain
24111
+ * is REFUSED with the chain named. Writing a mark also sets `debug` on
24112
+ * both tracks. `protected`, matching `setTrackFlags`: marking is done from
24113
+ * the viewer's track detail by an authenticated non-admin session.
24114
+ */
24115
+ setTrackRelation: method(SetTrackRelationInputSchema, TrackRelationSchema, { kind: "mutation" }),
24116
+ /** Remove the mark between two tracks. */
24117
+ clearTrackRelation: method(ClearTrackRelationInputSchema, ClearTrackRelationResultSchema, { kind: "mutation" }),
24118
+ /**
24119
+ * A track that is not ONE subject: `mixed` (two subjects, optionally
24120
+ * switching at `switchAtMs`) or `not-a-subject`. `pure` clears the mark
24121
+ * and answers `{ purity: null }` (D681).
24122
+ */
24123
+ setTrackPurity: method(SetTrackPurityInputSchema, SetTrackPurityResultSchema, { kind: "mutation" }),
24124
+ /** A camera's marks, optionally one track's, windowed by track start. */
24125
+ listTrackRelations: method(ListTrackRelationsInputSchema, ListTrackRelationsResultSchema, { kind: "query" }),
24126
+ /**
23079
24127
  * Birth decisions — one row per resolved confirmation-gate verdict (D409).
23080
24128
  *
23081
24129
  * The READ half of a measurement, and only that: it gates nothing and no
@@ -26309,6 +27357,16 @@ var NodeInferenceDevicesSchema = z.object({
26309
27357
  * Strictly the control plane: never sees a frame, never calls inference,
26310
27358
  * never drains queues. The runner does that work locally on each agent.
26311
27359
  */
27360
+ /**
27361
+ * The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
27362
+ * camera's attached sensors (D672). `config: null` removes the attachment —
27363
+ * the camera reads `not-configured` again, never `unreadable`.
27364
+ */
27365
+ var SetCameraSensorsInputSchema = z.object({
27366
+ deviceId: z.number().int().nonnegative(),
27367
+ /** `null` removes the attachment: the camera goes back to `not-configured`. */
27368
+ config: CameraSensorsConfigSchema.nullable()
27369
+ });
26312
27370
  var pipelineOrchestratorCapability = {
26313
27371
  name: "pipeline-orchestrator",
26314
27372
  scope: "system",
@@ -26774,6 +27832,18 @@ var pipelineOrchestratorCapability = {
26774
27832
  */
26775
27833
  getCameraStatuses: method(z.object({ deviceIds: z.array(z.number()).optional() }), z.array(CameraStatusSchema).readonly()),
26776
27834
  /**
27835
+ * Attach sensors to a camera, or detach them with `config: null` (D672
27836
+ * configuration, G5/D676). Written to the orchestrator's per-device store
27837
+ * under the same key `applyDeviceSettingsPatch` writes, and announced as a
27838
+ * settings change so the camera-sensors bridge refreshes. Refused by name
27839
+ * — nothing written — for a device that cannot be read, does not exist,
27840
+ * is not a camera, or names itself as its own sensor.
27841
+ */
27842
+ setCameraSensors: method(SetCameraSensorsInputSchema, z.object({ success: z.literal(true) }), {
27843
+ kind: "mutation",
27844
+ auth: "admin"
27845
+ }),
27846
+ /**
26777
27847
  * Disk-wins fleet reconcile after a recordings wipe. Starts the walk in
26778
27848
  * the addon process and returns immediately with the job snapshot — the
26779
27849
  * work outlives the tRPC/UDS 60s timeout. Poll `getReconcileFromDiskStatus`.
@@ -44679,569 +45749,366 @@ function createDeviceExtensionProvider(options) {
44679
45749
  };
44680
45750
  }
44681
45751
  //#endregion
44682
- //#region src/composition/composition-graph.ts
44683
- /**
44684
- * The field graph across every composition, and the cycles in it (D659).
44685
- *
44686
- * A node is ONE field of ONE device (`<addon>/<stableId>#<cap>.<field>`); an
44687
- * edge points from a composed field to each field it reads. A cycle, direct or
44688
- * through another composition, is refused at save by name (spec §2).
44689
- *
44690
- * The graph is built for ONE save: the CANDIDATE composition (the one being
44691
- * validated) plus every STORED composition. The candidate replaces its own old
44692
- * version, identified BY BLOCK ID wherever it sits in `stored` — whether a save
44693
- * introduces or removes a cycle must never depend on array order. A DIFFERENT
44694
- * block targeting the candidate's device is refused by name: one composition
44695
- * per device (D663). Two different stored peers that (wrongly) target the same
44696
- * device are corrupted state, not a cycle to resolve by picking one silently;
44697
- * that is refused by name too (D391).
44698
- *
44699
- * A customization of an EXISTING device reads that device's NATIVE value for a
44700
- * field it replaces or does not write ("Invert state" reads the `on` it
44701
- * replaces): such a self-read is no edge, so it is never a cycle (D663).
44702
- * Another composition reading that field reads the customizer's output.
44703
- *
44704
- * `findCompositionCycles` reports at least one cycle per cycle-SET (the DFS
44705
- * marks a node `done` after its first expansion) — not every elementary cycle
44706
- * through a shared node, so the path it names may AVOID the candidate while
44707
- * one through it goes unreported. What a save refuses is therefore decided per
44708
- * strongly connected component (`findCandidateCycles`, C-1). A dotted
44709
- * `fieldPath` is matched only as an exact string: a write to `state.value` and
44710
- * a read of `state` would not connect (no nested field writes exist yet).
44711
- *
44712
- * An item leaf is its own node, `…#consumables.items[desiccant].status`
44713
- * (`featureFieldEntries`), so two items sharing an inner path never merge. No
44714
- * READ can name an array element (`describeStateField` never describes one),
44715
- * so an item node is write-only: its edges to sources are what the check needs.
44716
- */
44717
- /** Two blocks' compositions target the same device — refused by name, never silently resolved. */
44718
- var CompositionGraphError = class extends Error {};
44719
- /** `"cap.field"` of every field a peer writes — the same spelling as `compositionFieldKey`. */
44720
- function writtenFields(peer) {
44721
- return new Set(peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath }) => `${feature.cap}.${fieldPath}`)));
44722
- }
44723
- /** A read of the peer's OWN device is an edge only when it reads the peer's own output (rule 5, D663). */
44724
- function readsComposedValue(peer, written, read) {
44725
- if (compositionSourceKey(read.source) !== compositionSourceKey(peer.target)) return true;
44726
- const field = `${read.cap}.${read.fieldPath}`;
44727
- return written.has(field) && peer.replaced?.has(field) !== true;
44728
- }
44729
- function peerEdges(peer) {
44730
- const written = writtenFields(peer);
44731
- return peer.composition.features.flatMap((feature) => !compositionFeatureEnabled(feature) || feature.kind !== "fields" ? [] : featureFieldEntries(feature).map(({ fieldPath, source }) => [compositionReadKey({
44732
- source: peer.target,
44733
- cap: feature.cap,
44734
- fieldPath
44735
- }), fieldReads(source).filter((read) => readsComposedValue(peer, written, read)).map(compositionReadKey)]));
44736
- }
44737
- /**
44738
- * Every peer that actually takes part in the graph: each stored peer minus the
44739
- * candidate's own old version (same block id — the drop happens before any
44740
- * edge is built, so its old edges never enter the map), plus the candidate
44741
- * itself, exactly once. Throws {@link CompositionGraphError} when a DIFFERENT
44742
- * block targets the candidate's device, or two stored peers share a device.
44743
- */
44744
- function resolvedPeers(candidate, stored) {
44745
- const candidateKey = compositionSourceKey(candidate.target);
44746
- const survivors = /* @__PURE__ */ new Map();
44747
- for (const peer of stored) {
44748
- if (peer.blockId === candidate.blockId) continue;
44749
- const key = compositionSourceKey(peer.target);
44750
- 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`);
44751
- const clash = survivors.get(key);
44752
- if (clash !== void 0) throw new CompositionGraphError(`two stored compositions (\`${clash.blockId}\`, \`${peer.blockId}\`) both target device \`${key}\` — refusing to build the field graph`);
44753
- survivors.set(key, peer);
44754
- }
44755
- return [...survivors.values(), candidate];
44756
- }
44757
- function compositionEdges(candidate, stored) {
44758
- const edges = resolvedPeers(candidate, stored).flatMap(peerEdges);
44759
- return new Map(edges);
44760
- }
44761
- function findCompositionCycles(candidate, stored) {
44762
- const edges = compositionEdges(candidate, stored);
44763
- const marks = /* @__PURE__ */ new Map();
44764
- const found = /* @__PURE__ */ new Map();
44765
- const visit = (node, stack) => {
44766
- const mark = marks.get(node);
44767
- if (mark === "done") return;
44768
- if (mark === "visiting") {
44769
- const path = [...stack.slice(stack.indexOf(node)), node];
44770
- const id = [...new Set(path)].toSorted().join("|");
44771
- if (!found.has(id)) found.set(id, { path });
44772
- return;
44773
- }
44774
- marks.set(node, "visiting");
44775
- for (const next of edges.get(node) ?? []) visit(next, [...stack, node]);
44776
- marks.set(node, "done");
44777
- };
44778
- for (const node of edges.keys()) visit(node, []);
44779
- return [...found.values()];
44780
- }
44781
- /** Tarjan's strongly connected components over every node of the graph (sources included). */
44782
- function stronglyConnected(edges) {
44783
- const index = /* @__PURE__ */ new Map();
44784
- const low = /* @__PURE__ */ new Map();
44785
- const onStack = /* @__PURE__ */ new Set();
44786
- const stack = [];
44787
- const components = [];
44788
- const connect = (node) => {
44789
- index.set(node, index.size);
44790
- low.set(node, index.get(node) ?? 0);
44791
- stack.push(node);
44792
- onStack.add(node);
44793
- for (const next of edges.get(node) ?? []) if (!index.has(next)) {
44794
- connect(next);
44795
- low.set(node, Math.min(low.get(node) ?? 0, low.get(next) ?? 0));
44796
- } else if (onStack.has(next)) low.set(node, Math.min(low.get(node) ?? 0, index.get(next) ?? 0));
44797
- if (low.get(node) !== index.get(node)) return;
44798
- const component = [];
44799
- for (let member = stack.pop(); member !== void 0; member = stack.pop()) {
44800
- onStack.delete(member);
44801
- component.push(member);
44802
- if (member === node) break;
44803
- }
44804
- components.push(component);
44805
- };
44806
- for (const node of edges.keys()) if (!index.has(node)) connect(node);
44807
- return components;
44808
- }
44809
- /** The shortest walk from `start` back to itself inside `component` (one exists: the component has a cycle). */
44810
- function cycleThrough(start, component, edges) {
44811
- const parent = /* @__PURE__ */ new Map();
44812
- const queue = [start];
44813
- for (let head = 0; head < queue.length; head += 1) {
44814
- const node = queue[head];
44815
- if (node === void 0) break;
44816
- for (const next of edges.get(node) ?? []) {
44817
- if (next === start) {
44818
- const chain = [];
44819
- for (let at = node; at !== void 0 && at !== start; at = parent.get(at)) chain.push(at);
44820
- return [
44821
- start,
44822
- ...chain.reverse(),
44823
- start
44824
- ];
44825
- }
44826
- if (!component.has(next) || parent.has(next)) continue;
44827
- parent.set(next, node);
44828
- queue.push(next);
44829
- }
44830
- }
44831
- return [start, start];
44832
- }
45752
+ //#region src/units/unit-table.ts
44833
45753
  /**
44834
- * The cycles THIS save closes, decided per strongly connected component — never
44835
- * per reported DFS path, which names one back-edge per revisit and can report a
44836
- * component's cycle by a path that avoids the candidate while the one through it
44837
- * goes unreported. A component refuses when it holds a candidate node and a
44838
- * cycle (more than one node, or a self-loop). Components without a candidate
44839
- * node are not this save's cycles.
45754
+ * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
45755
+ * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
45756
+ * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
45757
+ * decimals). K derives from `°C = K − 273.15`.
44840
45758
  */
44841
- function findCandidateCycles(candidate, stored) {
44842
- const edges = compositionEdges(candidate, stored);
44843
- const prefix = `${compositionSourceKey(candidate.target)}#`;
44844
- return stronglyConnected(edges).flatMap((members) => {
44845
- const start = members.find((n) => n.startsWith(prefix));
44846
- if (start === void 0) return [];
44847
- const component = new Set(members);
44848
- const selfLoop = members.length === 1 && (edges.get(start) ?? []).includes(start);
44849
- if (members.length === 1 && !selfLoop) return [];
44850
- return [{
44851
- path: cycleThrough(start, component, edges),
44852
- component
44853
- }];
44854
- });
44855
- }
44856
- //#endregion
44857
- //#region src/composition/plan-result.ts
44858
- function problem(code, path, message) {
44859
- return {
44860
- code,
44861
- path,
44862
- message
44863
- };
44864
- }
44865
- function refused(...problems) {
44866
- return {
44867
- problems,
44868
- fields: [],
44869
- features: [],
44870
- events: []
44871
- };
44872
- }
44873
- /** Where a planned field sits in the composition: `features[N].fields.<path>` or `features[N].items.<key>.fields.<path>`. */
44874
- function compositionFieldAt(field) {
44875
- const inner = field.item === void 0 ? "fields" : `items.${field.item.key}.fields`;
44876
- return `features[${field.featureIndex}].${inner}.${field.path}`;
44877
- }
44878
- //#endregion
44879
- //#region src/composition/expression-kinds.ts
44880
- var NUMBER = {
44881
- kind: "fixed",
44882
- result: ["number"]
44883
- };
44884
- var BOOLEAN = {
44885
- kind: "fixed",
44886
- result: ["boolean"]
44887
- };
44888
- /** One rule per builtin. `expression-kinds.spec.ts` fails for a builtin missing here. */
44889
- var BUILTIN_RESULT_KINDS = Object.freeze({
44890
- min: NUMBER,
44891
- max: NUMBER,
44892
- abs: NUMBER,
44893
- floor: NUMBER,
44894
- ceil: NUMBER,
44895
- sqrt: NUMBER,
44896
- round: NUMBER,
44897
- pow: NUMBER,
44898
- clamp: NUMBER,
44899
- avg: NUMBER,
44900
- sum: NUMBER,
44901
- age: NUMBER,
44902
- convert: NUMBER,
44903
- coalesce: { kind: "coalesce" },
44904
- any: BOOLEAN,
44905
- all: BOOLEAN,
44906
- within: BOOLEAN,
44907
- latest: {
44908
- kind: "fixed",
44909
- result: ["number", "null"]
45759
+ var UNIT_TABLE = {
45760
+ "°C": {
45761
+ dimension: "temperature",
45762
+ factor: 1,
45763
+ offset: 0
45764
+ },
45765
+ "°F": {
45766
+ dimension: "temperature",
45767
+ factor: 5 / 9,
45768
+ offset: -160 / 9
45769
+ },
45770
+ K: {
45771
+ dimension: "temperature",
45772
+ factor: 1,
45773
+ offset: -273.15
45774
+ },
45775
+ hPa: {
45776
+ dimension: "pressure",
45777
+ factor: 1,
45778
+ offset: 0
45779
+ },
45780
+ kPa: {
45781
+ dimension: "pressure",
45782
+ factor: 10,
45783
+ offset: 0
45784
+ },
45785
+ Pa: {
45786
+ dimension: "pressure",
45787
+ factor: .01,
45788
+ offset: 0
45789
+ },
45790
+ mbar: {
45791
+ dimension: "pressure",
45792
+ factor: 1,
45793
+ offset: 0
45794
+ },
45795
+ bar: {
45796
+ dimension: "pressure",
45797
+ factor: 1e3,
45798
+ offset: 0
45799
+ },
45800
+ inHg: {
45801
+ dimension: "pressure",
45802
+ factor: 33.8639,
45803
+ offset: 0
45804
+ },
45805
+ mmHg: {
45806
+ dimension: "pressure",
45807
+ factor: 1.33322,
45808
+ offset: 0
45809
+ },
45810
+ psi: {
45811
+ dimension: "pressure",
45812
+ factor: 68.9476,
45813
+ offset: 0
45814
+ },
45815
+ "m/s": {
45816
+ dimension: "speed",
45817
+ factor: 1,
45818
+ offset: 0
45819
+ },
45820
+ "km/h": {
45821
+ dimension: "speed",
45822
+ factor: 1 / 3.6,
45823
+ offset: 0
45824
+ },
45825
+ mph: {
45826
+ dimension: "speed",
45827
+ factor: .44704,
45828
+ offset: 0
45829
+ },
45830
+ kn: {
45831
+ dimension: "speed",
45832
+ factor: .514444,
45833
+ offset: 0
45834
+ },
45835
+ "mm/h": {
45836
+ dimension: "precipitation-rate",
45837
+ factor: 1,
45838
+ offset: 0
45839
+ },
45840
+ "in/h": {
45841
+ dimension: "precipitation-rate",
45842
+ factor: 25.4,
45843
+ offset: 0
45844
+ },
45845
+ m: {
45846
+ dimension: "length",
45847
+ factor: 1,
45848
+ offset: 0
45849
+ },
45850
+ mm: {
45851
+ dimension: "length",
45852
+ factor: .001,
45853
+ offset: 0
45854
+ },
45855
+ cm: {
45856
+ dimension: "length",
45857
+ factor: .01,
45858
+ offset: 0
45859
+ },
45860
+ km: {
45861
+ dimension: "length",
45862
+ factor: 1e3,
45863
+ offset: 0
44910
45864
  },
44911
- number: {
44912
- kind: "fixed",
44913
- result: ["number", "null"]
45865
+ in: {
45866
+ dimension: "length",
45867
+ factor: .0254,
45868
+ offset: 0
44914
45869
  },
44915
- rose: {
44916
- kind: "fixed",
44917
- result: ["number", "null"]
45870
+ ft: {
45871
+ dimension: "length",
45872
+ factor: .3048,
45873
+ offset: 0
44918
45874
  },
44919
- count: NUMBER
44920
- });
44921
- var KindInferenceError = class extends Error {};
44922
- function kindOfValue(value) {
44923
- if (value === null) return "null";
44924
- if (typeof value === "number") return "number";
44925
- if (typeof value === "string") return "string";
44926
- return "boolean";
44927
- }
44928
- function only(kind) {
44929
- return new Set([kind]);
44930
- }
44931
- function union(...sets) {
44932
- return new Set(sets.flatMap((s) => [...s]));
44933
- }
44934
- function withoutNull(set) {
44935
- return new Set([...set].filter((k) => k !== "null"));
44936
- }
44937
- function binaryKinds(op, left, right) {
44938
- if (op === "+") {
44939
- const all = [...left, ...right];
44940
- if (all.every((k) => k === "string")) return only("string");
44941
- if (all.every((k) => k === "number")) return only("number");
44942
- return new Set(["number", "string"]);
45875
+ mi: {
45876
+ dimension: "length",
45877
+ factor: 1609.344,
45878
+ offset: 0
45879
+ },
45880
+ lx: {
45881
+ dimension: "illuminance",
45882
+ factor: 1,
45883
+ offset: 0
45884
+ },
45885
+ "W/m²": {
45886
+ dimension: "irradiance",
45887
+ factor: 1,
45888
+ offset: 0
45889
+ },
45890
+ W: {
45891
+ dimension: "power",
45892
+ factor: 1,
45893
+ offset: 0
45894
+ },
45895
+ kW: {
45896
+ dimension: "power",
45897
+ factor: 1e3,
45898
+ offset: 0
45899
+ },
45900
+ VA: {
45901
+ dimension: "apparent-power",
45902
+ factor: 1,
45903
+ offset: 0
45904
+ },
45905
+ Wh: {
45906
+ dimension: "energy",
45907
+ factor: 1,
45908
+ offset: 0
45909
+ },
45910
+ kWh: {
45911
+ dimension: "energy",
45912
+ factor: 1e3,
45913
+ offset: 0
45914
+ },
45915
+ MWh: {
45916
+ dimension: "energy",
45917
+ factor: 1e6,
45918
+ offset: 0
45919
+ },
45920
+ V: {
45921
+ dimension: "voltage",
45922
+ factor: 1,
45923
+ offset: 0
45924
+ },
45925
+ mV: {
45926
+ dimension: "voltage",
45927
+ factor: .001,
45928
+ offset: 0
45929
+ },
45930
+ A: {
45931
+ dimension: "current",
45932
+ factor: 1,
45933
+ offset: 0
45934
+ },
45935
+ mA: {
45936
+ dimension: "current",
45937
+ factor: .001,
45938
+ offset: 0
45939
+ },
45940
+ ppm: {
45941
+ dimension: "concentration-volume",
45942
+ factor: 1,
45943
+ offset: 0
45944
+ },
45945
+ ppb: {
45946
+ dimension: "concentration-volume",
45947
+ factor: .001,
45948
+ offset: 0
45949
+ },
45950
+ "µg/m³": {
45951
+ dimension: "concentration-mass",
45952
+ factor: 1,
45953
+ offset: 0
45954
+ },
45955
+ "mg/m³": {
45956
+ dimension: "concentration-mass",
45957
+ factor: 1e3,
45958
+ offset: 0
45959
+ },
45960
+ kg: {
45961
+ dimension: "mass",
45962
+ factor: 1,
45963
+ offset: 0
45964
+ },
45965
+ g: {
45966
+ dimension: "mass",
45967
+ factor: .001,
45968
+ offset: 0
45969
+ },
45970
+ lb: {
45971
+ dimension: "mass",
45972
+ factor: .453592,
45973
+ offset: 0
45974
+ },
45975
+ oz: {
45976
+ dimension: "mass",
45977
+ factor: .0283495,
45978
+ offset: 0
45979
+ },
45980
+ "%": {
45981
+ dimension: "percentage",
45982
+ factor: 1,
45983
+ offset: 0
44943
45984
  }
44944
- if (op === "-" || op === "*" || op === "/" || op === "%") return only("number");
44945
- return only("boolean");
44946
- }
44947
- /** "exactly N" / "at least N" / "N–M", for an arity refusal that says what IS allowed. */
44948
- function arityRange(builtin) {
44949
- if (builtin.minArgs === builtin.maxArgs) return `exactly ${builtin.minArgs}`;
44950
- if (builtin.maxArgs === Number.POSITIVE_INFINITY) return `at least ${builtin.minArgs}`;
44951
- return `${builtin.minArgs}–${builtin.maxArgs}`;
44952
- }
44953
- function callKinds(callee, args) {
44954
- const builtin = EXPRESSION_BUILTINS[callee];
44955
- 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)}`);
44956
- const rule = BUILTIN_RESULT_KINDS[callee];
44957
- if (rule === void 0) throw new KindInferenceError(`no result-kind rule for builtin '${callee}'`);
44958
- if (rule.kind === "fixed") return new Set(rule.result);
44959
- const nonNull = union(...args.map(withoutNull));
44960
- return args.every((a) => a.has("null")) ? union(nonNull, only("null")) : nonNull;
44961
- }
44962
- function kindsOf(node, bindings) {
44963
- switch (node.kind) {
44964
- case "literal": return only(kindOfValue(node.value));
44965
- case "identifier": {
44966
- if (node.name === "now") return only("number");
44967
- const bound = bindings.get(node.name);
44968
- if (bound === void 0) throw new KindInferenceError(`unbound identifier '${node.name}'`);
44969
- return bound;
44970
- }
44971
- case "unary": return only(node.op === "!" ? "boolean" : "number");
44972
- case "binary": return binaryKinds(node.op, kindsOf(node.left, bindings), kindsOf(node.right, bindings));
44973
- case "logical": return union(kindsOf(node.left, bindings), kindsOf(node.right, bindings));
44974
- case "conditional": return union(kindsOf(node.consequent, bindings), kindsOf(node.alternate, bindings));
44975
- case "call": return callKinds(node.callee, node.args.map((a) => kindsOf(a, bindings)));
45985
+ };
45986
+ //#endregion
45987
+ //#region src/units/convert.ts
45988
+ /**
45989
+ * Pure unit-conversion API over `UNIT_TABLE`. No dependencies, no side effects.
45990
+ *
45991
+ * Conversion is refused (throws `UnitConversionError`, or returns `undefined`
45992
+ * from the `try*` variant) whenever a unit is unknown or the two units belong
45993
+ * to different dimensions — cross-dimension conversion is deliberately
45994
+ * impossible so a render override can never make the value and its unit label
45995
+ * disagree.
45996
+ *
45997
+ * Callers pass units through `normalizeUnit` (`../device/source-info.ts`) BEFORE
45998
+ * calling here — the table keys only canonical spellings.
45999
+ */
46000
+ /** Thrown by `convertUnit` when a conversion is refused. Carries the offending
46001
+ * units + a machine-readable `reason` for callers that branch on the cause. */
46002
+ var UnitConversionError = class extends Error {
46003
+ from;
46004
+ to;
46005
+ reason;
46006
+ constructor(from, to, reason) {
46007
+ super(`[units] cannot convert '${from}' → '${to}': ${reason}`);
46008
+ this.name = "UnitConversionError";
46009
+ this.from = from;
46010
+ this.to = to;
46011
+ this.reason = reason;
44976
46012
  }
46013
+ };
46014
+ /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
46015
+ function specFor(unit) {
46016
+ return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
44977
46017
  }
44978
- function nodeContainsCall(node, callee) {
44979
- switch (node.kind) {
44980
- case "literal":
44981
- case "identifier": return false;
44982
- case "unary": return nodeContainsCall(node.operand, callee);
44983
- case "binary":
44984
- case "logical": return nodeContainsCall(node.left, callee) || nodeContainsCall(node.right, callee);
44985
- case "conditional": return nodeContainsCall(node.test, callee) || nodeContainsCall(node.consequent, callee) || nodeContainsCall(node.alternate, callee);
44986
- case "call": return node.callee === callee || node.args.some((arg) => nodeContainsCall(arg, callee));
44987
- }
46018
+ /** The dimension a unit belongs to, or `undefined` for an unknown unit. */
46019
+ function unitDimension(unit) {
46020
+ return specFor(unit)?.dimension;
44988
46021
  }
44989
- function expressionContainsBuiltinCall(expr, callee) {
44990
- const compiled = compileExpressionSafe(expr);
44991
- return compiled.ok && nodeContainsCall(compiled.parsed.ast, callee);
46022
+ /** Value in `spec`'s unit → its dimension's canonical unit. */
46023
+ function toCanonical(value, spec) {
46024
+ return value * spec.factor + spec.offset;
44992
46025
  }
44993
- function inferExpressionKinds(input) {
44994
- const compiled = compileExpressionSafe(input.expr);
44995
- if (!compiled.ok) return {
44996
- ok: false,
44997
- error: compiled.error
44998
- };
44999
- try {
45000
- return {
45001
- ok: true,
45002
- kinds: kindsOf(compiled.parsed.ast, input.bindingKinds)
45003
- };
45004
- } catch (err) {
45005
- if (err instanceof KindInferenceError) return {
45006
- ok: false,
45007
- error: err.message
45008
- };
45009
- throw err;
45010
- }
46026
+ /** Canonical-unit value → the unit described by `spec`. */
46027
+ function fromCanonical(canonical, spec) {
46028
+ return (canonical - spec.offset) / spec.factor;
45011
46029
  }
45012
- //#endregion
45013
- //#region src/composition/field-kinds.ts
45014
46030
  /**
45015
- * The kind half of planning a composition field (D659): which kinds a source
45016
- * can produce, whether they fit a target field, and the field's role.
45017
- * Shared by the top-level planner (`validate-composition.ts`) and the item
45018
- * planner (`composition-items.ts`). Internal to the composition module — NOT
45019
- * in the barrel: these are planner internals, not a published contract.
46031
+ * Convert `value` from unit `from` to unit `to`. Identity when `from === to`.
46032
+ * Throws `UnitConversionError` when either unit is unknown or the units belong
46033
+ * to different dimensions.
45020
46034
  */
45021
- function readKinds(read, lookupCap) {
45022
- const def = lookupCap(read.cap);
45023
- const schema = def?.runtimeState ?? def?.status?.schema;
45024
- if (def === null || schema === void 0) return {
45025
- ok: false,
45026
- code: "source-field-unknown",
45027
- message: `no capability \`${read.cap}\` with state to read`
45028
- };
45029
- const field = describeStateField(schema, read.fieldPath);
45030
- if (field === null) return {
45031
- ok: false,
45032
- code: "source-field-unknown",
45033
- message: `\`${read.cap}\` has no field \`${read.fieldPath}\``
45034
- };
45035
- const base = field.kind === "enum" ? "string" : field.kind;
45036
- return {
45037
- ok: true,
45038
- kinds: new Set(field.nullable ? [base, "null"] : [base])
45039
- };
45040
- }
45041
- function sourceKinds(source, lookupCap) {
45042
- if (source.kind === "from") return readKinds(source, lookupCap);
45043
- if (source.kind === "code") return {
45044
- ok: false,
45045
- code: "reserved-variant",
45046
- message: "code fields arrive in slice 4"
45047
- };
45048
- const bindingKinds = /* @__PURE__ */ new Map();
45049
- for (const [name, binding] of Object.entries(source.bindings)) {
45050
- if (binding.kind === "literal") {
45051
- bindingKinds.set(name, new Set([kindOfValue(binding.value)]));
45052
- continue;
45053
- }
45054
- const kinds = readKinds(binding, lookupCap);
45055
- if (!kinds.ok) return {
45056
- ...kinds,
45057
- message: `binding \`${name}\`: ${kinds.message}`
45058
- };
45059
- bindingKinds.set(name, kinds.kinds);
45060
- }
45061
- const inferred = inferExpressionKinds({
45062
- expr: source.expr,
45063
- bindingKinds
45064
- });
45065
- return inferred.ok ? {
45066
- ok: true,
45067
- kinds: inferred.kinds
45068
- } : {
45069
- ok: false,
45070
- code: "expression-invalid",
45071
- message: inferred.error
45072
- };
45073
- }
45074
- function compatibility(cap, target, kinds, at) {
45075
- const allowed = target.kind === "enum" ? "string" : target.kind;
45076
- const offending = [...kinds].filter((k) => k !== "null" && k !== allowed);
45077
- const problems = [];
45078
- if (offending.length > 0) problems.push(problem("kind-mismatch", at, `\`${cap}.${target.path}\` is a ${target.kind}; this source can produce ${offending.join(" or ")}`));
45079
- 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`));
45080
- return problems;
46035
+ function convertUnit(value, from, to) {
46036
+ if (from === to) return value;
46037
+ const fromSpec = specFor(from);
46038
+ if (!fromSpec) throw new UnitConversionError(from, to, "unknown-from");
46039
+ const toSpec = specFor(to);
46040
+ if (!toSpec) throw new UnitConversionError(from, to, "unknown-to");
46041
+ if (fromSpec.dimension !== toSpec.dimension) throw new UnitConversionError(from, to, "cross-dimension");
46042
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
45081
46043
  }
45082
46044
  /**
45083
- * A string a source produces WITHOUT reading any device — a field-level
45084
- * `expression` source whose compiled AST is a bare string literal (`"red"`,
45085
- * never `a` or `a + "x"`). Anything else that can only produce `'string'` at
45086
- * the kind level (a `from` read of an enum-typed source field, a computed
45087
- * expression) is NOT checked against the target's `enumValues` here: the
45088
- * kind inference already collapsed it to the coarse `'string'` kind, losing
45089
- * whichever enum it actually came from, so membership can only be judged at
45090
- * write time against the runtime-state schema. Known limitation — see the
45091
- * fix report for Task 6 round 1.
46045
+ * Graceful variant for the render path: returns the converted value, or
46046
+ * `undefined` when the conversion is refused (unknown unit / cross-dimension).
46047
+ * Never throws — a render caller falls back to the raw value + source unit.
45092
46048
  */
45093
- function literalStringValue(source) {
45094
- if (source.kind !== "expression") return null;
45095
- const compiled = compileExpressionSafe(source.expr);
45096
- if (!compiled.ok) return null;
45097
- const ast = compiled.parsed.ast;
45098
- return ast.kind === "literal" && typeof ast.value === "string" ? ast.value : null;
46049
+ function tryConvertUnit(value, from, to) {
46050
+ if (from === to) return value;
46051
+ const fromSpec = specFor(from);
46052
+ if (!fromSpec) return void 0;
46053
+ const toSpec = specFor(to);
46054
+ if (!toSpec) return void 0;
46055
+ if (fromSpec.dimension !== toSpec.dimension) return void 0;
46056
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
45099
46057
  }
45100
46058
  /**
45101
- * An enum target whose source is a save-time-KNOWN string literal outside its
45102
- * `enumValues` is refused now rather than left to fail the write later. A
45103
- * dynamic source (a `from` read, a non-literal expression) is left to
45104
- * runtime — see {@link literalStringValue}.
46059
+ * Whether `value` can be converted between `from` and `to` (same dimension,
46060
+ * both known). Cheap boolean probe for the UI's same-dimension unit picker and
46061
+ * the resolver's convertibility branch — compute ONCE so a unit label and its
46062
+ * value math can never disagree.
45105
46063
  */
45106
- function enumLiteralProblem(cap, target, source, at) {
45107
- if (target.kind !== "enum" || target.enumValues === void 0) return null;
45108
- const value = literalStringValue(source);
45109
- if (value === null || target.enumValues.includes(value)) return null;
45110
- const allowed = target.enumValues.map((v) => `\`${v}\``).join(", ");
45111
- return problem("kind-mismatch", at, `\`${cap}.${target.path}\` accepts only ${allowed}; this source is the literal \`${value}\``);
45112
- }
45113
- function roleOf(source) {
45114
- if (source.kind !== "expression") return "derived";
45115
- if (expressionContainsBuiltinCall(source.expr, "count")) return "accumulator";
45116
- if (fieldReads(source).length > 0) return "derived";
45117
- const compiled = compileExpressionSafe(source.expr);
45118
- return compiled.ok && compiled.parsed.identifiers.has("now") ? "clock" : "constant";
46064
+ function canConvertUnit(from, to) {
46065
+ if (from === to) return true;
46066
+ const fromDim = unitDimension(from);
46067
+ if (fromDim === void 0) return false;
46068
+ return fromDim === unitDimension(to);
45119
46069
  }
45120
46070
  /**
45121
- * How a planned field says "unavailable", per feature mode and AFTER `roleOf`
45122
- * (D393, D663 rulings S1 + S1b). The composer cannot take a device it does not
45123
- * own offline, and D393 forbids a stale number, so on an existing target a
45124
- * field that READS a source never gets `offline`.
46071
+ * Every known unit spelling in a dimension (table insertion order — canonical
46072
+ * unit first). Powers the UI's same-dimension unit picker.
45125
46073
  */
45126
- function unavailableFor(tf, role, mode, cap, at) {
45127
- if (mode === "replace" && (role === "derived" || role === "accumulator")) return {
45128
- ok: true,
45129
- unavailable: "release"
45130
- };
45131
- if (mode === "new" || role !== "derived") return {
45132
- ok: true,
45133
- unavailable: tf.nullable ? "null" : "offline"
45134
- };
45135
- if (tf.nullable) return {
45136
- ok: true,
45137
- unavailable: "null"
45138
- };
45139
- if (tf.enumValues?.includes("unknown") === true) return {
45140
- ok: true,
45141
- unavailable: "unknown"
45142
- };
45143
- return {
45144
- ok: false,
45145
- 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)`)
45146
- };
45147
- }
45148
- //#endregion
45149
- //#region src/composition/composition-items.ts
45150
- /** Item fields the composer writes itself, with the value it writes. */
45151
- var COMPOSED_ITEM_FIXED_FIELDS = { resettable: false };
45152
- function reservedItemFields(itemArray) {
45153
- return new Set([
45154
- itemArray.keyField,
45155
- ...itemArray.labelField === void 0 ? [] : [itemArray.labelField],
45156
- ...Object.keys(COMPOSED_ITEM_FIXED_FIELDS)
45157
- ]);
45158
- }
45159
- /** A required leaf under an optional parent is required only once something writes that parent. */
45160
- function leafRequired(itemArray, path, written) {
45161
- const described = describeStateField(itemArray.itemSchema, path);
45162
- if (described === null || !described.required) return false;
45163
- return optionalAncestors(itemArray.itemSchema, path).every((parent) => written.some((w) => w.startsWith(`${parent}.`)));
45164
- }
45165
- function missingLeaves({ capName, itemArray, reserved }, item, at) {
45166
- const written = Object.keys(item.fields);
45167
- return enumerateSchemaFields(itemArray.itemSchema).flatMap((leaf) => {
45168
- if (reserved.has(leaf.path) || leaf.path in item.fields) return [];
45169
- if (!leafRequired(itemArray, leaf.path, written)) return [];
45170
- const described = describeStateField(itemArray.itemSchema, leaf.path);
45171
- if (described === null || described.nullable) return [];
45172
- return [problem("missing-field", `${at}.fields.${leaf.path}`, `\`${capName}.${itemArray.path}[].${leaf.path}\` is required and has no source`)];
45173
- });
45174
- }
45175
- function planItemField(ctx, leaf) {
45176
- const { capName, itemArray, featureIndex, lookupCap } = ctx;
45177
- const { key, label, path, source } = leaf;
45178
- const at = `features[${featureIndex}].items.${key}.fields.${path}`;
45179
- 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`));
45180
- const tf = describeStateField(itemArray.itemSchema, path);
45181
- if (tf === null) return refused(problem("unknown-field", at, `a \`${capName}\` item has no field \`${path}\``));
45182
- const kinds = sourceKinds(source, lookupCap);
45183
- if (!kinds.ok) return refused(problem(kinds.code, at, kinds.message));
45184
- const role = roleOf(source);
45185
- const unavailable = unavailableFor(tf, role, ctx.mode, capName, at);
45186
- if (!unavailable.ok) return refused(unavailable.problem);
45187
- const plan = {
45188
- cap: capName,
45189
- path,
45190
- item: {
45191
- arrayPath: itemArray.path,
45192
- key,
45193
- label
45194
- },
45195
- featureIndex,
45196
- kind: tf.kind,
45197
- nullable: tf.nullable,
45198
- required: tf.required,
45199
- unavailable: unavailable.unavailable,
45200
- role,
45201
- source,
45202
- reads: [...fieldReads(source)]
45203
- };
45204
- const enumProblem = enumLiteralProblem(capName, tf, source, at);
45205
- return {
45206
- problems: [...compatibility(capName, tf, kinds.kinds, at), ...enumProblem === null ? [] : [enumProblem]],
45207
- fields: [plan],
45208
- features: [],
45209
- events: []
45210
- };
45211
- }
45212
- function planItems(def, feature, featureIndex, lookupCap, mode = "new") {
45213
- const at = `features[${featureIndex}].items`;
45214
- const itemArray = def.status?.itemArray;
45215
- if (itemArray === void 0) return refused(problem("not-item-array", at, `\`${def.name}\` has no item array — it takes no \`items\``));
45216
- 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`));
45217
- const ctx = {
45218
- capName: def.name,
45219
- itemArray,
45220
- reserved: reservedItemFields(itemArray),
45221
- featureIndex,
45222
- lookupCap,
45223
- mode
45224
- };
45225
- const results = Object.entries(feature.items ?? {}).flatMap(([key, item]) => [{
45226
- problems: missingLeaves(ctx, item, `${at}.${key}`),
45227
- fields: [],
45228
- features: [],
45229
- events: []
45230
- }, ...Object.entries(item.fields).map(([path, source]) => planItemField(ctx, {
45231
- key,
45232
- label: item.label,
45233
- path,
45234
- source
45235
- }))]);
45236
- return {
45237
- problems: results.flatMap((r) => r.problems),
45238
- fields: results.flatMap((r) => r.fields),
45239
- features: [],
45240
- events: []
45241
- };
46074
+ function unitsForDimension(dimension) {
46075
+ const out = [];
46076
+ for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
46077
+ return out;
45242
46078
  }
45243
46079
  //#endregion
45244
46080
  //#region src/composition/evaluate-field.ts
46081
+ /**
46082
+ * One composed field, evaluated from what its sources say NOW (D659).
46083
+ *
46084
+ * Pure. The composer calls it on every source change, and the slice-5 editor
46085
+ * will call it for its live preview, so both see the same answer.
46086
+ *
46087
+ * The rules (spec §2):
46088
+ * - a source that is offline or unreadable keeps its last value and is marked
46089
+ * STALE; the field is stale and keeps computing (D49);
46090
+ * - a source that is GONE makes the field UNAVAILABLE, `fatal`, and never a
46091
+ * plausible number (D393);
46092
+ * - a source that is unavailable but NOT gone (e.g. a cap unregistered at
46093
+ * runtime, R7b) makes the field UNAVAILABLE, non-fatal, `value: null`: it
46094
+ * may come back on its own, no block failure is raised for it;
46095
+ * - an expression that fails on a value makes the field unavailable for that
46096
+ * value, and NOT fatal: the next value may compute.
46097
+ *
46098
+ * `confirmed` (D663, D49): whether a NON-fatal unavailability is an ANSWER — a
46099
+ * cap the provider unregistered and a re-read agreed, a field the source
46100
+ * reported without, an expression that failed on a value — or only the
46101
+ * absence of one (a failed read, a first or empty read, a source not tracked
46102
+ * yet). Only a confirmed unavailability may hand a `release`-mode field back
46103
+ * to the native provider; an unconfirmed one holds it on its last value.
46104
+ * Absent means NOT confirmed. Fatal is always confirmed.
46105
+ *
46106
+ * When an expression has more than one unavailable binding, a FATAL one always
46107
+ * wins the outcome, regardless of position: every binding is scanned before
46108
+ * the field is judged, so an earlier non-fatal binding (e.g. a cap that is
46109
+ * momentarily unregistered) can never hide a later fatal one (a deleted
46110
+ * source) behind an early return.
46111
+ */
45245
46112
  function describeRead(read) {
45246
46113
  return `${compositionSourceKey(read.source)} ${read.cap}.${read.fieldPath}`;
45247
46114
  }
@@ -45308,7 +46175,10 @@ function expressionOutcome(source, read, now, stateful) {
45308
46175
  }
45309
46176
  const deadlines = [];
45310
46177
  const result = evaluateExpressionSource(source.expr, values, now, {
45311
- hooks: { noteDeadline: (at) => deadlines.push(at) },
46178
+ hooks: {
46179
+ noteDeadline: (at) => deadlines.push(at),
46180
+ convert: (value, from, to) => tryConvertUnit(value, normalizeUnit(from) ?? from, normalizeUnit(to) ?? to) ?? null
46181
+ },
45312
46182
  ...stateful === void 0 ? {} : { invokeStateful: (invocation) => evaluateStatefulExpressionCall(stateful.callPathPrefix === void 0 ? invocation : {
45313
46183
  ...invocation,
45314
46184
  path: `${stateful.callPathPrefix}@${invocation.path}`
@@ -45547,304 +46417,71 @@ function feederCustomizationExample(sources) {
45547
46417
  });
45548
46418
  }
45549
46419
  //#endregion
45550
- //#region src/composition/validate-composition.ts
45551
- function buildCapabilityLookup(defs) {
45552
- const byName = new Map(defs.map((d) => [d.name, d]));
45553
- return (capName) => byName.get(capName) ?? null;
45554
- }
45555
- /** Caps every `BaseDevice` registers on itself; a second registration throws. */
45556
- var BASE_DEVICE_CAPS = new Set(["device-status", "feature-probe"]);
45557
- var PENDING_SELF = {
45558
- addonId: COMPOSER_ADDON_ID,
45559
- stableId: `${COMPOSED_DEVICE_STABLE_ID_PREFIX}(unsaved)`
45560
- };
45561
- /** The candidate's block id before its first save. Stored block ids are `randomUUID()`, so none can carry it. */
45562
- var PENDING_BLOCK_ID = "(unsaved)";
45563
- function composableCap(feature, at, lookupCap) {
45564
- const def = lookupCap(feature.cap);
45565
- if (def === null) return problem("unknown-capability", `${at}.cap`, `no capability is named \`${feature.cap}\``);
45566
- 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`);
45567
- const state = def.runtimeState;
45568
- if (def.scope !== "device" || state === void 0) return problem("not-composable", `${at}.cap`, `\`${def.name}\` has no per-device state to compose`);
45569
- return {
45570
- def,
45571
- state,
45572
- fields: describeTopLevelStateFields(state)
45573
- };
45574
- }
45575
- /**
45576
- * A capability BUILT by the composition (a new device, or one ADDED to an
45577
- * existing device) must fit the device type, serve no command, and have every
45578
- * required field. A REPLACE needs none of it: the cap is bound (a fact), the
45579
- * native keeps serving its methods, and only the named fields are owned (D663).
45580
- */
45581
- function builtCapProblems({ def, state, fields: targetFields }, feature, at, deviceType) {
45582
- const problems = [];
45583
- 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(", ")})`));
45584
- const served = Object.entries(def.methods).filter(([name, m]) => m.systemOnly !== true && def.composedMethods?.[name] === void 0).map(([name]) => `\`${name}\``);
45585
- 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)`));
45586
- const itemArrayPath = feature.items === void 0 ? null : def.status?.itemArray?.path ?? null;
45587
- for (const key of requiredTopLevelKeys(state)) {
45588
- if (key === itemArrayPath) continue;
45589
- 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`));
45590
- else if (!(key in feature.fields)) problems.push(problem("missing-field", `${at}.fields.${key}`, `\`${def.name}.${key}\` is required and has no source`));
45591
- }
45592
- return problems;
45593
- }
45594
- function planTopLevelField({ def, fields }, field, mode, lookupCap) {
45595
- const { featureIndex, path, source } = field;
45596
- const fieldAt = `features[${featureIndex}].fields.${path}`;
45597
- if (path.includes(".")) return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — nested fields arrive in a later slice`));
45598
- const tf = fields.get(path);
45599
- if (tf === void 0) return refused(problem("unknown-field", fieldAt, `\`${def.name}\` has no field \`${path}\``));
45600
- const kinds = sourceKinds(source, lookupCap);
45601
- if (!kinds.ok) return refused(problem(kinds.code, fieldAt, kinds.message));
45602
- const role = roleOf(source);
45603
- const unavailable = unavailableFor(tf, role, mode, def.name, fieldAt);
45604
- if (!unavailable.ok) return refused(unavailable.problem);
45605
- const plan = {
45606
- cap: def.name,
45607
- path,
45608
- featureIndex,
45609
- kind: tf.kind,
45610
- nullable: tf.nullable,
45611
- required: tf.required,
45612
- unavailable: unavailable.unavailable,
45613
- role,
45614
- source,
45615
- reads: [...fieldReads(source)]
45616
- };
45617
- const enumProblem = enumLiteralProblem(def.name, tf, source, fieldAt);
45618
- return {
45619
- problems: [...compatibility(def.name, tf, kinds.kinds, fieldAt), ...enumProblem === null ? [] : [enumProblem]],
45620
- fields: [plan],
45621
- features: [],
45622
- events: []
45623
- };
45624
- }
45625
- function planFeature(feature, featureIndex, target, lookupCap) {
45626
- const at = `features[${featureIndex}]`;
45627
- const cap = composableCap(feature, at, lookupCap);
45628
- if ("code" in cap) return refused(cap);
45629
- const capProblems = target.mode === "replace" ? [] : [...builtCapProblems(cap, feature, at, target.deviceType)];
45630
- if (feature.commands !== void 0 && Object.keys(feature.commands).length > 0) capProblems.push(problem("reserved-variant", `${at}.commands`, "commands (`forward`) arrive in slice 3"));
45631
- const perField = Object.entries(feature.fields).map(([path, source]) => planTopLevelField(cap, {
45632
- featureIndex,
45633
- path,
45634
- source
45635
- }, target.mode, lookupCap));
45636
- const items = feature.items === void 0 ? [] : [planItems(cap.def, feature, featureIndex, lookupCap, target.mode)];
45637
- const all = [...perField, ...items];
45638
- const fields = all.flatMap((result) => result.fields);
45639
- const featurePlan = {
45640
- featureIndex,
45641
- cap: cap.def.name,
45642
- mode: target.mode
45643
- };
45644
- const eventPlan = planCompositionEvents(cap.def, featurePlan, fields);
45645
- return {
45646
- problems: [
45647
- ...capProblems,
45648
- ...all.flatMap((r) => r.problems),
45649
- ...eventPlan.problems
45650
- ],
45651
- fields,
45652
- features: [featurePlan],
45653
- events: eventPlan.events
45654
- };
45655
- }
45656
- /** A cap the device serves itself; one the composer grafted (an earlier ADD) is not native. */
45657
- function isNativeCap(target, cap) {
45658
- const owner = target.nativeCaps.get(cap);
45659
- return owner !== void 0 && owner !== "composer";
45660
- }
45661
- /** The target read, or the refusal that replaces the whole plan when it could not be (D391). */
45662
- function planTargetOf(composition, target) {
45663
- if (composition.target.kind === "new") return {
45664
- kind: "new",
45665
- type: composition.target.type
45666
- };
45667
- const key = compositionSourceKey(composition.target.device);
45668
- if (target === void 0) return problem("target-unreadable", "target", `target device \`${key}\` was not read — the save is refused rather than stored unchecked`);
45669
- if (target.kind === "absent") return problem("target-missing", "target", `target device \`${key}\` does not exist`);
45670
- 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`);
45671
- return {
45672
- kind: "existing",
45673
- found: target
45674
- };
45675
- }
45676
- function featureTargetOf(target, cap) {
45677
- if (target.kind === "new") return {
45678
- mode: "new",
45679
- deviceType: target.type
45680
- };
45681
- return {
45682
- mode: isNativeCap(target.found, cap) ? "replace" : "add",
45683
- deviceType: target.found.type
45684
- };
46420
+ //#region src/composition/presets/doorbell-feature.ts
46421
+ /**
46422
+ * The doorbell of a camera as a customization (D671). ONE builder: the
46423
+ * virtual-doorbell migration and the admin UI's "Use as doorbell" preset both
46424
+ * call it, so a preset can never write a shape the migration would refuse as
46425
+ * "an unrelated existing block".
46426
+ */
46427
+ /** A rise closer than this to the previous one is the same press (D671). */
46428
+ var DOORBELL_RISE_DEBOUNCE_MS = 2e3;
46429
+ /** Every source cap of `source` that `SOURCE_CAP_ACTIVE_FIELD` knows AND the device has bound. */
46430
+ function doorbellFeatureSources(source, boundCaps) {
46431
+ return Object.keys(SOURCE_CAP_ACTIVE_FIELD).filter((cap) => Object.hasOwn(SOURCE_CAP_CHANGED_AT_FIELD, cap) && boundCaps.includes(cap)).toSorted().flatMap((cap) => {
46432
+ const activeField = SOURCE_CAP_ACTIVE_FIELD[cap];
46433
+ const changedAtField = SOURCE_CAP_CHANGED_AT_FIELD[cap];
46434
+ return activeField === void 0 || changedAtField === void 0 ? [] : [{
46435
+ source,
46436
+ cap,
46437
+ activeField,
46438
+ changedAtField
46439
+ }];
46440
+ });
45685
46441
  }
45686
- /**
45687
- * The static plan. `target` describes an EXISTING target device (one read);
45688
- * it is ignored for a new one. On an existing target each feature REPLACES a
45689
- * cap the device has natively, else ADDS it (D663).
45690
- */
45691
- function planComposition(composition, lookupCap, target) {
45692
- const planTarget = planTargetOf(composition, target);
45693
- if ("code" in planTarget) return refused(planTarget);
45694
- const results = composition.features.map((feature, index) => {
45695
- 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);
45696
- return compositionFeatureEnabled(feature) ? result : {
45697
- problems: result.problems,
45698
- fields: [],
45699
- features: [],
45700
- events: []
46442
+ /** The D671 feature, byte for byte what the migration writes. Throws on zero sources. */
46443
+ function buildDoorbellCompositionFeature(input) {
46444
+ const sources = [...input.sources].toSorted((a, b) => `${a.source.addonId}/${a.source.stableId}#${a.cap}`.localeCompare(`${b.source.addonId}/${b.source.stableId}#${b.cap}`));
46445
+ if (sources.length === 0) throw new Error("doorbell composition needs at least one source");
46446
+ const edgeBindings = {};
46447
+ sources.forEach((entry, index) => {
46448
+ edgeBindings[`active${index}`] = {
46449
+ kind: "from",
46450
+ source: entry.source,
46451
+ cap: entry.cap,
46452
+ fieldPath: entry.activeField
46453
+ };
46454
+ edgeBindings[`changed${index}`] = {
46455
+ kind: "from",
46456
+ source: entry.source,
46457
+ cap: entry.cap,
46458
+ fieldPath: entry.changedAtField
45701
46459
  };
45702
46460
  });
45703
46461
  return {
45704
- problems: results.flatMap((r) => r.problems),
45705
- fields: results.flatMap((r) => r.fields),
45706
- features: results.flatMap((r) => r.features),
45707
- events: results.flatMap((r) => r.events)
45708
- };
45709
- }
45710
- function compositionSourceRefs(composition) {
45711
- const refs = composition.features.flatMap((f) => compositionFeatureEnabled(f) && f.kind === "fields" ? featureSources(f).flatMap(fieldReads).map((r) => r.source) : []);
45712
- return [...new Map(refs.map((r) => [compositionSourceKey(r), r])).values()];
45713
- }
45714
- /**
45715
- * The candidate's device: the existing target itself, else `self`, else a
45716
- * placeholder that cannot collide with a stored target. An existing target is
45717
- * known even on create, so a second customization of it is refused on create too.
45718
- */
45719
- function candidateSelf(composition, ctx, plan) {
45720
- return {
45721
- ref: composition.target.kind === "existing" ? composition.target.device : ctx.self ?? PENDING_SELF,
45722
- native: composition.target.kind === "existing" && ctx.target?.kind === "found" ? ctx.target : null,
45723
- replaced: replacedFieldKeys(plan)
45724
- };
45725
- }
45726
- /**
45727
- * `compositionFieldKey` of every field a REPLACE feature of `plan` owns — the
45728
- * candidate's own, and a stored peer's `CompositionPeer.replaced` (D663): one
45729
- * derivation, so the graph reads both the same way.
45730
- */
45731
- function replacedFieldKeys(plan) {
45732
- const replacing = new Set(plan.features.filter((f) => f.mode === "replace").map((f) => f.featureIndex));
45733
- return new Set(plan.fields.filter((f) => replacing.has(f.featureIndex)).map(compositionFieldKey));
45734
- }
45735
- /**
45736
- * A read of the candidate's own device. Its own composed output (a new device's
45737
- * field, an ADDED field) is the slice-1 own-field rule; on an existing target
45738
- * every other field — replaced, or not composed at all — is the NATIVE value,
45739
- * valid when the device serves that cap natively (D663, rule 5).
45740
- */
45741
- function selfReadProblems(read, at, fields, self) {
45742
- const readKey = `${read.cap}.${read.fieldPath}`;
45743
- if (fields.some((f) => compositionFieldKey(f) === readKey && !self.replaced.has(readKey))) return [];
45744
- if (self.native === null) return [problem("source-field-unknown", at, `this device has no composed field \`${read.cap}.${read.fieldPath}\``)];
45745
- if (isNativeCap(self.native, read.cap)) return [];
45746
- return [problem("source-capability-missing", at, `the target device (device ${self.native.deviceId}) has no native \`${read.cap}\``)];
45747
- }
45748
- function sourceProblems(fields, ctx, self) {
45749
- const selfKey = compositionSourceKey(self.ref);
45750
- return fields.flatMap((field) => field.reads.flatMap((read) => {
45751
- const at = compositionFieldAt(field);
45752
- const key = compositionSourceKey(read.source);
45753
- if (key === selfKey) return selfReadProblems(read, at, fields, self);
45754
- const desc = ctx.sources.get(key);
45755
- 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`)];
45756
- if (desc.kind === "absent") return [problem("source-missing", at, `source \`${key}\` does not exist`)];
45757
- if (!desc.caps.has(read.cap)) return [problem("source-capability-missing", at, `source \`${key}\` (device ${desc.deviceId}) has no \`${read.cap}\``)];
45758
- return [];
45759
- }));
45760
- }
45761
- /**
45762
- * A cycle's node keys are `compositionReadKey` strings:
45763
- * `<addonId>/<stableId>#<cap>.<fieldPath>`. When a node belongs to the
45764
- * CANDIDATE itself (this composition being saved), pull its `cap`/`fieldPath`
45765
- * back out so the refusal can point at that exact field, matching the
45766
- * documented `features[N].fields.<path>` convention. A cap name has no `.`,
45767
- * so splitting `rest` on the FIRST `.` is exact; an item leaf's remainder
45768
- * (`items[desiccant].status`) is matched through `compositionFieldKey`.
45769
- */
45770
- function candidateFieldOfNode(nodeKey, candidateKey) {
45771
- const prefix = `${candidateKey}#`;
45772
- if (!nodeKey.startsWith(prefix)) return null;
45773
- const rest = nodeKey.slice(prefix.length);
45774
- const dot = rest.indexOf(".");
45775
- if (dot === -1) return null;
45776
- return {
45777
- cap: rest.slice(0, dot),
45778
- fieldPath: rest.slice(dot + 1)
45779
- };
45780
- }
45781
- /** The first node of a cycle's path that is one of THIS composition's own
45782
- * planned fields, as a documented-convention path; `'features'` when the
45783
- * cycle runs entirely through other stored compositions. */
45784
- function cyclePath(nodePath, candidateKey, fields) {
45785
- for (const nodeKey of nodePath) {
45786
- const hit = candidateFieldOfNode(nodeKey, candidateKey);
45787
- if (hit === null) continue;
45788
- const hitKey = `${hit.cap}.${hit.fieldPath}`;
45789
- const field = fields.find((f) => compositionFieldKey(f) === hitKey);
45790
- if (field !== void 0) return compositionFieldAt(field);
45791
- }
45792
- return "features";
45793
- }
45794
- /** The first unread device any of `nodes` belongs to; null when none does. */
45795
- function unreadDeviceOf(nodes, unread) {
45796
- for (const [key, error] of unread) if (nodes.some((node) => node.startsWith(`${key}#`))) return {
45797
- key,
45798
- error
45799
- };
45800
- return null;
45801
- }
45802
- /**
45803
- * Cycle check runs against the CANDIDATE (this composition, as block
45804
- * `ctx.blockId`, writing `self.ref`) plus every OTHER stored composition,
45805
- * decided per strongly connected component (`findCandidateCycles`): a cyclic
45806
- * component holding a candidate node refuses, with one representative cycle
45807
- * through it; one without is not this save's cycle. A
45808
- * stored composition of the same block is its old version; another block on
45809
- * the same device, or two stored peers sharing a device, make
45810
- * `compositionEdges` throw `CompositionGraphError` — refused BY NAME as
45811
- * `duplicate-target` (D391, D663) instead of escaping as an uncaught throw.
45812
- */
45813
- function cycleProblems(composition, ctx, fields, self) {
45814
- const candidate = {
45815
- blockId: ctx.blockId ?? "(unsaved)",
45816
- target: self.ref,
45817
- composition,
45818
- replaced: self.replaced
45819
- };
45820
- const candidateKey = compositionSourceKey(candidate.target);
45821
- const unread = ctx.unreadTargets ?? /* @__PURE__ */ new Map();
45822
- try {
45823
- return findCandidateCycles(candidate, ctx.peers).map((c) => {
45824
- const at = cyclePath(c.path, candidateKey, fields);
45825
- const through = unreadDeviceOf([...c.component], unread);
45826
- 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(" → ")}`);
45827
- });
45828
- } catch (err) {
45829
- if (err instanceof CompositionGraphError) return [problem("duplicate-target", "features", err.message)];
45830
- throw err;
45831
- }
45832
- }
45833
- function validateComposition(composition, ctx) {
45834
- const plan = planComposition(composition, ctx.lookupCap, ctx.target ?? void 0);
45835
- const self = candidateSelf(composition, ctx, plan);
45836
- const cycles = cycleProblems(composition, ctx, plan.fields, self);
45837
- const problems = [
45838
- ...plan.problems,
45839
- ...sourceProblems(plan.fields, ctx, self),
45840
- ...cycles
45841
- ];
45842
- return {
45843
- ok: problems.length === 0,
45844
- problems,
45845
- fields: [...plan.fields],
45846
- features: [...plan.features],
45847
- events: [...plan.events]
46462
+ kind: "fields",
46463
+ cap: "doorbell",
46464
+ enabled: input.enabled,
46465
+ fields: {
46466
+ lastPressedAt: {
46467
+ kind: "expression",
46468
+ expr: `latest(${sources.map((_, index) => `rose(active${index}, changed${index}, ${DOORBELL_RISE_DEBOUNCE_MS})`).join(", ")})`,
46469
+ bindings: edgeBindings
46470
+ },
46471
+ pressCountSinceStart: {
46472
+ kind: "expression",
46473
+ expr: "count(lastPressedAt)",
46474
+ bindings: { lastPressedAt: {
46475
+ kind: "from",
46476
+ source: {
46477
+ addonId: input.camera.addonId,
46478
+ stableId: input.camera.stableId
46479
+ },
46480
+ cap: "doorbell",
46481
+ fieldPath: "lastPressedAt"
46482
+ } }
46483
+ }
46484
+ }
45848
46485
  };
45849
46486
  }
45850
46487
  //#endregion
@@ -52970,6 +53607,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
52970
53607
  addonId: null,
52971
53608
  access: "view"
52972
53609
  },
53610
+ "coreBlocks.listComposableCaps": {
53611
+ capName: "core-blocks",
53612
+ capScope: "system",
53613
+ addonId: null,
53614
+ access: "view"
53615
+ },
52973
53616
  "coreBlocks.listCompositions": {
52974
53617
  capName: "core-blocks",
52975
53618
  capScope: "system",
@@ -55784,6 +56427,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
55784
56427
  addonId: null,
55785
56428
  access: "create"
55786
56429
  },
56430
+ "pipelineAnalytics.clearTrackRelation": {
56431
+ capName: "pipeline-analytics",
56432
+ capScope: "device",
56433
+ addonId: null,
56434
+ access: "delete"
56435
+ },
55787
56436
  "pipelineAnalytics.clearTracks": {
55788
56437
  capName: "pipeline-analytics",
55789
56438
  capScope: "device",
@@ -56036,6 +56685,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
56036
56685
  addonId: null,
56037
56686
  access: "view"
56038
56687
  },
56688
+ "pipelineAnalytics.listTrackRelations": {
56689
+ capName: "pipeline-analytics",
56690
+ capScope: "device",
56691
+ addonId: null,
56692
+ access: "view"
56693
+ },
56039
56694
  "pipelineAnalytics.listTracks": {
56040
56695
  capName: "pipeline-analytics",
56041
56696
  capScope: "device",
@@ -56150,6 +56805,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
56150
56805
  addonId: null,
56151
56806
  access: "create"
56152
56807
  },
56808
+ "pipelineAnalytics.setTrackPurity": {
56809
+ capName: "pipeline-analytics",
56810
+ capScope: "device",
56811
+ addonId: null,
56812
+ access: "create"
56813
+ },
56814
+ "pipelineAnalytics.setTrackRelation": {
56815
+ capName: "pipeline-analytics",
56816
+ capScope: "device",
56817
+ addonId: null,
56818
+ access: "create"
56819
+ },
56153
56820
  "pipelineAnalytics.startStorageMigrationMove": {
56154
56821
  capName: "pipeline-analytics",
56155
56822
  capScope: "device",
@@ -56654,6 +57321,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
56654
57321
  addonId: null,
56655
57322
  access: "create"
56656
57323
  },
57324
+ "pipelineOrchestrator.setCameraSensors": {
57325
+ capName: "pipeline-orchestrator",
57326
+ capScope: "system",
57327
+ addonId: null,
57328
+ access: "create"
57329
+ },
56657
57330
  "pipelineOrchestrator.setCameraStepOverride": {
56658
57331
  capName: "pipeline-orchestrator",
56659
57332
  capScope: "system",
@@ -60399,6 +61072,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
60399
61072
  form: "single",
60400
61073
  optional: false
60401
61074
  }],
61075
+ "pipelineAnalytics.clearTrackRelation": [{
61076
+ name: "deviceId",
61077
+ form: "single",
61078
+ optional: false
61079
+ }],
60402
61080
  "pipelineAnalytics.clearTracks": [{
60403
61081
  name: "deviceId",
60404
61082
  form: "single",
@@ -60549,6 +61227,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
60549
61227
  form: "single",
60550
61228
  optional: false
60551
61229
  }],
61230
+ "pipelineAnalytics.listTrackRelations": [{
61231
+ name: "deviceId",
61232
+ form: "single",
61233
+ optional: false
61234
+ }],
60552
61235
  "pipelineAnalytics.listTracks": [{
60553
61236
  name: "deviceId",
60554
61237
  form: "single",
@@ -60619,6 +61302,16 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
60619
61302
  form: "single",
60620
61303
  optional: false
60621
61304
  }],
61305
+ "pipelineAnalytics.setTrackPurity": [{
61306
+ name: "deviceId",
61307
+ form: "single",
61308
+ optional: false
61309
+ }],
61310
+ "pipelineAnalytics.setTrackRelation": [{
61311
+ name: "deviceId",
61312
+ form: "single",
61313
+ optional: false
61314
+ }],
60622
61315
  "pipelineAnalytics.wipeAllAnalytics": [{
60623
61316
  name: "deviceId",
60624
61317
  form: "single",
@@ -60699,6 +61392,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
60699
61392
  form: "single",
60700
61393
  optional: false
60701
61394
  }],
61395
+ "pipelineOrchestrator.setCameraSensors": [{
61396
+ name: "deviceId",
61397
+ form: "single",
61398
+ optional: false
61399
+ }],
60702
61400
  "pipelineOrchestrator.setCameraStepOverride": [{
60703
61401
  name: "deviceId",
60704
61402
  form: "single",
@@ -61521,6 +62219,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
61521
62219
  "pipelineOrchestrator.getPipelineDevicePin",
61522
62220
  "pipelineOrchestrator.resolvePipeline",
61523
62221
  "pipelineOrchestrator.setCameraPipelineForAgent",
62222
+ "pipelineOrchestrator.setCameraSensors",
61524
62223
  "pipelineOrchestrator.setCameraStepOverride",
61525
62224
  "pipelineOrchestrator.setCameraStepToggle",
61526
62225
  "pipelineOrchestrator.setCameraSwitch",
@@ -62173,6 +62872,7 @@ function createSystemProxy(api) {
62173
62872
  getComposition: (input) => dispatch("coreBlocks", "getComposition", "query", input),
62174
62873
  listCompositions: (input) => dispatch("coreBlocks", "listCompositions", "query", input),
62175
62874
  getCustomization: (input) => dispatch("coreBlocks", "getCustomization", "query", input),
62875
+ listComposableCaps: (input) => dispatch("coreBlocks", "listComposableCaps", "query", input),
62176
62876
  validateComposition: (input) => dispatch("coreBlocks", "validateComposition", "mutation", input)
62177
62877
  },
62178
62878
  decoder: {
@@ -62504,6 +63204,7 @@ function createSystemProxy(api) {
62504
63204
  getNodeInferenceDevices: (input) => dispatch("pipelineOrchestrator", "getNodeInferenceDevices", "query", input),
62505
63205
  resetNodePipelineDefaults: (input) => dispatch("pipelineOrchestrator", "resetNodePipelineDefaults", "mutation", input),
62506
63206
  getCameraStatuses: (input) => dispatch("pipelineOrchestrator", "getCameraStatuses", "query", input),
63207
+ setCameraSensors: (input) => dispatch("pipelineOrchestrator", "setCameraSensors", "mutation", input),
62507
63208
  reconcileFromDisk: (input) => dispatch("pipelineOrchestrator", "reconcileFromDisk", "mutation", input),
62508
63209
  getReconcileFromDiskStatus: (input) => dispatch("pipelineOrchestrator", "getReconcileFromDiskStatus", "query", input),
62509
63210
  listTemplates: (input) => dispatch("pipelineOrchestrator", "listTemplates", "query", input),
@@ -66698,334 +67399,6 @@ var DEVICE_TYPE_INFO = { ["camera"]: {
66698
67399
  icon: "camera"
66699
67400
  } };
66700
67401
  //#endregion
66701
- //#region src/units/unit-table.ts
66702
- /**
66703
- * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
66704
- * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
66705
- * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
66706
- * decimals). K derives from `°C = K − 273.15`.
66707
- */
66708
- var UNIT_TABLE = {
66709
- "°C": {
66710
- dimension: "temperature",
66711
- factor: 1,
66712
- offset: 0
66713
- },
66714
- "°F": {
66715
- dimension: "temperature",
66716
- factor: 5 / 9,
66717
- offset: -160 / 9
66718
- },
66719
- K: {
66720
- dimension: "temperature",
66721
- factor: 1,
66722
- offset: -273.15
66723
- },
66724
- hPa: {
66725
- dimension: "pressure",
66726
- factor: 1,
66727
- offset: 0
66728
- },
66729
- kPa: {
66730
- dimension: "pressure",
66731
- factor: 10,
66732
- offset: 0
66733
- },
66734
- Pa: {
66735
- dimension: "pressure",
66736
- factor: .01,
66737
- offset: 0
66738
- },
66739
- mbar: {
66740
- dimension: "pressure",
66741
- factor: 1,
66742
- offset: 0
66743
- },
66744
- bar: {
66745
- dimension: "pressure",
66746
- factor: 1e3,
66747
- offset: 0
66748
- },
66749
- inHg: {
66750
- dimension: "pressure",
66751
- factor: 33.8639,
66752
- offset: 0
66753
- },
66754
- mmHg: {
66755
- dimension: "pressure",
66756
- factor: 1.33322,
66757
- offset: 0
66758
- },
66759
- psi: {
66760
- dimension: "pressure",
66761
- factor: 68.9476,
66762
- offset: 0
66763
- },
66764
- "m/s": {
66765
- dimension: "speed",
66766
- factor: 1,
66767
- offset: 0
66768
- },
66769
- "km/h": {
66770
- dimension: "speed",
66771
- factor: 1 / 3.6,
66772
- offset: 0
66773
- },
66774
- mph: {
66775
- dimension: "speed",
66776
- factor: .44704,
66777
- offset: 0
66778
- },
66779
- kn: {
66780
- dimension: "speed",
66781
- factor: .514444,
66782
- offset: 0
66783
- },
66784
- "mm/h": {
66785
- dimension: "precipitation-rate",
66786
- factor: 1,
66787
- offset: 0
66788
- },
66789
- "in/h": {
66790
- dimension: "precipitation-rate",
66791
- factor: 25.4,
66792
- offset: 0
66793
- },
66794
- m: {
66795
- dimension: "length",
66796
- factor: 1,
66797
- offset: 0
66798
- },
66799
- mm: {
66800
- dimension: "length",
66801
- factor: .001,
66802
- offset: 0
66803
- },
66804
- cm: {
66805
- dimension: "length",
66806
- factor: .01,
66807
- offset: 0
66808
- },
66809
- km: {
66810
- dimension: "length",
66811
- factor: 1e3,
66812
- offset: 0
66813
- },
66814
- in: {
66815
- dimension: "length",
66816
- factor: .0254,
66817
- offset: 0
66818
- },
66819
- ft: {
66820
- dimension: "length",
66821
- factor: .3048,
66822
- offset: 0
66823
- },
66824
- mi: {
66825
- dimension: "length",
66826
- factor: 1609.344,
66827
- offset: 0
66828
- },
66829
- lx: {
66830
- dimension: "illuminance",
66831
- factor: 1,
66832
- offset: 0
66833
- },
66834
- "W/m²": {
66835
- dimension: "irradiance",
66836
- factor: 1,
66837
- offset: 0
66838
- },
66839
- W: {
66840
- dimension: "power",
66841
- factor: 1,
66842
- offset: 0
66843
- },
66844
- kW: {
66845
- dimension: "power",
66846
- factor: 1e3,
66847
- offset: 0
66848
- },
66849
- VA: {
66850
- dimension: "apparent-power",
66851
- factor: 1,
66852
- offset: 0
66853
- },
66854
- Wh: {
66855
- dimension: "energy",
66856
- factor: 1,
66857
- offset: 0
66858
- },
66859
- kWh: {
66860
- dimension: "energy",
66861
- factor: 1e3,
66862
- offset: 0
66863
- },
66864
- MWh: {
66865
- dimension: "energy",
66866
- factor: 1e6,
66867
- offset: 0
66868
- },
66869
- V: {
66870
- dimension: "voltage",
66871
- factor: 1,
66872
- offset: 0
66873
- },
66874
- mV: {
66875
- dimension: "voltage",
66876
- factor: .001,
66877
- offset: 0
66878
- },
66879
- A: {
66880
- dimension: "current",
66881
- factor: 1,
66882
- offset: 0
66883
- },
66884
- mA: {
66885
- dimension: "current",
66886
- factor: .001,
66887
- offset: 0
66888
- },
66889
- ppm: {
66890
- dimension: "concentration-volume",
66891
- factor: 1,
66892
- offset: 0
66893
- },
66894
- ppb: {
66895
- dimension: "concentration-volume",
66896
- factor: .001,
66897
- offset: 0
66898
- },
66899
- "µg/m³": {
66900
- dimension: "concentration-mass",
66901
- factor: 1,
66902
- offset: 0
66903
- },
66904
- "mg/m³": {
66905
- dimension: "concentration-mass",
66906
- factor: 1e3,
66907
- offset: 0
66908
- },
66909
- kg: {
66910
- dimension: "mass",
66911
- factor: 1,
66912
- offset: 0
66913
- },
66914
- g: {
66915
- dimension: "mass",
66916
- factor: .001,
66917
- offset: 0
66918
- },
66919
- lb: {
66920
- dimension: "mass",
66921
- factor: .453592,
66922
- offset: 0
66923
- },
66924
- oz: {
66925
- dimension: "mass",
66926
- factor: .0283495,
66927
- offset: 0
66928
- },
66929
- "%": {
66930
- dimension: "percentage",
66931
- factor: 1,
66932
- offset: 0
66933
- }
66934
- };
66935
- //#endregion
66936
- //#region src/units/convert.ts
66937
- /**
66938
- * Pure unit-conversion API over `UNIT_TABLE`. No dependencies, no side effects.
66939
- *
66940
- * Conversion is refused (throws `UnitConversionError`, or returns `undefined`
66941
- * from the `try*` variant) whenever a unit is unknown or the two units belong
66942
- * to different dimensions — cross-dimension conversion is deliberately
66943
- * impossible so a render override can never make the value and its unit label
66944
- * disagree.
66945
- *
66946
- * Callers pass units through `normalizeUnit` (`../device/source-info.ts`) BEFORE
66947
- * calling here — the table keys only canonical spellings.
66948
- */
66949
- /** Thrown by `convertUnit` when a conversion is refused. Carries the offending
66950
- * units + a machine-readable `reason` for callers that branch on the cause. */
66951
- var UnitConversionError = class extends Error {
66952
- from;
66953
- to;
66954
- reason;
66955
- constructor(from, to, reason) {
66956
- super(`[units] cannot convert '${from}' → '${to}': ${reason}`);
66957
- this.name = "UnitConversionError";
66958
- this.from = from;
66959
- this.to = to;
66960
- this.reason = reason;
66961
- }
66962
- };
66963
- /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
66964
- function specFor(unit) {
66965
- return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
66966
- }
66967
- /** The dimension a unit belongs to, or `undefined` for an unknown unit. */
66968
- function unitDimension(unit) {
66969
- return specFor(unit)?.dimension;
66970
- }
66971
- /** Value in `spec`'s unit → its dimension's canonical unit. */
66972
- function toCanonical(value, spec) {
66973
- return value * spec.factor + spec.offset;
66974
- }
66975
- /** Canonical-unit value → the unit described by `spec`. */
66976
- function fromCanonical(canonical, spec) {
66977
- return (canonical - spec.offset) / spec.factor;
66978
- }
66979
- /**
66980
- * Convert `value` from unit `from` to unit `to`. Identity when `from === to`.
66981
- * Throws `UnitConversionError` when either unit is unknown or the units belong
66982
- * to different dimensions.
66983
- */
66984
- function convertUnit(value, from, to) {
66985
- if (from === to) return value;
66986
- const fromSpec = specFor(from);
66987
- if (!fromSpec) throw new UnitConversionError(from, to, "unknown-from");
66988
- const toSpec = specFor(to);
66989
- if (!toSpec) throw new UnitConversionError(from, to, "unknown-to");
66990
- if (fromSpec.dimension !== toSpec.dimension) throw new UnitConversionError(from, to, "cross-dimension");
66991
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
66992
- }
66993
- /**
66994
- * Graceful variant for the render path: returns the converted value, or
66995
- * `undefined` when the conversion is refused (unknown unit / cross-dimension).
66996
- * Never throws — a render caller falls back to the raw value + source unit.
66997
- */
66998
- function tryConvertUnit(value, from, to) {
66999
- if (from === to) return value;
67000
- const fromSpec = specFor(from);
67001
- if (!fromSpec) return void 0;
67002
- const toSpec = specFor(to);
67003
- if (!toSpec) return void 0;
67004
- if (fromSpec.dimension !== toSpec.dimension) return void 0;
67005
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
67006
- }
67007
- /**
67008
- * Whether `value` can be converted between `from` and `to` (same dimension,
67009
- * both known). Cheap boolean probe for the UI's same-dimension unit picker and
67010
- * the resolver's convertibility branch — compute ONCE so a unit label and its
67011
- * value math can never disagree.
67012
- */
67013
- function canConvertUnit(from, to) {
67014
- if (from === to) return true;
67015
- const fromDim = unitDimension(from);
67016
- if (fromDim === void 0) return false;
67017
- return fromDim === unitDimension(to);
67018
- }
67019
- /**
67020
- * Every known unit spelling in a dimension (table insertion order — canonical
67021
- * unit first). Powers the UI's same-dimension unit picker.
67022
- */
67023
- function unitsForDimension(dimension) {
67024
- const out = [];
67025
- for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
67026
- return out;
67027
- }
67028
- //#endregion
67029
67402
  //#region src/util/location-match.ts
67030
67403
  /**
67031
67404
  * Pure fuzzy matcher for adoption location import. Normalized
@@ -68326,4 +68699,4 @@ function enumerateInferenceDevices(hw) {
68326
68699
  return out;
68327
68700
  }
68328
68701
  //#endregion
68329
- 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, 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, 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, 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 };
68702
+ 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, ClearTrackRelationInputSchema, ClearTrackRelationResultSchema, 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, ListTrackRelationsInputSchema, ListTrackRelationsResultSchema, 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, MAX_TRACK_PURITIES, MAX_TRACK_RELATIONS, 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, SetTrackPurityInputSchema, SetTrackPurityResultSchema, SetTrackRelationInputSchema, 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, TRACK_RELATIONS_DEFAULT_LIMIT, 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, TrackPuritySchema, TrackPurityValueSchema, TrackRelationKindSchema, TrackRelationRefusalSchema, TrackRelationSchema, TrackSchema, TrackSideSchema, 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 };