@camstack/types 1.1.19 → 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/battery.cap.d.ts +6 -0
- package/dist/capabilities/capability-definition.d.ts +39 -0
- package/dist/capabilities/consumables.cap.d.ts +35 -0
- package/dist/capabilities/device-manager.cap.d.ts +396 -15
- package/dist/capabilities/index.d.ts +1 -1
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +7 -3
- package/dist/device/device-binding.d.ts +9 -3
- package/dist/device/device-management.d.ts +87 -6
- package/dist/device/index.d.ts +2 -2
- package/dist/device/schema-fields.d.ts +13 -0
- package/dist/expression/ast.d.ts +56 -0
- package/dist/expression/builtins.d.ts +19 -0
- package/dist/expression/compile.d.ts +17 -0
- package/dist/expression/errors.d.ts +16 -0
- package/dist/expression/evaluator.d.ts +14 -0
- package/dist/expression/index.d.ts +25 -0
- package/dist/expression/limits.d.ts +30 -0
- package/dist/expression/link-expression.d.ts +44 -0
- package/dist/expression/parser.d.ts +12 -0
- package/dist/expression/tokenizer.d.ts +38 -0
- package/dist/generated/addon-api.d.ts +452 -4
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1342 -20
- package/dist/index.mjs +1313 -21
- package/dist/interfaces/agent.d.ts +21 -0
- package/dist/{sleep-MHm--th-.mjs → sleep-BO1nweKv.mjs} +1 -0
- package/dist/{sleep-BabrCASa.js → sleep-DaQgDq90.js} +1 -0
- package/dist/units/convert.d.ts +49 -0
- package/dist/units/index.d.ts +8 -0
- package/dist/units/unit-table.d.ts +270 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as SubscribeAudioChunksResultSchema, A as ReadinessRegistry, B as CamStreamResolutionSchema, C as asJsonObject, D as parseJsonObject, E as parseJsonArray, F as BrokerStatsSchema, G as FrameHandleFormatSchema, H as DecodedAudioChunkSchema, I as BrokerStatusSchema, J as ProfileSlotSchema, K as FrameHandleSchema, L as CAM_PROFILE_ORDER, M as emitDownForOwnedCaps, N as readinessKey, O as parseJsonUnknown, P as scopeKey, Q as SubscribeAudioChunksInputSchema, R as CamProfileSchema, S as asJsonArray, T as asString, U as DecodedFrameSchema, V as CameraStreamSchema, W as EncodedPacketSchema, X as StreamSourceEntrySchema, Y as ProfileSlotStatusSchema, Z as StreamSourceSchema, _ as ChargingStatus, a as adminUiCapability, at as selectAssignedProfileSlots, b as DeviceType, c as createMirrorSource, ct as createDurableState, d as DEVICE_STATUS_METHOD, dt as isEvent, et as SubscribeFramesInputSchema, f as event, ft as WELL_KNOWN_TABS, g as resolveCapMount, gt as DisposerChain, h as method, ht as EventCategory, i as deviceOpsCapability, it as parseProfileBrokerId, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, l as createSliceHandle, lt as createEvent, m as isDeviceConfigCap, mt as hydrateSchema, n as sleepCancellable, nt as makeProfileBrokerId, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, pt as WELL_KNOWN_TAB_MAP, q as ProfileRtspEntrySchema, r as RawStateResultSchema, rt as makeSourceBrokerId, s as createLazyTrpcSource, st as normalizeAddonInitResult, t as sleep, tt as SubscribeFramesResultSchema, u as DEVICE_SETTINGS_CONTRIBUTION_METHODS, ut as emitReadiness, v as DeviceFeature, w as asNumber, x as asBoolean, y as DeviceRole, z as CamStreamKindSchema } from "./sleep-
|
|
1
|
+
import { $ as SubscribeAudioChunksResultSchema, A as ReadinessRegistry, B as CamStreamResolutionSchema, C as asJsonObject, D as parseJsonObject, E as parseJsonArray, F as BrokerStatsSchema, G as FrameHandleFormatSchema, H as DecodedAudioChunkSchema, I as BrokerStatusSchema, J as ProfileSlotSchema, K as FrameHandleSchema, L as CAM_PROFILE_ORDER, M as emitDownForOwnedCaps, N as readinessKey, O as parseJsonUnknown, P as scopeKey, Q as SubscribeAudioChunksInputSchema, R as CamProfileSchema, S as asJsonArray, T as asString, U as DecodedFrameSchema, V as CameraStreamSchema, W as EncodedPacketSchema, X as StreamSourceEntrySchema, Y as ProfileSlotStatusSchema, Z as StreamSourceSchema, _ as ChargingStatus, a as adminUiCapability, at as selectAssignedProfileSlots, b as DeviceType, c as createMirrorSource, ct as createDurableState, d as DEVICE_STATUS_METHOD, dt as isEvent, et as SubscribeFramesInputSchema, f as event, ft as WELL_KNOWN_TABS, g as resolveCapMount, gt as DisposerChain, h as method, ht as EventCategory, i as deviceOpsCapability, it as parseProfileBrokerId, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, l as createSliceHandle, lt as createEvent, m as isDeviceConfigCap, mt as hydrateSchema, n as sleepCancellable, nt as makeProfileBrokerId, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, pt as WELL_KNOWN_TAB_MAP, q as ProfileRtspEntrySchema, r as RawStateResultSchema, rt as makeSourceBrokerId, s as createLazyTrpcSource, st as normalizeAddonInitResult, t as sleep, tt as SubscribeFramesResultSchema, u as DEVICE_SETTINGS_CONTRIBUTION_METHODS, ut as emitReadiness, v as DeviceFeature, w as asNumber, x as asBoolean, y as DeviceRole, z as CamStreamKindSchema } from "./sleep-BO1nweKv.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/health/wiring-health.ts
|
|
@@ -2393,6 +2393,787 @@ var DEVICE_TYPE_INFO = { ["camera"]: {
|
|
|
2393
2393
|
icon: "camera"
|
|
2394
2394
|
} };
|
|
2395
2395
|
//#endregion
|
|
2396
|
+
//#region src/expression/errors.ts
|
|
2397
|
+
/**
|
|
2398
|
+
* Error types for the safe expression engine. Two distinct classes so callers
|
|
2399
|
+
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
2400
|
+
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
2401
|
+
*/
|
|
2402
|
+
/** Thrown by the tokenizer / parser. Carries a 0-based source `position` when
|
|
2403
|
+
* the failure is anchored to a character (author-facing inline feedback). */
|
|
2404
|
+
var ExpressionParseError = class extends Error {
|
|
2405
|
+
position;
|
|
2406
|
+
constructor(message, position) {
|
|
2407
|
+
super(message);
|
|
2408
|
+
this.name = "ExpressionParseError";
|
|
2409
|
+
this.position = position;
|
|
2410
|
+
}
|
|
2411
|
+
};
|
|
2412
|
+
/** Thrown by the evaluator (unknown identifier, type mismatch, non-finite
|
|
2413
|
+
* result, unknown builtin, step-budget exceeded). */
|
|
2414
|
+
var ExpressionEvalError = class extends Error {
|
|
2415
|
+
constructor(message) {
|
|
2416
|
+
super(message);
|
|
2417
|
+
this.name = "ExpressionEvalError";
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
//#endregion
|
|
2421
|
+
//#region src/expression/limits.ts
|
|
2422
|
+
/**
|
|
2423
|
+
* Resource-bound constants for the safe expression engine.
|
|
2424
|
+
*
|
|
2425
|
+
* Every bound is defense-in-depth: the grammar is non-Turing-complete (no
|
|
2426
|
+
* loops, recursion, lambdas or member access — see `ast.ts`), so evaluation is
|
|
2427
|
+
* O(nodeCount) by construction. These caps merely put a hard ceiling on the
|
|
2428
|
+
* work a single author-supplied expression can request, so a hostile or
|
|
2429
|
+
* accidental pathological string can never spend unbounded CPU/memory.
|
|
2430
|
+
*/
|
|
2431
|
+
/** Max source length (chars) — checked BEFORE tokenizing so a huge string is
|
|
2432
|
+
* rejected without allocation. */
|
|
2433
|
+
var MAX_EXPRESSION_SOURCE_LENGTH = 2048;
|
|
2434
|
+
/** Max AST nodes — checked during parse; a deeply nested grouping that exceeds
|
|
2435
|
+
* this is rejected as "expression too complex". */
|
|
2436
|
+
var MAX_EXPRESSION_AST_NODES = 256;
|
|
2437
|
+
/** Defense-in-depth walker step budget — one increment per node visit during
|
|
2438
|
+
* evaluation. The grammar guarantees O(nodeCount) walks, so this can only trip
|
|
2439
|
+
* on a crafted maximum-size AST. */
|
|
2440
|
+
var MAX_EXPRESSION_EVAL_STEPS = 4096;
|
|
2441
|
+
/** Max named bindings on one `DeviceLinkExpressionSource`. */
|
|
2442
|
+
var MAX_EXPRESSION_BINDINGS = 32;
|
|
2443
|
+
/** Max positional arguments to any builtin call. */
|
|
2444
|
+
var MAX_EXPRESSION_CALL_ARGS = 16;
|
|
2445
|
+
/** LRU compile-cache capacity (parsed ASTs keyed by raw source string). */
|
|
2446
|
+
var EXPRESSION_COMPILE_CACHE_CAPACITY = 256;
|
|
2447
|
+
/** A legal binding / identifier name. */
|
|
2448
|
+
var EXPRESSION_IDENTIFIER_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2449
|
+
/** Binding names an author may NOT use: `now` is auto-injected; the literal
|
|
2450
|
+
* keywords lex as values, not identifiers, so binding to them is meaningless. */
|
|
2451
|
+
var RESERVED_BINDING_NAMES = new Set([
|
|
2452
|
+
"now",
|
|
2453
|
+
"true",
|
|
2454
|
+
"false",
|
|
2455
|
+
"null"
|
|
2456
|
+
]);
|
|
2457
|
+
//#endregion
|
|
2458
|
+
//#region src/expression/tokenizer.ts
|
|
2459
|
+
/**
|
|
2460
|
+
* Tokenizer for the safe expression mini-language. Hand-rolled, single-pass,
|
|
2461
|
+
* zero-dependency. The grammar is deliberately boring: decimal numbers,
|
|
2462
|
+
* single/double-quoted strings with a tiny escape set, identifiers, the three
|
|
2463
|
+
* value keywords (`true`/`false`/`null`) and a fixed punctuator set. Anything
|
|
2464
|
+
* outside that — a bare `.`, `=`, `[`, `]`, `{`, `}`, `;`, backtick, `&`, `|` —
|
|
2465
|
+
* is a parse error with a source position, so member access / assignment /
|
|
2466
|
+
* template literals are lexically impossible.
|
|
2467
|
+
*/
|
|
2468
|
+
var KEYWORDS = new Set([
|
|
2469
|
+
"true",
|
|
2470
|
+
"false",
|
|
2471
|
+
"null"
|
|
2472
|
+
]);
|
|
2473
|
+
function isDigit(ch) {
|
|
2474
|
+
return ch >= "0" && ch <= "9";
|
|
2475
|
+
}
|
|
2476
|
+
function isIdentStart(ch) {
|
|
2477
|
+
return ch >= "A" && ch <= "Z" || ch >= "a" && ch <= "z" || ch === "_";
|
|
2478
|
+
}
|
|
2479
|
+
function isIdentPart(ch) {
|
|
2480
|
+
return isIdentStart(ch) || isDigit(ch);
|
|
2481
|
+
}
|
|
2482
|
+
function isWhitespace(ch) {
|
|
2483
|
+
return ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "\f" || ch === "\v";
|
|
2484
|
+
}
|
|
2485
|
+
/** Tokenize `source` into a flat token list ending with a single `eof` token.
|
|
2486
|
+
* Throws `ExpressionParseError` on any illegal character or unterminated
|
|
2487
|
+
* string. */
|
|
2488
|
+
function tokenize(source) {
|
|
2489
|
+
if (source.length > 2048) throw new ExpressionParseError(`expression too long (${source.length} > ${MAX_EXPRESSION_SOURCE_LENGTH} chars)`, 0);
|
|
2490
|
+
const tokens = [];
|
|
2491
|
+
let i = 0;
|
|
2492
|
+
const n = source.length;
|
|
2493
|
+
while (i < n) {
|
|
2494
|
+
const ch = source[i];
|
|
2495
|
+
if (isWhitespace(ch)) {
|
|
2496
|
+
i += 1;
|
|
2497
|
+
continue;
|
|
2498
|
+
}
|
|
2499
|
+
if (isDigit(ch)) {
|
|
2500
|
+
const start = i;
|
|
2501
|
+
while (i < n && isDigit(source[i])) i += 1;
|
|
2502
|
+
if (i < n && source[i] === ".") {
|
|
2503
|
+
if (i + 1 >= n || !isDigit(source[i + 1])) throw new ExpressionParseError("malformed number: decimal point needs a digit", i);
|
|
2504
|
+
i += 1;
|
|
2505
|
+
while (i < n && isDigit(source[i])) i += 1;
|
|
2506
|
+
}
|
|
2507
|
+
const text = source.slice(start, i);
|
|
2508
|
+
const value = Number(text);
|
|
2509
|
+
if (!Number.isFinite(value)) throw new ExpressionParseError(`malformed number: '${text}'`, start);
|
|
2510
|
+
tokens.push({
|
|
2511
|
+
type: "number",
|
|
2512
|
+
value,
|
|
2513
|
+
pos: start
|
|
2514
|
+
});
|
|
2515
|
+
continue;
|
|
2516
|
+
}
|
|
2517
|
+
if (ch === "'" || ch === "\"") {
|
|
2518
|
+
const quote = ch;
|
|
2519
|
+
const start = i;
|
|
2520
|
+
i += 1;
|
|
2521
|
+
let out = "";
|
|
2522
|
+
let closed = false;
|
|
2523
|
+
while (i < n) {
|
|
2524
|
+
const c = source[i];
|
|
2525
|
+
if (c === "\\") {
|
|
2526
|
+
const next = i + 1 < n ? source[i + 1] : "";
|
|
2527
|
+
if (next === "\\" || next === "'" || next === "\"") {
|
|
2528
|
+
out += next;
|
|
2529
|
+
i += 2;
|
|
2530
|
+
continue;
|
|
2531
|
+
}
|
|
2532
|
+
throw new ExpressionParseError(`invalid string escape: '\\${next}'`, i);
|
|
2533
|
+
}
|
|
2534
|
+
if (c === quote) {
|
|
2535
|
+
closed = true;
|
|
2536
|
+
i += 1;
|
|
2537
|
+
break;
|
|
2538
|
+
}
|
|
2539
|
+
out += c;
|
|
2540
|
+
i += 1;
|
|
2541
|
+
}
|
|
2542
|
+
if (!closed) throw new ExpressionParseError("unterminated string literal", start);
|
|
2543
|
+
tokens.push({
|
|
2544
|
+
type: "string",
|
|
2545
|
+
value: out,
|
|
2546
|
+
pos: start
|
|
2547
|
+
});
|
|
2548
|
+
continue;
|
|
2549
|
+
}
|
|
2550
|
+
if (isIdentStart(ch)) {
|
|
2551
|
+
const start = i;
|
|
2552
|
+
while (i < n && isIdentPart(source[i])) i += 1;
|
|
2553
|
+
const text = source.slice(start, i);
|
|
2554
|
+
if (KEYWORDS.has(text)) tokens.push({
|
|
2555
|
+
type: "keyword",
|
|
2556
|
+
keyword: keywordOf(text),
|
|
2557
|
+
pos: start
|
|
2558
|
+
});
|
|
2559
|
+
else tokens.push({
|
|
2560
|
+
type: "identifier",
|
|
2561
|
+
name: text,
|
|
2562
|
+
pos: start
|
|
2563
|
+
});
|
|
2564
|
+
continue;
|
|
2565
|
+
}
|
|
2566
|
+
const two = i + 1 < n ? source.slice(i, i + 2) : "";
|
|
2567
|
+
if (two === "<=" || two === ">=" || two === "==" || two === "!=" || two === "&&" || two === "||") {
|
|
2568
|
+
tokens.push({
|
|
2569
|
+
type: "punct",
|
|
2570
|
+
punct: two,
|
|
2571
|
+
pos: i
|
|
2572
|
+
});
|
|
2573
|
+
i += 2;
|
|
2574
|
+
continue;
|
|
2575
|
+
}
|
|
2576
|
+
if (isSinglePunct(ch)) {
|
|
2577
|
+
tokens.push({
|
|
2578
|
+
type: "punct",
|
|
2579
|
+
punct: ch,
|
|
2580
|
+
pos: i
|
|
2581
|
+
});
|
|
2582
|
+
i += 1;
|
|
2583
|
+
continue;
|
|
2584
|
+
}
|
|
2585
|
+
throw new ExpressionParseError(`unexpected character '${ch}'`, i);
|
|
2586
|
+
}
|
|
2587
|
+
tokens.push({
|
|
2588
|
+
type: "eof",
|
|
2589
|
+
pos: n
|
|
2590
|
+
});
|
|
2591
|
+
return tokens;
|
|
2592
|
+
}
|
|
2593
|
+
function keywordOf(text) {
|
|
2594
|
+
if (text === "true") return "true";
|
|
2595
|
+
if (text === "false") return "false";
|
|
2596
|
+
return "null";
|
|
2597
|
+
}
|
|
2598
|
+
function isSinglePunct(ch) {
|
|
2599
|
+
return ch === "(" || ch === ")" || ch === "," || ch === "?" || ch === ":" || ch === "+" || ch === "-" || ch === "*" || ch === "/" || ch === "%" || ch === "!" || ch === "<" || ch === ">";
|
|
2600
|
+
}
|
|
2601
|
+
//#endregion
|
|
2602
|
+
//#region src/expression/builtins.ts
|
|
2603
|
+
/**
|
|
2604
|
+
* Frozen, null-prototype builtin function table for the expression engine
|
|
2605
|
+
* (spec §4 rule 4). The table is the SOLE surface of callable functions: the
|
|
2606
|
+
* parser rejects any callee not in it, and the evaluator gates each call on an
|
|
2607
|
+
* own-property check against it.
|
|
2608
|
+
*
|
|
2609
|
+
* Because the object has a NULL prototype AND is `Object.freeze`d:
|
|
2610
|
+
* - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
|
|
2611
|
+
* - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
|
|
2612
|
+
* (there is no `Object.prototype` in the chain), so those names are not
|
|
2613
|
+
* callable — they are simply "unknown function" at parse time.
|
|
2614
|
+
*
|
|
2615
|
+
* Every numeric argument is validated as a finite number and every numeric
|
|
2616
|
+
* RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
|
|
2617
|
+
* (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
|
|
2618
|
+
* closed rather than emitting a garbage value.
|
|
2619
|
+
*/
|
|
2620
|
+
function asFiniteNumber(value, name, index) {
|
|
2621
|
+
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
2622
|
+
return value;
|
|
2623
|
+
}
|
|
2624
|
+
function asString$1(value, name, index) {
|
|
2625
|
+
if (typeof value !== "string") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a string`);
|
|
2626
|
+
return value;
|
|
2627
|
+
}
|
|
2628
|
+
function finiteResult(value, name) {
|
|
2629
|
+
if (!Number.isFinite(value)) throw new ExpressionEvalError(`${name}: produced a non-finite result`);
|
|
2630
|
+
return value;
|
|
2631
|
+
}
|
|
2632
|
+
function allFiniteNumbers(args, name) {
|
|
2633
|
+
return args.map((a, idx) => asFiniteNumber(a, name, idx));
|
|
2634
|
+
}
|
|
2635
|
+
var INF = Number.POSITIVE_INFINITY;
|
|
2636
|
+
var table = {
|
|
2637
|
+
min: {
|
|
2638
|
+
minArgs: 1,
|
|
2639
|
+
maxArgs: INF,
|
|
2640
|
+
apply: (args) => finiteResult(Math.min(...allFiniteNumbers(args, "min")), "min")
|
|
2641
|
+
},
|
|
2642
|
+
max: {
|
|
2643
|
+
minArgs: 1,
|
|
2644
|
+
maxArgs: INF,
|
|
2645
|
+
apply: (args) => finiteResult(Math.max(...allFiniteNumbers(args, "max")), "max")
|
|
2646
|
+
},
|
|
2647
|
+
abs: {
|
|
2648
|
+
minArgs: 1,
|
|
2649
|
+
maxArgs: 1,
|
|
2650
|
+
apply: (args) => finiteResult(Math.abs(asFiniteNumber(args[0], "abs", 0)), "abs")
|
|
2651
|
+
},
|
|
2652
|
+
floor: {
|
|
2653
|
+
minArgs: 1,
|
|
2654
|
+
maxArgs: 1,
|
|
2655
|
+
apply: (args) => finiteResult(Math.floor(asFiniteNumber(args[0], "floor", 0)), "floor")
|
|
2656
|
+
},
|
|
2657
|
+
ceil: {
|
|
2658
|
+
minArgs: 1,
|
|
2659
|
+
maxArgs: 1,
|
|
2660
|
+
apply: (args) => finiteResult(Math.ceil(asFiniteNumber(args[0], "ceil", 0)), "ceil")
|
|
2661
|
+
},
|
|
2662
|
+
sqrt: {
|
|
2663
|
+
minArgs: 1,
|
|
2664
|
+
maxArgs: 1,
|
|
2665
|
+
apply: (args) => finiteResult(Math.sqrt(asFiniteNumber(args[0], "sqrt", 0)), "sqrt")
|
|
2666
|
+
},
|
|
2667
|
+
round: {
|
|
2668
|
+
minArgs: 1,
|
|
2669
|
+
maxArgs: 2,
|
|
2670
|
+
apply: (args) => {
|
|
2671
|
+
const x = asFiniteNumber(args[0], "round", 0);
|
|
2672
|
+
const digits = args.length > 1 ? Math.trunc(asFiniteNumber(args[1], "round", 1)) : 0;
|
|
2673
|
+
if (digits < 0 || digits > 100) throw new ExpressionEvalError("round: digits must be between 0 and 100");
|
|
2674
|
+
const factor = 10 ** digits;
|
|
2675
|
+
return finiteResult(Math.round(x * factor) / factor, "round");
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
pow: {
|
|
2679
|
+
minArgs: 2,
|
|
2680
|
+
maxArgs: 2,
|
|
2681
|
+
apply: (args) => finiteResult(asFiniteNumber(args[0], "pow", 0) ** asFiniteNumber(args[1], "pow", 1), "pow")
|
|
2682
|
+
},
|
|
2683
|
+
clamp: {
|
|
2684
|
+
minArgs: 3,
|
|
2685
|
+
maxArgs: 3,
|
|
2686
|
+
apply: (args) => {
|
|
2687
|
+
const x = asFiniteNumber(args[0], "clamp", 0);
|
|
2688
|
+
const lo = asFiniteNumber(args[1], "clamp", 1);
|
|
2689
|
+
const hi = asFiniteNumber(args[2], "clamp", 2);
|
|
2690
|
+
if (lo > hi) throw new ExpressionEvalError("clamp: lower bound is greater than upper bound");
|
|
2691
|
+
return finiteResult(Math.min(hi, Math.max(lo, x)), "clamp");
|
|
2692
|
+
}
|
|
2693
|
+
},
|
|
2694
|
+
avg: {
|
|
2695
|
+
minArgs: 1,
|
|
2696
|
+
maxArgs: INF,
|
|
2697
|
+
apply: (args) => {
|
|
2698
|
+
const nums = allFiniteNumbers(args, "avg");
|
|
2699
|
+
return finiteResult(nums.reduce((acc, v) => acc + v, 0) / nums.length, "avg");
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
sum: {
|
|
2703
|
+
minArgs: 1,
|
|
2704
|
+
maxArgs: INF,
|
|
2705
|
+
apply: (args) => finiteResult(allFiniteNumbers(args, "sum").reduce((acc, v) => acc + v, 0), "sum")
|
|
2706
|
+
},
|
|
2707
|
+
coalesce: {
|
|
2708
|
+
minArgs: 1,
|
|
2709
|
+
maxArgs: INF,
|
|
2710
|
+
apply: (args) => {
|
|
2711
|
+
for (const a of args) if (a !== null) return a;
|
|
2712
|
+
return null;
|
|
2713
|
+
}
|
|
2714
|
+
},
|
|
2715
|
+
age: {
|
|
2716
|
+
minArgs: 2,
|
|
2717
|
+
maxArgs: 2,
|
|
2718
|
+
apply: (args) => finiteResult(asFiniteNumber(args[0], "age", 0) - asFiniteNumber(args[1], "age", 1), "age")
|
|
2719
|
+
},
|
|
2720
|
+
convert: {
|
|
2721
|
+
minArgs: 3,
|
|
2722
|
+
maxArgs: 3,
|
|
2723
|
+
apply: (args, hooks) => {
|
|
2724
|
+
const x = asFiniteNumber(args[0], "convert", 0);
|
|
2725
|
+
const from = asString$1(args[1], "convert", 1).trim();
|
|
2726
|
+
const to = asString$1(args[2], "convert", 2).trim();
|
|
2727
|
+
if (hooks.convert) {
|
|
2728
|
+
const out = hooks.convert(x, from, to);
|
|
2729
|
+
if (out === null) throw new ExpressionEvalError(`convert: cannot convert '${from}' to '${to}'`);
|
|
2730
|
+
return finiteResult(out, "convert");
|
|
2731
|
+
}
|
|
2732
|
+
if (from === to) return x;
|
|
2733
|
+
throw new ExpressionEvalError("convert: unit conversion table not installed");
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
/** Frozen, null-prototype builtin table. */
|
|
2738
|
+
var EXPRESSION_BUILTINS = Object.freeze(Object.assign(Object.create(null), table));
|
|
2739
|
+
/** The set of valid builtin names — used by the parser to reject unknown
|
|
2740
|
+
* callees at parse time (immediate author feedback). */
|
|
2741
|
+
var EXPRESSION_BUILTIN_NAMES = new Set(Object.keys(table));
|
|
2742
|
+
//#endregion
|
|
2743
|
+
//#region src/expression/parser.ts
|
|
2744
|
+
/**
|
|
2745
|
+
* Pratt (precedence-climbing) parser for the safe expression mini-language.
|
|
2746
|
+
*
|
|
2747
|
+
* Precedence (low → high): ternary `?:` (right-assoc) → `||` → `&&` → equality
|
|
2748
|
+
* → relational → additive → multiplicative → unary `! -` → call / primary.
|
|
2749
|
+
* Calls are ONLY `IDENT '(' args? ')'` at primary position — the callee is a
|
|
2750
|
+
* string validated against the builtin table at parse time, so an unknown
|
|
2751
|
+
* function is rejected immediately (author feedback) and a persisted expression
|
|
2752
|
+
* that references a since-removed builtin degrades at read.
|
|
2753
|
+
*
|
|
2754
|
+
* A node counter caps total AST size (`MAX_EXPRESSION_AST_NODES`) and call
|
|
2755
|
+
* arity is capped (`MAX_EXPRESSION_CALL_ARGS`) — both raise `ExpressionParseError`.
|
|
2756
|
+
*/
|
|
2757
|
+
/** Binary/logical operator precedence (higher binds tighter). */
|
|
2758
|
+
var BINARY_PRECEDENCE = {
|
|
2759
|
+
"||": 1,
|
|
2760
|
+
"&&": 2,
|
|
2761
|
+
"==": 3,
|
|
2762
|
+
"!=": 3,
|
|
2763
|
+
"<": 4,
|
|
2764
|
+
"<=": 4,
|
|
2765
|
+
">": 4,
|
|
2766
|
+
">=": 4,
|
|
2767
|
+
"+": 5,
|
|
2768
|
+
"-": 5,
|
|
2769
|
+
"*": 6,
|
|
2770
|
+
"/": 6,
|
|
2771
|
+
"%": 6
|
|
2772
|
+
};
|
|
2773
|
+
function isLogicalOp(op) {
|
|
2774
|
+
return op === "&&" || op === "||";
|
|
2775
|
+
}
|
|
2776
|
+
function isBinaryOp(op) {
|
|
2777
|
+
return op === "+" || op === "-" || op === "*" || op === "/" || op === "%" || op === "==" || op === "!=" || op === "<" || op === "<=" || op === ">" || op === ">=";
|
|
2778
|
+
}
|
|
2779
|
+
var Parser = class {
|
|
2780
|
+
tokens;
|
|
2781
|
+
pos = 0;
|
|
2782
|
+
nodeCount = 0;
|
|
2783
|
+
identifiers = /* @__PURE__ */ new Set();
|
|
2784
|
+
callees = /* @__PURE__ */ new Set();
|
|
2785
|
+
constructor(tokens) {
|
|
2786
|
+
this.tokens = tokens;
|
|
2787
|
+
}
|
|
2788
|
+
parse() {
|
|
2789
|
+
const ast = this.parseTernary();
|
|
2790
|
+
const tok = this.peek();
|
|
2791
|
+
if (tok.type !== "eof") throw new ExpressionParseError("unexpected trailing input", tok.pos);
|
|
2792
|
+
return {
|
|
2793
|
+
ast,
|
|
2794
|
+
identifiers: this.identifiers,
|
|
2795
|
+
callees: this.callees,
|
|
2796
|
+
nodeCount: this.nodeCount
|
|
2797
|
+
};
|
|
2798
|
+
}
|
|
2799
|
+
peek() {
|
|
2800
|
+
return this.tokens[this.pos];
|
|
2801
|
+
}
|
|
2802
|
+
next() {
|
|
2803
|
+
return this.tokens[this.pos++];
|
|
2804
|
+
}
|
|
2805
|
+
/** Consume a punctuator token, erroring if the next token isn't it. */
|
|
2806
|
+
expectPunct(punct) {
|
|
2807
|
+
const tok = this.peek();
|
|
2808
|
+
if (tok.type !== "punct" || tok.punct !== punct) throw new ExpressionParseError(`expected '${punct}'`, tok.pos);
|
|
2809
|
+
this.pos += 1;
|
|
2810
|
+
}
|
|
2811
|
+
matchPunct(punct) {
|
|
2812
|
+
const tok = this.peek();
|
|
2813
|
+
if (tok.type === "punct" && tok.punct === punct) {
|
|
2814
|
+
this.pos += 1;
|
|
2815
|
+
return true;
|
|
2816
|
+
}
|
|
2817
|
+
return false;
|
|
2818
|
+
}
|
|
2819
|
+
countNode() {
|
|
2820
|
+
this.nodeCount += 1;
|
|
2821
|
+
if (this.nodeCount > 256) throw new ExpressionParseError("expression too complex", this.peek().pos);
|
|
2822
|
+
}
|
|
2823
|
+
parseTernary() {
|
|
2824
|
+
const test = this.parseBinary(1);
|
|
2825
|
+
if (this.matchPunct("?")) {
|
|
2826
|
+
const consequent = this.parseTernary();
|
|
2827
|
+
this.expectPunct(":");
|
|
2828
|
+
const alternate = this.parseTernary();
|
|
2829
|
+
this.countNode();
|
|
2830
|
+
return {
|
|
2831
|
+
kind: "conditional",
|
|
2832
|
+
test,
|
|
2833
|
+
consequent,
|
|
2834
|
+
alternate
|
|
2835
|
+
};
|
|
2836
|
+
}
|
|
2837
|
+
return test;
|
|
2838
|
+
}
|
|
2839
|
+
parseBinary(minPrec) {
|
|
2840
|
+
let left = this.parseUnary();
|
|
2841
|
+
for (;;) {
|
|
2842
|
+
const tok = this.peek();
|
|
2843
|
+
if (tok.type !== "punct") break;
|
|
2844
|
+
const prec = BINARY_PRECEDENCE[tok.punct];
|
|
2845
|
+
if (prec === void 0 || prec < minPrec) break;
|
|
2846
|
+
const op = tok.punct;
|
|
2847
|
+
this.pos += 1;
|
|
2848
|
+
const right = this.parseBinary(prec + 1);
|
|
2849
|
+
this.countNode();
|
|
2850
|
+
if (isLogicalOp(op)) left = {
|
|
2851
|
+
kind: "logical",
|
|
2852
|
+
op,
|
|
2853
|
+
left,
|
|
2854
|
+
right
|
|
2855
|
+
};
|
|
2856
|
+
else if (isBinaryOp(op)) left = {
|
|
2857
|
+
kind: "binary",
|
|
2858
|
+
op,
|
|
2859
|
+
left,
|
|
2860
|
+
right
|
|
2861
|
+
};
|
|
2862
|
+
else throw new ExpressionParseError(`unexpected operator '${op}'`, tok.pos);
|
|
2863
|
+
}
|
|
2864
|
+
return left;
|
|
2865
|
+
}
|
|
2866
|
+
parseUnary() {
|
|
2867
|
+
const tok = this.peek();
|
|
2868
|
+
if (tok.type === "punct" && (tok.punct === "!" || tok.punct === "-")) {
|
|
2869
|
+
const op = tok.punct;
|
|
2870
|
+
this.pos += 1;
|
|
2871
|
+
const operand = this.parseUnary();
|
|
2872
|
+
this.countNode();
|
|
2873
|
+
return {
|
|
2874
|
+
kind: "unary",
|
|
2875
|
+
op,
|
|
2876
|
+
operand
|
|
2877
|
+
};
|
|
2878
|
+
}
|
|
2879
|
+
return this.parsePrimary();
|
|
2880
|
+
}
|
|
2881
|
+
parsePrimary() {
|
|
2882
|
+
const tok = this.next();
|
|
2883
|
+
switch (tok.type) {
|
|
2884
|
+
case "number":
|
|
2885
|
+
this.countNode();
|
|
2886
|
+
return {
|
|
2887
|
+
kind: "literal",
|
|
2888
|
+
value: tok.value
|
|
2889
|
+
};
|
|
2890
|
+
case "string":
|
|
2891
|
+
this.countNode();
|
|
2892
|
+
return {
|
|
2893
|
+
kind: "literal",
|
|
2894
|
+
value: tok.value
|
|
2895
|
+
};
|
|
2896
|
+
case "keyword":
|
|
2897
|
+
this.countNode();
|
|
2898
|
+
return {
|
|
2899
|
+
kind: "literal",
|
|
2900
|
+
value: tok.keyword === "null" ? null : tok.keyword === "true"
|
|
2901
|
+
};
|
|
2902
|
+
case "identifier": {
|
|
2903
|
+
const nextTok = this.peek();
|
|
2904
|
+
if (nextTok.type === "punct" && nextTok.punct === "(") return this.parseCall(tok.name, tok.pos);
|
|
2905
|
+
this.identifiers.add(tok.name);
|
|
2906
|
+
this.countNode();
|
|
2907
|
+
return {
|
|
2908
|
+
kind: "identifier",
|
|
2909
|
+
name: tok.name
|
|
2910
|
+
};
|
|
2911
|
+
}
|
|
2912
|
+
case "punct":
|
|
2913
|
+
if (tok.punct === "(") {
|
|
2914
|
+
const inner = this.parseTernary();
|
|
2915
|
+
this.expectPunct(")");
|
|
2916
|
+
return inner;
|
|
2917
|
+
}
|
|
2918
|
+
throw new ExpressionParseError(`unexpected token '${tok.punct}'`, tok.pos);
|
|
2919
|
+
case "eof": throw new ExpressionParseError("unexpected end of expression", tok.pos);
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
parseCall(callee, pos) {
|
|
2923
|
+
if (!EXPRESSION_BUILTIN_NAMES.has(callee)) throw new ExpressionParseError(`unknown function '${callee}'`, pos);
|
|
2924
|
+
this.expectPunct("(");
|
|
2925
|
+
const args = [];
|
|
2926
|
+
if (!this.matchPunct(")")) for (;;) {
|
|
2927
|
+
args.push(this.parseTernary());
|
|
2928
|
+
if (args.length > 16) throw new ExpressionParseError(`too many arguments to '${callee}'`, pos);
|
|
2929
|
+
if (this.matchPunct(",")) continue;
|
|
2930
|
+
this.expectPunct(")");
|
|
2931
|
+
break;
|
|
2932
|
+
}
|
|
2933
|
+
this.callees.add(callee);
|
|
2934
|
+
this.countNode();
|
|
2935
|
+
return {
|
|
2936
|
+
kind: "call",
|
|
2937
|
+
callee,
|
|
2938
|
+
args
|
|
2939
|
+
};
|
|
2940
|
+
}
|
|
2941
|
+
};
|
|
2942
|
+
/** Tokenize + parse `source` into a validated `ParsedExpression`. Throws
|
|
2943
|
+
* `ExpressionParseError` on any lexical or grammatical failure. */
|
|
2944
|
+
function parseExpression(source) {
|
|
2945
|
+
return new Parser(tokenize(source)).parse();
|
|
2946
|
+
}
|
|
2947
|
+
//#endregion
|
|
2948
|
+
//#region src/expression/evaluator.ts
|
|
2949
|
+
/**
|
|
2950
|
+
* Tree-walking evaluator for the safe expression mini-language.
|
|
2951
|
+
*
|
|
2952
|
+
* SECURITY (spec §4 rule 2/5):
|
|
2953
|
+
* - The scope is an `Object.create(null)` copy of ONLY the caller's own
|
|
2954
|
+
* enumerable binding entries, so `name in scope` is a pure own-key check and
|
|
2955
|
+
* `constructor` / `__proto__` / `toString` are plain unknown identifiers.
|
|
2956
|
+
* - Performs ZERO I/O and never touches `globalThis` / `Date` / `Math`
|
|
2957
|
+
* directly — the only external calls are into the frozen builtin table.
|
|
2958
|
+
* - The grammar has no loops/recursion/lambdas, so a walk is O(nodeCount) by
|
|
2959
|
+
* construction; the step counter is defense-in-depth for a crafted max-size
|
|
2960
|
+
* AST. Nothing blocks: there are no timers, awaits or unbounded loops.
|
|
2961
|
+
*/
|
|
2962
|
+
var EMPTY_HOOKS = Object.freeze({});
|
|
2963
|
+
/** Build a null-prototype scope from own-enumerable binding entries. Inherited
|
|
2964
|
+
* keys of the input (e.g. from a `{__proto__: {...}}` payload) are NOT copied,
|
|
2965
|
+
* so nothing smuggles in via the prototype chain. */
|
|
2966
|
+
function createExpressionScope(bindings) {
|
|
2967
|
+
const scope = Object.create(null);
|
|
2968
|
+
for (const key of Object.keys(bindings)) if (Object.prototype.hasOwnProperty.call(bindings, key)) scope[key] = bindings[key];
|
|
2969
|
+
return scope;
|
|
2970
|
+
}
|
|
2971
|
+
function isFiniteNumber(value) {
|
|
2972
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
2973
|
+
}
|
|
2974
|
+
/** JS truthiness of a primitive value. */
|
|
2975
|
+
function truthy(value) {
|
|
2976
|
+
return Boolean(value);
|
|
2977
|
+
}
|
|
2978
|
+
function requireFinite(value, context) {
|
|
2979
|
+
if (!Number.isFinite(value)) throw new ExpressionEvalError(`${context} produced a non-finite result`);
|
|
2980
|
+
return value;
|
|
2981
|
+
}
|
|
2982
|
+
function step(ctx) {
|
|
2983
|
+
ctx.steps += 1;
|
|
2984
|
+
if (ctx.steps > ctx.maxSteps) throw new ExpressionEvalError("expression evaluation step budget exceeded");
|
|
2985
|
+
}
|
|
2986
|
+
function evalNode(node, ctx) {
|
|
2987
|
+
step(ctx);
|
|
2988
|
+
switch (node.kind) {
|
|
2989
|
+
case "literal": return node.value;
|
|
2990
|
+
case "identifier":
|
|
2991
|
+
if (!(node.name in ctx.scope)) throw new ExpressionEvalError(`unknown identifier: ${node.name}`);
|
|
2992
|
+
return ctx.scope[node.name];
|
|
2993
|
+
case "unary": return evalUnary(node.op, evalNode(node.operand, ctx));
|
|
2994
|
+
case "binary": return evalBinary(node.op, evalNode(node.left, ctx), evalNode(node.right, ctx));
|
|
2995
|
+
case "logical": {
|
|
2996
|
+
const left = evalNode(node.left, ctx);
|
|
2997
|
+
if (node.op === "&&") return truthy(left) ? evalNode(node.right, ctx) : left;
|
|
2998
|
+
return truthy(left) ? left : evalNode(node.right, ctx);
|
|
2999
|
+
}
|
|
3000
|
+
case "conditional": return truthy(evalNode(node.test, ctx)) ? evalNode(node.consequent, ctx) : evalNode(node.alternate, ctx);
|
|
3001
|
+
case "call": return evalCall(node.callee, node.args.map((a) => evalNode(a, ctx)), ctx.hooks);
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
function evalUnary(op, operand) {
|
|
3005
|
+
if (op === "!") return !truthy(operand);
|
|
3006
|
+
if (!isFiniteNumber(operand)) throw new ExpressionEvalError("unary \"-\" requires a finite number");
|
|
3007
|
+
return requireFinite(-operand, "unary \"-\"");
|
|
3008
|
+
}
|
|
3009
|
+
function evalBinary(op, left, right) {
|
|
3010
|
+
switch (op) {
|
|
3011
|
+
case "==": return left === right;
|
|
3012
|
+
case "!=": return left !== right;
|
|
3013
|
+
case "+":
|
|
3014
|
+
if (typeof left === "string" && typeof right === "string") return left + right;
|
|
3015
|
+
if (isFiniteNumber(left) && isFiniteNumber(right)) return requireFinite(left + right, "\"+\"");
|
|
3016
|
+
throw new ExpressionEvalError("\"+\" requires two numbers or two strings");
|
|
3017
|
+
case "-":
|
|
3018
|
+
case "*":
|
|
3019
|
+
case "/":
|
|
3020
|
+
case "%":
|
|
3021
|
+
if (!isFiniteNumber(left) || !isFiniteNumber(right)) throw new ExpressionEvalError(`"${op}" requires two finite numbers`);
|
|
3022
|
+
return requireFinite(op === "-" ? left - right : op === "*" ? left * right : op === "/" ? left / right : left % right, `"${op}"`);
|
|
3023
|
+
case "<":
|
|
3024
|
+
case "<=":
|
|
3025
|
+
case ">":
|
|
3026
|
+
case ">=":
|
|
3027
|
+
if (isFiniteNumber(left) && isFiniteNumber(right)) return op === "<" ? left < right : op === "<=" ? left <= right : op === ">" ? left > right : left >= right;
|
|
3028
|
+
if (typeof left === "string" && typeof right === "string") return op === "<" ? left < right : op === "<=" ? left <= right : op === ">" ? left > right : left >= right;
|
|
3029
|
+
throw new ExpressionEvalError(`"${op}" requires two numbers or two strings`);
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
function evalCall(callee, args, hooks) {
|
|
3033
|
+
if (!Object.prototype.hasOwnProperty.call(EXPRESSION_BUILTINS, callee)) throw new ExpressionEvalError(`unknown function: ${callee}`);
|
|
3034
|
+
const builtin = EXPRESSION_BUILTINS[callee];
|
|
3035
|
+
if (args.length < builtin.minArgs || args.length > builtin.maxArgs) throw new ExpressionEvalError(`${callee}: wrong number of arguments (${args.length})`);
|
|
3036
|
+
return builtin.apply(args, hooks);
|
|
3037
|
+
}
|
|
3038
|
+
/** Evaluate an AST node against a scope. Throws `ExpressionEvalError` on any
|
|
3039
|
+
* runtime failure (unknown identifier, type mismatch, non-finite result,
|
|
3040
|
+
* step-budget exhaustion). */
|
|
3041
|
+
function evaluateAst(node, scope, opts) {
|
|
3042
|
+
return evalNode(node, {
|
|
3043
|
+
scope,
|
|
3044
|
+
hooks: opts?.hooks ?? EMPTY_HOOKS,
|
|
3045
|
+
maxSteps: opts?.maxSteps ?? 4096,
|
|
3046
|
+
steps: 0
|
|
3047
|
+
});
|
|
3048
|
+
}
|
|
3049
|
+
//#endregion
|
|
3050
|
+
//#region src/expression/compile.ts
|
|
3051
|
+
/**
|
|
3052
|
+
* LRU compile cache for parsed expressions (spec §2.4 "parse once … LRU keyed
|
|
3053
|
+
* by expr"). The cache stores BOTH successes and failures (negative caching),
|
|
3054
|
+
* so a corrupt persisted string costs exactly one tokenize+parse total — not
|
|
3055
|
+
* one per read on a hot resolve path.
|
|
3056
|
+
*
|
|
3057
|
+
* The cache is a module-level singleton: entries are pure, content-addressed
|
|
3058
|
+
* ASTs keyed by the raw source string, so sharing one instance across all
|
|
3059
|
+
* callers is safe and maximises hit rate.
|
|
3060
|
+
*/
|
|
3061
|
+
var cache = /* @__PURE__ */ new Map();
|
|
3062
|
+
function getCached(source) {
|
|
3063
|
+
const hit = cache.get(source);
|
|
3064
|
+
if (hit !== void 0) {
|
|
3065
|
+
cache.delete(source);
|
|
3066
|
+
cache.set(source, hit);
|
|
3067
|
+
return hit;
|
|
3068
|
+
}
|
|
3069
|
+
let result;
|
|
3070
|
+
try {
|
|
3071
|
+
result = {
|
|
3072
|
+
ok: true,
|
|
3073
|
+
parsed: parseExpression(source)
|
|
3074
|
+
};
|
|
3075
|
+
} catch (err) {
|
|
3076
|
+
result = {
|
|
3077
|
+
ok: false,
|
|
3078
|
+
error: err instanceof ExpressionParseError ? err.message : String(err)
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3081
|
+
cache.set(source, result);
|
|
3082
|
+
if (cache.size > 256) {
|
|
3083
|
+
const oldest = cache.keys().next().value;
|
|
3084
|
+
if (oldest !== void 0) cache.delete(oldest);
|
|
3085
|
+
}
|
|
3086
|
+
return result;
|
|
3087
|
+
}
|
|
3088
|
+
/** Compile `source` to a `ParsedExpression`, throwing `ExpressionParseError`
|
|
3089
|
+
* on failure. LRU/negative-cached. */
|
|
3090
|
+
function compileExpression(source) {
|
|
3091
|
+
const result = getCached(source);
|
|
3092
|
+
if (result.ok) return result.parsed;
|
|
3093
|
+
throw new ExpressionParseError(result.error);
|
|
3094
|
+
}
|
|
3095
|
+
/** Compile `source`, returning a discriminated result instead of throwing.
|
|
3096
|
+
* Used by read paths that must degrade rather than raise. LRU/negative-cached. */
|
|
3097
|
+
function compileExpressionSafe(source) {
|
|
3098
|
+
return getCached(source);
|
|
3099
|
+
}
|
|
3100
|
+
//#endregion
|
|
3101
|
+
//#region src/expression/link-expression.ts
|
|
3102
|
+
/**
|
|
3103
|
+
* DeviceLink-facing helpers for the expression engine — the single seam both
|
|
3104
|
+
* resolver channels (async provider-read + sync mirror) and the wire-schema
|
|
3105
|
+
* `superRefine` share, so validation and evaluation semantics stay identical
|
|
3106
|
+
* everywhere.
|
|
3107
|
+
*/
|
|
3108
|
+
/** The `now` epoch-ms binding is auto-injected into every evaluation and is a
|
|
3109
|
+
* reserved binding name (authors may not rebind it). */
|
|
3110
|
+
var EXPRESSION_INJECTED_NOW = "now";
|
|
3111
|
+
/**
|
|
3112
|
+
* Coerce an untrusted `getByPath` / mirror read to an `ExpressionValue`.
|
|
3113
|
+
* Non-primitive values (objects, arrays, `undefined`, functions, bigint,
|
|
3114
|
+
* symbol) and non-finite numbers become `undefined` so the caller can apply
|
|
3115
|
+
* its binding-miss policy (→ `null`). `null` itself is a valid value.
|
|
3116
|
+
*/
|
|
3117
|
+
function toExpressionValue(raw) {
|
|
3118
|
+
if (raw === null) return null;
|
|
3119
|
+
if (typeof raw === "string") return raw;
|
|
3120
|
+
if (typeof raw === "boolean") return raw;
|
|
3121
|
+
if (typeof raw === "number") return Number.isFinite(raw) ? raw : void 0;
|
|
3122
|
+
}
|
|
3123
|
+
/**
|
|
3124
|
+
* Author-time validation. Returns `null` when the source is valid, else a
|
|
3125
|
+
* human-readable error message. Checks: the expression compiles; binding count
|
|
3126
|
+
* is within `MAX_EXPRESSION_BINDINGS`; every binding name is a legal identifier,
|
|
3127
|
+
* is not reserved (`now`/keywords) and does not shadow a builtin; and every
|
|
3128
|
+
* FREE identifier of the AST is covered by a binding or the injected `now`.
|
|
3129
|
+
*/
|
|
3130
|
+
function validateExpressionSource(src) {
|
|
3131
|
+
const names = Object.keys(src.bindings);
|
|
3132
|
+
if (names.length > 32) return `too many bindings (${names.length} > 32)`;
|
|
3133
|
+
for (const name of names) {
|
|
3134
|
+
if (!EXPRESSION_IDENTIFIER_RE.test(name)) return `invalid binding name '${name}'`;
|
|
3135
|
+
if (RESERVED_BINDING_NAMES.has(name)) return `binding name '${name}' is reserved`;
|
|
3136
|
+
if (EXPRESSION_BUILTIN_NAMES.has(name)) return `binding name '${name}' shadows a builtin function`;
|
|
3137
|
+
}
|
|
3138
|
+
const compiled = compileExpressionSafe(src.expr);
|
|
3139
|
+
if (!compiled.ok) return compiled.error;
|
|
3140
|
+
const bound = new Set(names);
|
|
3141
|
+
for (const id of compiled.parsed.identifiers) {
|
|
3142
|
+
if (id === "now") continue;
|
|
3143
|
+
if (!bound.has(id)) return `expression references unbound identifier '${id}'`;
|
|
3144
|
+
}
|
|
3145
|
+
return null;
|
|
3146
|
+
}
|
|
3147
|
+
/**
|
|
3148
|
+
* Shared read-path evaluation for BOTH resolver channels. Builds a null-proto
|
|
3149
|
+
* scope from `bindingValues` plus the injected `now` (supplied by the caller
|
|
3150
|
+
* for determinism/testability), compiles via the LRU, and evaluates. Any
|
|
3151
|
+
* failure (parse or eval) returns `{ ok: false }` — the caller treats that as
|
|
3152
|
+
* "skip this link".
|
|
3153
|
+
*/
|
|
3154
|
+
function evaluateLinkExpression(expr, bindingValues, now, opts) {
|
|
3155
|
+
const compiled = compileExpressionSafe(expr);
|
|
3156
|
+
if (!compiled.ok) return {
|
|
3157
|
+
ok: false,
|
|
3158
|
+
error: compiled.error
|
|
3159
|
+
};
|
|
3160
|
+
const scope = createExpressionScope({
|
|
3161
|
+
...bindingValues,
|
|
3162
|
+
["now"]: now
|
|
3163
|
+
});
|
|
3164
|
+
try {
|
|
3165
|
+
return {
|
|
3166
|
+
ok: true,
|
|
3167
|
+
value: evaluateAst(compiled.parsed.ast, scope, opts)
|
|
3168
|
+
};
|
|
3169
|
+
} catch (err) {
|
|
3170
|
+
return {
|
|
3171
|
+
ok: false,
|
|
3172
|
+
error: err instanceof ExpressionEvalError ? err.message : String(err)
|
|
3173
|
+
};
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
//#endregion
|
|
2396
3177
|
//#region src/device/accessory.ts
|
|
2397
3178
|
/**
|
|
2398
3179
|
* Accessory device helpers — shared across drivers.
|
|
@@ -3573,7 +4354,13 @@ onStatusChanged: { data: z.object({
|
|
|
3573
4354
|
}) } },
|
|
3574
4355
|
status: {
|
|
3575
4356
|
schema: BatteryStatusSchema,
|
|
3576
|
-
kind: "push"
|
|
4357
|
+
kind: "push",
|
|
4358
|
+
empty: {
|
|
4359
|
+
percentage: 0,
|
|
4360
|
+
charging: "none",
|
|
4361
|
+
sleeping: false,
|
|
4362
|
+
lastUpdated: 0
|
|
4363
|
+
}
|
|
3577
4364
|
},
|
|
3578
4365
|
/**
|
|
3579
4366
|
* Runtime-state slice — every provider that registers this cap
|
|
@@ -4753,7 +5540,25 @@ reset: method(z.object({
|
|
|
4753
5540
|
}) },
|
|
4754
5541
|
status: {
|
|
4755
5542
|
schema: ConsumablesStatusSchema,
|
|
4756
|
-
kind: "push"
|
|
5543
|
+
kind: "push",
|
|
5544
|
+
empty: {
|
|
5545
|
+
items: [],
|
|
5546
|
+
lastChangedAt: 0
|
|
5547
|
+
},
|
|
5548
|
+
itemArray: {
|
|
5549
|
+
path: "items",
|
|
5550
|
+
keyField: "key",
|
|
5551
|
+
labelField: "label",
|
|
5552
|
+
itemSchema: ConsumableItemSchema,
|
|
5553
|
+
emptyItem: {
|
|
5554
|
+
key: "",
|
|
5555
|
+
label: "",
|
|
5556
|
+
level: null,
|
|
5557
|
+
status: null,
|
|
5558
|
+
lastResetAt: null,
|
|
5559
|
+
resettable: false
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
4757
5562
|
},
|
|
4758
5563
|
runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: z.number() })
|
|
4759
5564
|
};
|
|
@@ -9608,6 +10413,334 @@ var BaseDevice = class {
|
|
|
9608
10413
|
}
|
|
9609
10414
|
};
|
|
9610
10415
|
//#endregion
|
|
10416
|
+
//#region src/units/unit-table.ts
|
|
10417
|
+
/**
|
|
10418
|
+
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
10419
|
+
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
10420
|
+
* `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
|
|
10421
|
+
* decimals). K derives from `°C = K − 273.15`.
|
|
10422
|
+
*/
|
|
10423
|
+
var UNIT_TABLE = {
|
|
10424
|
+
"°C": {
|
|
10425
|
+
dimension: "temperature",
|
|
10426
|
+
factor: 1,
|
|
10427
|
+
offset: 0
|
|
10428
|
+
},
|
|
10429
|
+
"°F": {
|
|
10430
|
+
dimension: "temperature",
|
|
10431
|
+
factor: 5 / 9,
|
|
10432
|
+
offset: -160 / 9
|
|
10433
|
+
},
|
|
10434
|
+
K: {
|
|
10435
|
+
dimension: "temperature",
|
|
10436
|
+
factor: 1,
|
|
10437
|
+
offset: -273.15
|
|
10438
|
+
},
|
|
10439
|
+
hPa: {
|
|
10440
|
+
dimension: "pressure",
|
|
10441
|
+
factor: 1,
|
|
10442
|
+
offset: 0
|
|
10443
|
+
},
|
|
10444
|
+
kPa: {
|
|
10445
|
+
dimension: "pressure",
|
|
10446
|
+
factor: 10,
|
|
10447
|
+
offset: 0
|
|
10448
|
+
},
|
|
10449
|
+
Pa: {
|
|
10450
|
+
dimension: "pressure",
|
|
10451
|
+
factor: .01,
|
|
10452
|
+
offset: 0
|
|
10453
|
+
},
|
|
10454
|
+
mbar: {
|
|
10455
|
+
dimension: "pressure",
|
|
10456
|
+
factor: 1,
|
|
10457
|
+
offset: 0
|
|
10458
|
+
},
|
|
10459
|
+
bar: {
|
|
10460
|
+
dimension: "pressure",
|
|
10461
|
+
factor: 1e3,
|
|
10462
|
+
offset: 0
|
|
10463
|
+
},
|
|
10464
|
+
inHg: {
|
|
10465
|
+
dimension: "pressure",
|
|
10466
|
+
factor: 33.8639,
|
|
10467
|
+
offset: 0
|
|
10468
|
+
},
|
|
10469
|
+
mmHg: {
|
|
10470
|
+
dimension: "pressure",
|
|
10471
|
+
factor: 1.33322,
|
|
10472
|
+
offset: 0
|
|
10473
|
+
},
|
|
10474
|
+
psi: {
|
|
10475
|
+
dimension: "pressure",
|
|
10476
|
+
factor: 68.9476,
|
|
10477
|
+
offset: 0
|
|
10478
|
+
},
|
|
10479
|
+
"m/s": {
|
|
10480
|
+
dimension: "speed",
|
|
10481
|
+
factor: 1,
|
|
10482
|
+
offset: 0
|
|
10483
|
+
},
|
|
10484
|
+
"km/h": {
|
|
10485
|
+
dimension: "speed",
|
|
10486
|
+
factor: 1 / 3.6,
|
|
10487
|
+
offset: 0
|
|
10488
|
+
},
|
|
10489
|
+
mph: {
|
|
10490
|
+
dimension: "speed",
|
|
10491
|
+
factor: .44704,
|
|
10492
|
+
offset: 0
|
|
10493
|
+
},
|
|
10494
|
+
kn: {
|
|
10495
|
+
dimension: "speed",
|
|
10496
|
+
factor: .514444,
|
|
10497
|
+
offset: 0
|
|
10498
|
+
},
|
|
10499
|
+
"mm/h": {
|
|
10500
|
+
dimension: "precipitation-rate",
|
|
10501
|
+
factor: 1,
|
|
10502
|
+
offset: 0
|
|
10503
|
+
},
|
|
10504
|
+
"in/h": {
|
|
10505
|
+
dimension: "precipitation-rate",
|
|
10506
|
+
factor: 25.4,
|
|
10507
|
+
offset: 0
|
|
10508
|
+
},
|
|
10509
|
+
m: {
|
|
10510
|
+
dimension: "length",
|
|
10511
|
+
factor: 1,
|
|
10512
|
+
offset: 0
|
|
10513
|
+
},
|
|
10514
|
+
mm: {
|
|
10515
|
+
dimension: "length",
|
|
10516
|
+
factor: .001,
|
|
10517
|
+
offset: 0
|
|
10518
|
+
},
|
|
10519
|
+
cm: {
|
|
10520
|
+
dimension: "length",
|
|
10521
|
+
factor: .01,
|
|
10522
|
+
offset: 0
|
|
10523
|
+
},
|
|
10524
|
+
km: {
|
|
10525
|
+
dimension: "length",
|
|
10526
|
+
factor: 1e3,
|
|
10527
|
+
offset: 0
|
|
10528
|
+
},
|
|
10529
|
+
in: {
|
|
10530
|
+
dimension: "length",
|
|
10531
|
+
factor: .0254,
|
|
10532
|
+
offset: 0
|
|
10533
|
+
},
|
|
10534
|
+
ft: {
|
|
10535
|
+
dimension: "length",
|
|
10536
|
+
factor: .3048,
|
|
10537
|
+
offset: 0
|
|
10538
|
+
},
|
|
10539
|
+
mi: {
|
|
10540
|
+
dimension: "length",
|
|
10541
|
+
factor: 1609.344,
|
|
10542
|
+
offset: 0
|
|
10543
|
+
},
|
|
10544
|
+
lx: {
|
|
10545
|
+
dimension: "illuminance",
|
|
10546
|
+
factor: 1,
|
|
10547
|
+
offset: 0
|
|
10548
|
+
},
|
|
10549
|
+
"W/m²": {
|
|
10550
|
+
dimension: "irradiance",
|
|
10551
|
+
factor: 1,
|
|
10552
|
+
offset: 0
|
|
10553
|
+
},
|
|
10554
|
+
W: {
|
|
10555
|
+
dimension: "power",
|
|
10556
|
+
factor: 1,
|
|
10557
|
+
offset: 0
|
|
10558
|
+
},
|
|
10559
|
+
kW: {
|
|
10560
|
+
dimension: "power",
|
|
10561
|
+
factor: 1e3,
|
|
10562
|
+
offset: 0
|
|
10563
|
+
},
|
|
10564
|
+
VA: {
|
|
10565
|
+
dimension: "apparent-power",
|
|
10566
|
+
factor: 1,
|
|
10567
|
+
offset: 0
|
|
10568
|
+
},
|
|
10569
|
+
Wh: {
|
|
10570
|
+
dimension: "energy",
|
|
10571
|
+
factor: 1,
|
|
10572
|
+
offset: 0
|
|
10573
|
+
},
|
|
10574
|
+
kWh: {
|
|
10575
|
+
dimension: "energy",
|
|
10576
|
+
factor: 1e3,
|
|
10577
|
+
offset: 0
|
|
10578
|
+
},
|
|
10579
|
+
MWh: {
|
|
10580
|
+
dimension: "energy",
|
|
10581
|
+
factor: 1e6,
|
|
10582
|
+
offset: 0
|
|
10583
|
+
},
|
|
10584
|
+
V: {
|
|
10585
|
+
dimension: "voltage",
|
|
10586
|
+
factor: 1,
|
|
10587
|
+
offset: 0
|
|
10588
|
+
},
|
|
10589
|
+
mV: {
|
|
10590
|
+
dimension: "voltage",
|
|
10591
|
+
factor: .001,
|
|
10592
|
+
offset: 0
|
|
10593
|
+
},
|
|
10594
|
+
A: {
|
|
10595
|
+
dimension: "current",
|
|
10596
|
+
factor: 1,
|
|
10597
|
+
offset: 0
|
|
10598
|
+
},
|
|
10599
|
+
mA: {
|
|
10600
|
+
dimension: "current",
|
|
10601
|
+
factor: .001,
|
|
10602
|
+
offset: 0
|
|
10603
|
+
},
|
|
10604
|
+
ppm: {
|
|
10605
|
+
dimension: "concentration-volume",
|
|
10606
|
+
factor: 1,
|
|
10607
|
+
offset: 0
|
|
10608
|
+
},
|
|
10609
|
+
ppb: {
|
|
10610
|
+
dimension: "concentration-volume",
|
|
10611
|
+
factor: .001,
|
|
10612
|
+
offset: 0
|
|
10613
|
+
},
|
|
10614
|
+
"µg/m³": {
|
|
10615
|
+
dimension: "concentration-mass",
|
|
10616
|
+
factor: 1,
|
|
10617
|
+
offset: 0
|
|
10618
|
+
},
|
|
10619
|
+
"mg/m³": {
|
|
10620
|
+
dimension: "concentration-mass",
|
|
10621
|
+
factor: 1e3,
|
|
10622
|
+
offset: 0
|
|
10623
|
+
},
|
|
10624
|
+
kg: {
|
|
10625
|
+
dimension: "mass",
|
|
10626
|
+
factor: 1,
|
|
10627
|
+
offset: 0
|
|
10628
|
+
},
|
|
10629
|
+
g: {
|
|
10630
|
+
dimension: "mass",
|
|
10631
|
+
factor: .001,
|
|
10632
|
+
offset: 0
|
|
10633
|
+
},
|
|
10634
|
+
lb: {
|
|
10635
|
+
dimension: "mass",
|
|
10636
|
+
factor: .453592,
|
|
10637
|
+
offset: 0
|
|
10638
|
+
},
|
|
10639
|
+
oz: {
|
|
10640
|
+
dimension: "mass",
|
|
10641
|
+
factor: .0283495,
|
|
10642
|
+
offset: 0
|
|
10643
|
+
},
|
|
10644
|
+
"%": {
|
|
10645
|
+
dimension: "percentage",
|
|
10646
|
+
factor: 1,
|
|
10647
|
+
offset: 0
|
|
10648
|
+
}
|
|
10649
|
+
};
|
|
10650
|
+
//#endregion
|
|
10651
|
+
//#region src/units/convert.ts
|
|
10652
|
+
/**
|
|
10653
|
+
* Pure unit-conversion API over `UNIT_TABLE`. No dependencies, no side effects.
|
|
10654
|
+
*
|
|
10655
|
+
* Conversion is refused (throws `UnitConversionError`, or returns `undefined`
|
|
10656
|
+
* from the `try*` variant) whenever a unit is unknown or the two units belong
|
|
10657
|
+
* to different dimensions — cross-dimension conversion is deliberately
|
|
10658
|
+
* impossible so a render override can never make the value and its unit label
|
|
10659
|
+
* disagree.
|
|
10660
|
+
*
|
|
10661
|
+
* Callers pass units through `normalizeUnit` (`../device/source-info.ts`) BEFORE
|
|
10662
|
+
* calling here — the table keys only canonical spellings.
|
|
10663
|
+
*/
|
|
10664
|
+
/** Thrown by `convertUnit` when a conversion is refused. Carries the offending
|
|
10665
|
+
* units + a machine-readable `reason` for callers that branch on the cause. */
|
|
10666
|
+
var UnitConversionError = class extends Error {
|
|
10667
|
+
from;
|
|
10668
|
+
to;
|
|
10669
|
+
reason;
|
|
10670
|
+
constructor(from, to, reason) {
|
|
10671
|
+
super(`[units] cannot convert '${from}' → '${to}': ${reason}`);
|
|
10672
|
+
this.name = "UnitConversionError";
|
|
10673
|
+
this.from = from;
|
|
10674
|
+
this.to = to;
|
|
10675
|
+
this.reason = reason;
|
|
10676
|
+
}
|
|
10677
|
+
};
|
|
10678
|
+
/** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
|
|
10679
|
+
function specFor(unit) {
|
|
10680
|
+
return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
|
|
10681
|
+
}
|
|
10682
|
+
/** The dimension a unit belongs to, or `undefined` for an unknown unit. */
|
|
10683
|
+
function unitDimension(unit) {
|
|
10684
|
+
return specFor(unit)?.dimension;
|
|
10685
|
+
}
|
|
10686
|
+
/** Value in `spec`'s unit → its dimension's canonical unit. */
|
|
10687
|
+
function toCanonical(value, spec) {
|
|
10688
|
+
return value * spec.factor + spec.offset;
|
|
10689
|
+
}
|
|
10690
|
+
/** Canonical-unit value → the unit described by `spec`. */
|
|
10691
|
+
function fromCanonical(canonical, spec) {
|
|
10692
|
+
return (canonical - spec.offset) / spec.factor;
|
|
10693
|
+
}
|
|
10694
|
+
/**
|
|
10695
|
+
* Convert `value` from unit `from` to unit `to`. Identity when `from === to`.
|
|
10696
|
+
* Throws `UnitConversionError` when either unit is unknown or the units belong
|
|
10697
|
+
* to different dimensions.
|
|
10698
|
+
*/
|
|
10699
|
+
function convertUnit(value, from, to) {
|
|
10700
|
+
if (from === to) return value;
|
|
10701
|
+
const fromSpec = specFor(from);
|
|
10702
|
+
if (!fromSpec) throw new UnitConversionError(from, to, "unknown-from");
|
|
10703
|
+
const toSpec = specFor(to);
|
|
10704
|
+
if (!toSpec) throw new UnitConversionError(from, to, "unknown-to");
|
|
10705
|
+
if (fromSpec.dimension !== toSpec.dimension) throw new UnitConversionError(from, to, "cross-dimension");
|
|
10706
|
+
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
10707
|
+
}
|
|
10708
|
+
/**
|
|
10709
|
+
* Graceful variant for the render path: returns the converted value, or
|
|
10710
|
+
* `undefined` when the conversion is refused (unknown unit / cross-dimension).
|
|
10711
|
+
* Never throws — a render caller falls back to the raw value + source unit.
|
|
10712
|
+
*/
|
|
10713
|
+
function tryConvertUnit(value, from, to) {
|
|
10714
|
+
if (from === to) return value;
|
|
10715
|
+
const fromSpec = specFor(from);
|
|
10716
|
+
if (!fromSpec) return void 0;
|
|
10717
|
+
const toSpec = specFor(to);
|
|
10718
|
+
if (!toSpec) return void 0;
|
|
10719
|
+
if (fromSpec.dimension !== toSpec.dimension) return void 0;
|
|
10720
|
+
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
10721
|
+
}
|
|
10722
|
+
/**
|
|
10723
|
+
* Whether `value` can be converted between `from` and `to` (same dimension,
|
|
10724
|
+
* both known). Cheap boolean probe for the UI's same-dimension unit picker and
|
|
10725
|
+
* the resolver's convertibility branch — compute ONCE so a unit label and its
|
|
10726
|
+
* value math can never disagree.
|
|
10727
|
+
*/
|
|
10728
|
+
function canConvertUnit(from, to) {
|
|
10729
|
+
if (from === to) return true;
|
|
10730
|
+
const fromDim = unitDimension(from);
|
|
10731
|
+
if (fromDim === void 0) return false;
|
|
10732
|
+
return fromDim === unitDimension(to);
|
|
10733
|
+
}
|
|
10734
|
+
/**
|
|
10735
|
+
* Every known unit spelling in a dimension (table insertion order — canonical
|
|
10736
|
+
* unit first). Powers the UI's same-dimension unit picker.
|
|
10737
|
+
*/
|
|
10738
|
+
function unitsForDimension(dimension) {
|
|
10739
|
+
const out = [];
|
|
10740
|
+
for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
|
|
10741
|
+
return out;
|
|
10742
|
+
}
|
|
10743
|
+
//#endregion
|
|
9611
10744
|
//#region src/capabilities/device-provider.cap.ts
|
|
9612
10745
|
var ProviderStatusSchema = z.object({
|
|
9613
10746
|
connected: z.boolean(),
|
|
@@ -10220,6 +11353,17 @@ function enumerateSchemaFields(schema, prefix = "") {
|
|
|
10220
11353
|
}
|
|
10221
11354
|
return out;
|
|
10222
11355
|
}
|
|
11356
|
+
/** Enumerate the per-item wireable fields of an item-array cap (see
|
|
11357
|
+
* `CapabilityStatusItemArray`): the item schema's leaf fields, minus the
|
|
11358
|
+
* `keyField` (the key comes from the link's `itemKey`, never from a wired
|
|
11359
|
+
* source), each tagged `item: true` so the authoring UI collects an
|
|
11360
|
+
* `itemKey` alongside the field. Never throws. */
|
|
11361
|
+
function enumerateItemArrayFields(itemArray) {
|
|
11362
|
+
return enumerateSchemaFields(itemArray.itemSchema).filter((f) => f.path !== itemArray.keyField).map((f) => ({
|
|
11363
|
+
...f,
|
|
11364
|
+
item: true
|
|
11365
|
+
}));
|
|
11366
|
+
}
|
|
10223
11367
|
//#endregion
|
|
10224
11368
|
//#region src/utils/zone-rule-eval.ts
|
|
10225
11369
|
/**
|
|
@@ -10455,6 +11599,8 @@ function createSystemProxy(api) {
|
|
|
10455
11599
|
registerDevice: (input) => dispatch("deviceManager", "registerDevice", "mutation", input),
|
|
10456
11600
|
removeDevice: (input) => dispatch("deviceManager", "removeDevice", "mutation", input),
|
|
10457
11601
|
persistConfig: (input) => dispatch("deviceManager", "persistConfig", "mutation", input),
|
|
11602
|
+
getRoleDisplayDefaults: (input) => dispatch("deviceManager", "getRoleDisplayDefaults", "query", input),
|
|
11603
|
+
setRoleDisplayDefaults: (input) => dispatch("deviceManager", "setRoleDisplayDefaults", "mutation", input),
|
|
10458
11604
|
listLocations: (input) => dispatch("deviceManager", "listLocations", "query", input),
|
|
10459
11605
|
addLocation: (input) => dispatch("deviceManager", "addLocation", "mutation", input),
|
|
10460
11606
|
removeLocation: (input) => dispatch("deviceManager", "removeLocation", "mutation", input),
|
|
@@ -13322,14 +14468,63 @@ var ChildLayoutEntrySchema = z.object({
|
|
|
13322
14468
|
collapsed: z.boolean().optional()
|
|
13323
14469
|
});
|
|
13324
14470
|
/** Cap-wire shape of a DeviceLink — structurally mirrors `DeviceLink` in
|
|
13325
|
-
* `device-management.ts`.
|
|
14471
|
+
* `device-management.ts`. Source is a union: a FIELD source copies a sibling
|
|
14472
|
+
* accessory's status field (`kind` optional/absent for wire compat); a
|
|
14473
|
+
* LITERAL source carries a per-device constant (no sibling is read); a
|
|
14474
|
+
* GLOBAL source (P2e) copies ANY device's status field, addressed by the
|
|
14475
|
+
* source device's full re-sync-stable `stableId`. */
|
|
14476
|
+
var DeviceLinkFieldSourceSchema = z.object({
|
|
14477
|
+
kind: z.literal("field").optional(),
|
|
14478
|
+
sourceKey: z.string(),
|
|
14479
|
+
cap: z.string(),
|
|
14480
|
+
fieldPath: z.string()
|
|
14481
|
+
});
|
|
14482
|
+
var DeviceLinkLiteralSourceSchema = z.object({
|
|
14483
|
+
kind: z.literal("literal"),
|
|
14484
|
+
value: z.union([
|
|
14485
|
+
z.string(),
|
|
14486
|
+
z.number(),
|
|
14487
|
+
z.boolean(),
|
|
14488
|
+
z.null()
|
|
14489
|
+
])
|
|
14490
|
+
});
|
|
14491
|
+
var DeviceLinkGlobalSourceSchema = z.object({
|
|
14492
|
+
kind: z.literal("global"),
|
|
14493
|
+
sourceStableId: z.string(),
|
|
14494
|
+
cap: z.string(),
|
|
14495
|
+
fieldPath: z.string()
|
|
14496
|
+
});
|
|
14497
|
+
/** Expression source (Stage X): compute the target field from N named bindings
|
|
14498
|
+
* via the safe expression engine. Bindings are field | literal | global — never
|
|
14499
|
+
* another expression (no nesting). The `superRefine` runs the SAME author-time
|
|
14500
|
+
* validation as `validateExpressionSource` (compiles the expr, checks binding
|
|
14501
|
+
* names + identifier coverage) so every wire boundary that parses a DeviceLink
|
|
14502
|
+
* (tRPC mount, kernel create pre-seed, projection output) validates-at-write.
|
|
14503
|
+
* Compiles are LRU-cached, so repeated validation of the same expr is a hit. */
|
|
14504
|
+
var DeviceLinkExpressionSourceSchema = z.object({
|
|
14505
|
+
kind: z.literal("expression"),
|
|
14506
|
+
expr: z.string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
|
|
14507
|
+
bindings: z.record(z.string().regex(EXPRESSION_IDENTIFIER_RE), z.union([
|
|
14508
|
+
DeviceLinkFieldSourceSchema,
|
|
14509
|
+
DeviceLinkLiteralSourceSchema,
|
|
14510
|
+
DeviceLinkGlobalSourceSchema
|
|
14511
|
+
]))
|
|
14512
|
+
}).superRefine((src, ctx) => {
|
|
14513
|
+
const err = validateExpressionSource(src);
|
|
14514
|
+
if (err !== null) ctx.addIssue({
|
|
14515
|
+
code: "custom",
|
|
14516
|
+
message: err,
|
|
14517
|
+
path: ["expr"]
|
|
14518
|
+
});
|
|
14519
|
+
});
|
|
13326
14520
|
var DeviceLinkSchema = z.object({
|
|
13327
14521
|
id: z.string(),
|
|
13328
|
-
source: z.
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
|
|
13332
|
-
|
|
14522
|
+
source: z.union([
|
|
14523
|
+
DeviceLinkFieldSourceSchema,
|
|
14524
|
+
DeviceLinkLiteralSourceSchema,
|
|
14525
|
+
DeviceLinkGlobalSourceSchema,
|
|
14526
|
+
DeviceLinkExpressionSourceSchema
|
|
14527
|
+
]),
|
|
13333
14528
|
target: z.object({
|
|
13334
14529
|
cap: z.string(),
|
|
13335
14530
|
fieldPath: z.string(),
|
|
@@ -13358,6 +14553,31 @@ var DeviceLinkSchema = z.object({
|
|
|
13358
14553
|
})
|
|
13359
14554
|
]).optional()
|
|
13360
14555
|
});
|
|
14556
|
+
/** Cap-wire shape of a per-cap display refinement — mirrors
|
|
14557
|
+
* `DeviceCapDisplayOverride` in `device-management.ts`. */
|
|
14558
|
+
var DeviceCapDisplayOverrideSchema = z.object({
|
|
14559
|
+
unit: z.string().min(1).optional(),
|
|
14560
|
+
precision: z.number().int().min(0).max(10).optional()
|
|
14561
|
+
});
|
|
14562
|
+
/** Cap-wire shape of an operator-authored per-device display override —
|
|
14563
|
+
* mirrors `DeviceDisplayOverride` in `device-management.ts`. `precision`
|
|
14564
|
+
* bounds mirror `numeric-sensor.cap.ts` (`int 0-10`). */
|
|
14565
|
+
var DeviceDisplayOverrideSchema = z.object({
|
|
14566
|
+
icon: z.string().min(1).optional(),
|
|
14567
|
+
label: z.string().min(1).optional(),
|
|
14568
|
+
unit: z.string().min(1).optional(),
|
|
14569
|
+
precision: z.number().int().min(0).max(10).optional(),
|
|
14570
|
+
hidden: z.boolean().optional(),
|
|
14571
|
+
perCap: z.record(z.string(), DeviceCapDisplayOverrideSchema).optional()
|
|
14572
|
+
});
|
|
14573
|
+
/** Cap-wire shape of a per-role display default — mirrors `RoleDisplayDefault`
|
|
14574
|
+
* in `device-management.ts`. Keyed by `DeviceRole` string (role strings cross
|
|
14575
|
+
* the wire as plain strings everywhere else — cf. `DeviceInfoSchema.role`). */
|
|
14576
|
+
var RoleDisplayDefaultSchema = z.object({
|
|
14577
|
+
unit: z.string().min(1).optional(),
|
|
14578
|
+
precision: z.number().int().min(0).max(10).optional(),
|
|
14579
|
+
icon: z.string().min(1).optional()
|
|
14580
|
+
});
|
|
13361
14581
|
/**
|
|
13362
14582
|
* Serializable projection of a live IDevice.
|
|
13363
14583
|
* Returned by listAll, getDevice, getChildren.
|
|
@@ -13413,7 +14633,9 @@ var DeviceInfoSchema = z.object({
|
|
|
13413
14633
|
* `DeviceMeta.childLayout`. Absent ⇒ no layout declared. */
|
|
13414
14634
|
childLayout: z.array(ChildLayoutEntrySchema).readonly().optional(),
|
|
13415
14635
|
/** Operator-authored cross-device field wirings. See `DeviceMeta.deviceLinks`. */
|
|
13416
|
-
deviceLinks: z.array(DeviceLinkSchema).readonly().optional()
|
|
14636
|
+
deviceLinks: z.array(DeviceLinkSchema).readonly().optional(),
|
|
14637
|
+
/** Operator-authored per-device display override. See `DeviceMeta.display`. */
|
|
14638
|
+
display: DeviceDisplayOverrideSchema.optional()
|
|
13417
14639
|
});
|
|
13418
14640
|
var ConfigEntrySchema = z.object({
|
|
13419
14641
|
key: z.string(),
|
|
@@ -13478,7 +14700,9 @@ var DeviceMetaSchema = z.object({
|
|
|
13478
14700
|
deviceLinks: z.array(DeviceLinkSchema).readonly().optional(),
|
|
13479
14701
|
/** Semantic role string (`DeviceRole`) — propagated from the spawn pre-seed.
|
|
13480
14702
|
* Optional: only present for accessory children that carry a known role. */
|
|
13481
|
-
role: z.string().nullable().optional()
|
|
14703
|
+
role: z.string().nullable().optional(),
|
|
14704
|
+
/** Operator-authored per-device display override. See `DeviceMeta.display`. */
|
|
14705
|
+
display: DeviceDisplayOverrideSchema.optional()
|
|
13482
14706
|
});
|
|
13483
14707
|
/** ConfigUISchema passed through as unknown — mirrors device-provider's CreationSchemaOutputSchema */
|
|
13484
14708
|
var ConfigUISchemaOutput = z.unknown().nullable();
|
|
@@ -13634,9 +14858,42 @@ var deviceManagerCapability = {
|
|
|
13634
14858
|
kind: "mutation",
|
|
13635
14859
|
auth: "admin"
|
|
13636
14860
|
}),
|
|
14861
|
+
/** Set (or clear) the per-device display override on the meta row. Mirrors
|
|
14862
|
+
* `setChildLayout` persistence; `null` clears the override entirely. The
|
|
14863
|
+
* override unit(s) are normalized (`normalizeUnit`) at write so the render
|
|
14864
|
+
* path's `UNIT_TABLE` lookups always hit canonical spellings. Persisted,
|
|
14865
|
+
* projected, and preserved across re-register/restore. Idempotent. */
|
|
14866
|
+
setDisplay: method(z.object({
|
|
14867
|
+
deviceId: z.number(),
|
|
14868
|
+
display: DeviceDisplayOverrideSchema.nullable()
|
|
14869
|
+
}), z.void(), {
|
|
14870
|
+
kind: "mutation",
|
|
14871
|
+
auth: "admin"
|
|
14872
|
+
}),
|
|
14873
|
+
/** Read the operator-authored per-role display defaults (unit/precision/
|
|
14874
|
+
* icon), keyed by `DeviceRole` string. Empty record when none set. */
|
|
14875
|
+
getRoleDisplayDefaults: method(z.object({}), z.object({ defaults: z.record(z.string(), RoleDisplayDefaultSchema) }), { kind: "query" }),
|
|
14876
|
+
/** Replace the per-role display defaults whole-record (full replace — the
|
|
14877
|
+
* caller sends the complete map). Override unit(s) are normalized at write.
|
|
14878
|
+
* Not per-device, so nothing is emitted; the UI invalidates its own query
|
|
14879
|
+
* on mutate. */
|
|
14880
|
+
setRoleDisplayDefaults: method(z.object({ defaults: z.record(z.string(), RoleDisplayDefaultSchema) }), z.void(), {
|
|
14881
|
+
kind: "mutation",
|
|
14882
|
+
auth: "admin"
|
|
14883
|
+
}),
|
|
13637
14884
|
/** List the wireable status-schema fields per cap bound to a device.
|
|
13638
|
-
* Powers the Wiring tab's field pickers. Caps without a status schema are
|
|
13639
|
-
|
|
14885
|
+
* Powers the Wiring tab's field pickers. Caps without a status schema are
|
|
14886
|
+
* omitted. Item-array caps (`status.itemArray`, e.g. consumables) also
|
|
14887
|
+
* emit their per-item fields tagged `item: true` (a link targeting one
|
|
14888
|
+
* must carry a `target.itemKey`) plus the cap-level `itemArray`
|
|
14889
|
+
* descriptor. `includeSynthesizable: true` (TARGET pickers only) unions
|
|
14890
|
+
* in unbound device-scoped caps that declare `status.empty` and match
|
|
14891
|
+
* the device's type — so the FIRST link to a synthesize-only cap
|
|
14892
|
+
* (consumables on an HA vacuum) can be authored. */
|
|
14893
|
+
getWireableFields: method(z.object({
|
|
14894
|
+
deviceId: z.number(),
|
|
14895
|
+
includeSynthesizable: z.boolean().optional()
|
|
14896
|
+
}), z.object({ caps: z.array(z.object({
|
|
13640
14897
|
cap: z.string(),
|
|
13641
14898
|
fields: z.array(z.object({
|
|
13642
14899
|
path: z.string(),
|
|
@@ -13646,8 +14903,13 @@ var deviceManagerCapability = {
|
|
|
13646
14903
|
"boolean",
|
|
13647
14904
|
"enum"
|
|
13648
14905
|
]),
|
|
13649
|
-
enumValues: z.array(z.string()).optional()
|
|
13650
|
-
|
|
14906
|
+
enumValues: z.array(z.string()).optional(),
|
|
14907
|
+
item: z.boolean().optional()
|
|
14908
|
+
})).readonly(),
|
|
14909
|
+
itemArray: z.object({
|
|
14910
|
+
path: z.string(),
|
|
14911
|
+
keyField: z.string()
|
|
14912
|
+
}).optional()
|
|
13651
14913
|
})).readonly() }), { kind: "query" }),
|
|
13652
14914
|
/** Stamp (or update) the semantic role on the device's meta row.
|
|
13653
14915
|
* Called by the kernel's `create()` / `spawnAccessoryChild` pre-seed
|
|
@@ -13798,7 +15060,11 @@ var deviceManagerCapability = {
|
|
|
13798
15060
|
deviceId: z.number(),
|
|
13799
15061
|
entries: z.array(z.object({
|
|
13800
15062
|
capName: z.string(),
|
|
13801
|
-
kind: z.enum([
|
|
15063
|
+
kind: z.enum([
|
|
15064
|
+
"native",
|
|
15065
|
+
"wrapped",
|
|
15066
|
+
"linked"
|
|
15067
|
+
]),
|
|
13802
15068
|
providerAddonId: z.string(),
|
|
13803
15069
|
providerNodeId: z.string(),
|
|
13804
15070
|
nativeAddonId: z.string()
|
|
@@ -13816,7 +15082,11 @@ var deviceManagerCapability = {
|
|
|
13816
15082
|
deviceId: z.number(),
|
|
13817
15083
|
entries: z.array(z.object({
|
|
13818
15084
|
capName: z.string(),
|
|
13819
|
-
kind: z.enum([
|
|
15085
|
+
kind: z.enum([
|
|
15086
|
+
"native",
|
|
15087
|
+
"wrapped",
|
|
15088
|
+
"linked"
|
|
15089
|
+
]),
|
|
13820
15090
|
providerAddonId: z.string(),
|
|
13821
15091
|
providerNodeId: z.string(),
|
|
13822
15092
|
nativeAddonId: z.string()
|
|
@@ -15704,7 +16974,10 @@ var pipelineOrchestratorCapability = {
|
|
|
15704
16974
|
methods: {
|
|
15705
16975
|
/**
|
|
15706
16976
|
* Pin a camera's pipeline to a specific agent (L1 affinity).
|
|
15707
|
-
* The orchestrator re-evaluates the assignment immediately
|
|
16977
|
+
* The orchestrator re-evaluates the assignment immediately and persists
|
|
16978
|
+
* the pin under the canonical `pipelineNodeId` device-store key (the
|
|
16979
|
+
* legacy `preferredAgent` key is nulled on write and kept only as a
|
|
16980
|
+
* read-only fallback for stores written before the unification).
|
|
15708
16981
|
*/
|
|
15709
16982
|
assignPipeline: method(z.object({
|
|
15710
16983
|
deviceId: z.number(),
|
|
@@ -15715,8 +16988,9 @@ var pipelineOrchestratorCapability = {
|
|
|
15715
16988
|
}),
|
|
15716
16989
|
/**
|
|
15717
16990
|
* Clear a camera's pipeline pin and let the auto-balancer re-pick
|
|
15718
|
-
* the optimal agent. The orchestrator persists
|
|
15719
|
-
*
|
|
16991
|
+
* the optimal agent. The orchestrator persists the canonical
|
|
16992
|
+
* `pipelineNodeId='auto'` (and nulls the legacy `preferredAgent`),
|
|
16993
|
+
* then re-runs the balancer with the
|
|
15720
16994
|
* cached `RunnerCameraConfig` and migrates only when the chosen
|
|
15721
16995
|
* node differs. The camera stays in `getPipelineAssignments()` —
|
|
15722
16996
|
* just with `pinned=false`. If no runner is currently available
|
|
@@ -22555,6 +23829,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
22555
23829
|
addonId: null,
|
|
22556
23830
|
access: "view"
|
|
22557
23831
|
},
|
|
23832
|
+
"deviceManager.getRoleDisplayDefaults": {
|
|
23833
|
+
capName: "device-manager",
|
|
23834
|
+
capScope: "system",
|
|
23835
|
+
addonId: null,
|
|
23836
|
+
access: "view"
|
|
23837
|
+
},
|
|
22558
23838
|
"deviceManager.getSettingsSchema": {
|
|
22559
23839
|
capName: "device-manager",
|
|
22560
23840
|
capScope: "system",
|
|
@@ -22705,6 +23985,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
22705
23985
|
addonId: null,
|
|
22706
23986
|
access: "create"
|
|
22707
23987
|
},
|
|
23988
|
+
"deviceManager.setDisplay": {
|
|
23989
|
+
capName: "device-manager",
|
|
23990
|
+
capScope: "system",
|
|
23991
|
+
addonId: null,
|
|
23992
|
+
access: "create"
|
|
23993
|
+
},
|
|
22708
23994
|
"deviceManager.setIntegrationId": {
|
|
22709
23995
|
capName: "device-manager",
|
|
22710
23996
|
capScope: "system",
|
|
@@ -22747,6 +24033,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
22747
24033
|
addonId: null,
|
|
22748
24034
|
access: "create"
|
|
22749
24035
|
},
|
|
24036
|
+
"deviceManager.setRoleDisplayDefaults": {
|
|
24037
|
+
capName: "device-manager",
|
|
24038
|
+
capScope: "system",
|
|
24039
|
+
addonId: null,
|
|
24040
|
+
access: "create"
|
|
24041
|
+
},
|
|
22750
24042
|
"deviceManager.setStreamProfileMap": {
|
|
22751
24043
|
capName: "device-manager",
|
|
22752
24044
|
capScope: "system",
|
|
@@ -26502,4 +27794,4 @@ function scoreRuntimes(hw) {
|
|
|
26502
27794
|
};
|
|
26503
27795
|
}
|
|
26504
27796
|
//#endregion
|
|
26505
|
-
export { ACCESSORY_LABEL, ALL_CAPABILITY_DEFINITIONS, APPLE_SA_TO_MACRO, AUDIO_BACKEND_CHOICES, AUDIO_MACRO_LABELS, AccessoriesStatusSchema, AccessoryKind, AddBrokerInputSchema, AddonAutoUpdateSchema, AddonListItemSchema, AddonPageDeclarationSchema, AddonPageInfoSchema, AdoptInputSchema as AdoptionAdoptInputSchema, AdoptResultSchema as AdoptionAdoptResultSchema, AdoptionFilterSchema, GetCandidateInputSchema as AdoptionGetCandidateInputSchema, ListCandidatesInputSchema as AdoptionListCandidatesInputSchema, ListCandidatesOutputSchema as AdoptionListCandidatesOutputSchema, ReleaseInputSchema as AdoptionReleaseInputSchema, AdoptionStatusSchema, AgentLoadSummarySchema, AirQualitySensorStatusSchema, AlarmArmModeSchema, AlarmPanelStatusSchema, AlarmStateSchema, AlertSchema, AlertSeveritySchema, AlertSourceSchema, AlertStatusSchema, AmbientLightSensorStatusSchema, ApiKeyRecordSchema, ApiKeySummarySchema, ArchiveEntrySchema, ArchiveManifestSchema, AttachmentMediaTypeSchema, AttachmentSchema, AudioAnalysisResultSchema, AudioAnalysisSettingsSchema, AudioChunkInputSchema, AudioClassSummarySchema, AudioClassificationLabelSchema, AudioClassificationResultSchema, AudioCodecInfoSchema, AudioDecodeSessionConfigSchema, AudioEncodeSchema, AudioEncodeSessionConfigSchema, AudioEncodedChunkSchema, AudioEventSchema, AudioLevelSchema, AudioMetricsHistoryPointSchema, AudioMetricsHistorySchema, AudioMetricsSnapshotSchema, AudioPcmChunkSchema, AuthResultSchema, AutoUpdateSettingsSchema, AutomationControlStatusSchema, AvailableIntegrationTypeSchema, BACKEND_TO_FORMAT, BATTERY_DEVICE_PROFILE, BackupDestinationInfoSchema, BackupEntrySchema, BaseAddon, BaseDevice, BaseDeviceProvider, BatteryStatusSchema, BinaryStatusSchema, 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, CAM_PROFILE_ORDER, CAPABILITY_NAMES, CAPABILITY_ROUTER_KEYS, CAP_NAMES_WITH_STATUS, CAP_NODE_PIN_CONTEXT_KEY, CAP_PROVIDER_KIND_MAP, COCO_80_LABELS, COCO_TO_MACRO, CamProfileSchema, CamStreamDescriptorSchema, CamStreamKindSchema, CamStreamResolutionSchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraCredentialsSchema, CameraCredentialsStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CameraStreamSchema, CandidateQueryFilterSchema, CapScopeSchema, CapabilityBindingsSchema, CarbonMonoxideStatusSchema, ChargingStatus, ClientNetworkStatsSchema, ClimateControlStatusSchema, ClipPlaybackSchema, ClipSchema, ClusterAddonNodeDeploymentSchema, ClusterAddonStatusEntrySchema, CollectionColumnSchema, CollectionIndexSchema, ColorStatusSchema, ConfigEntrySchema, ConfigSectionWithValuesSchema, ConfigTabDeclarationSchema, ConnectivityStatusSchema, ConsumableItemSchema, ConsumablesStatusSchema, ContactStatusSchema, ControlKindSchema, ControlStatusSchema, ConvertArtifactSchema, ConvertResultSchema, ConvertTargetSchema, CoverStateSchema, CoverStatusSchema, CreateApiKeyInputSchema, CreateApiKeyResultSchema, CreateIntegrationInputSchema, CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, CreateUserInputSchema, CustomActionInputSchema, CustomModelDescriptorSchema, DATAPLANE_SECRET_HEADER, DEFAULT_ADDON_PLACEMENT, DEFAULT_AUDIO_ANALYZER_CONFIG, DEFAULT_DECODER_HWACCEL_CONFIG, DEFAULT_FEATURES, DEFAULT_RETENTION, DEVICE_CAP_NAMES, DEVICE_PROFILES, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DEVICE_TYPE_INFO, DecodedAudioChunkSchema, DecodedFrameSchema, DecoderAssignmentSchema, DecoderSessionConfigSchema, DecoderStatsSchema, DeleteIntegrationResultSchema, DetectionSourceSchema, DetectorOutputSchema, DeviceCodeSeveritySchema, DeviceConfig, DeviceDiscoveryStatusSchema, ExposeInputSchema as DeviceExportExposeInputSchema, DeviceExportStatusSchema, UnexposeInputSchema as DeviceExportUnexposeInputSchema, DeviceFeature, DeviceInfoSchema, DeviceNetworkStatsSchema, DeviceRole, DeviceRuntimeState, DeviceStatusSchema, DeviceType, DiscoveredChildDeviceSchema, DiscoveredChildStatusSchema, DiscoveredDeviceSchema, DiscoveredTargetSchema, DisposerChain, DoorbellPressEventSchema, DoorbellStatusSchema, EVENT_PAD_MS, ElementConfigStore, EmbeddingInfoSchema, EmbeddingResultSchema, EncodeProfileSchema, EncodedPacketSchema, EnrichedWidgetMetadataSchema, EnumSensorDateTimeFormatSchema, EnumSensorStatusSchema, EventCategory, EventEmitterStatusSchema, EventFireSchema, EventItemSchema, EventKindSchema, EventSourceType, ExportSetupFieldSchema, ExportSetupSchema, ExposedDeviceSchema, ExposedResourceSchema, FanControlStatusSchema, FanDirectionSchema, FeatureManifestSchema, FeatureProbeStatusSchema, FloodStatusSchema, FrameHandleFormatSchema, FrameHandleSchema, FrameInputSchema, GasStatusSchema, GetStreamWithCodecInputSchema, GlobalMetricsSchema, HF_BASE_URL, HF_REPO, HWACCEL_OPTIONS, HealthStatusSchema, HistoryPointSchema, HistoryResolutionEnum, HumidifierStatusSchema, HumiditySensorStatusSchema, HvacModeSchema, ImageStatusSchema, InstalledPackageSchema, IntegrationLiteSchema, IntegrationWithStateSchema, IntercomAbilitySchema, IntercomStatusSchema, KNOWN_CAP_NAMES, LabelDefinitionSchema, LawnMowerActivitySchema, LawnMowerControlStatusSchema, LocateSegmentResultSchema, LocationStatSchema, LockControlStatusSchema, LockStateSchema, LogEntrySchema, LogLevelSchema, LogStreamEntrySchema, MACRO_LABELS, METHOD_ACCESS_MAP, MODEL_FORMATS, MaskGridDimsSchema, MaskGridShapeSchema, MaskLineShapeSchema, MaskPointSchema, MaskPolygonShapeSchema, MaskPolygonVerticesSchema, MaskRectShapeSchema, MaskShapeKindSchema, MaskShapeSchema, MediaFileSchema, MediaPlayerRepeatSchema, MediaPlayerStateSchema, MediaPlayerStatusSchema, MeshPeerSchema, MeshStatusSchema, MethodAccessSchema, ModelCatalogEntrySchema, ModelConvertInputSchema, ModelConvertMetadataSchema, ModelDistributeInputSchema, ModelDistributeResultSchema, ModelExtraFileSchema, ModelFormatEntrySchema, ModelFormatsSchema, MotionAnalysisResultSchema, MotionEventSchema, MotionOnMotionChangedDataSchema, MotionRegionSchema, MotionSourceEnum, MotionSourcesSchema, MotionStatusSchema, MotionTriggerRuntimeStateSchema, MotionTriggerStatusSchema, MotionZoneOptionsSchema, MotionZonePatchSchema, MotionZoneRegionSchema, MotionZoneStatusSchema, StatusSchema as MqttBrokerStatusSchema, NativeDetectionSchema, NativeObjectClassEnum, NativeObjectDetectionRuntimeStateSchema, NativeObjectDetectionStatusSchema, NetworkAccessStatusSchema, NetworkAddressSchema, NetworkEndpointSchema, NotificationActionSchema, NotificationFormatSchema, NotificationHistoryEntrySchema, NotificationRuleSchema, NotificationSchema, NotifierStatusSchema, NumericSensorStatusSchema, OauthIntegrationDescriptorSchema, ObjectEventSchema, OrchestratorMetricsSchema, OsdOverlayKindEnum, OsdOverlayPatchSchema, OsdOverlaySchema, OsdPositionEnum, OsdStatusSchema, PIPELINE_FLOW_CAPABILITY_NAMES, PIPELINE_OWNER_CAPABILITY_NAMES, PROVIDER_KIND_CAP_NAMES, PYTHON_SCRIPT, PackageUpdateSchema, PackageVersionInfoSchema, PasskeySummarySchema, PcmSampleFormatSchema, PerScopeBreakdownSchema, PickStreamPreferencesSchema, PickStreamRequirementsSchema, PickedCamStreamSchema, PipelineAssignmentSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PlaceholderReasonSchema, PolygonPointSchema, PowerMeterStatusSchema, PresenceStatusSchema, PressureSensorStatusSchema, PrivacyMaskOptionsSchema, PrivacyMaskPatchSchema, PrivacyMaskRegionSchema, PrivacyMaskShapeSchema, PrivacyMaskStatusSchema, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, ProviderStatusSchema, PtzAutotrackRuntimeStateSchema, PtzAutotrackSettingsSchema, PtzAutotrackStatusSchema, PtzAutotrackTargetOptionSchema, PtzMoveCommandSchema, PtzPositionSchema, PtzPresetSchema, PtzStatusSchema, QueryFilterSchema, RECOGNITION_TYPES, RUNTIME_DEFAULTS, RUNTIME_TO_FORMAT, RawStateResultSchema, ReadSegmentBytesResultSchema, ReadinessRegistry, ReadinessTimeoutError, RecordingAvailabilitySchema, RecordingBandModeSchema, RecordingBandSchema, RecordingBandTriggersSchema, RecordingConfigSchema, RecordingDaysSchema, RecordingDeviceUsageSchema, RecordingLocationUsageSchema, RecordingManifestSchema, RecordingModeSchema, RecordingRangeSchema, RecordingRetentionSchema, RecordingRuleSchema, RecordingScheduleSchema, RecordingStatusSchema, RecordingStorageModeSchema, RecordingStorageUsageSchema, RecordingTriggersSchema, RecordingWeekdaySchema, RegisteredStreamSchema, RenderedAsSchema, ReportMotionInputSchema, RingBuffer, RtpSourceSchema, RtspRestreamEntrySchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, SCOPE_PRESETS, SOURCE_INFO_METADATA_KEY, STREAM_PROFILE_META, STREAM_QUALITY_LABELS, SUB_DETECTION_TYPES, SYSTEM_CAP_NAMES, ScopedTokenSchema, ScopedTokenSummarySchema, ScoredObjectEventSchema, ScriptRunnerStatusSchema, SearchResultSchema, SendEmailInputSchema, SendEmailResultSchema, SendResultSchema, SettingsPatchSchema, SettingsRecordSchema, SettingsSchemaWithValuesSchema, SettingsUpdateResultSchema, ShmRingStatsSchema, SmokeStatusSchema, SmtpStatusSchema, SnapshotImageSchema, SourceInfoSchema, SpatialDetectionSchema, SsoBridgeClaimsSchema, StartEmbeddedInputSchema, AbortUploadInputSchema as StorageAbortUploadInputSchema, BeginDownloadInputSchema as StorageBeginDownloadInputSchema, BeginDownloadResultSchema as StorageBeginDownloadResultSchema, BeginUploadInputSchema as StorageBeginUploadInputSchema, BeginUploadResultSchema as StorageBeginUploadResultSchema, EndDownloadInputSchema as StorageEndDownloadInputSchema, FinalizeUploadInputSchema as StorageFinalizeUploadInputSchema, StorageLocationDeclarationSchema, StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, ProviderInfoSchema as StorageProviderInfoSchema, ReadChunkInputSchema as StorageReadChunkInputSchema, TestLocationResultSchema as StorageTestLocationResultSchema, WriteChunkInputSchema as StorageWriteChunkInputSchema, StreamCodecSchema, StreamFormatSchema, StreamInfoSchema, StreamNetworkStatsSchema, StreamParamsOptionsSchema, StreamParamsStatusSchema, StreamProfileConfigSchema, StreamProfileOptionsSchema, StreamProfilePatchSchema, StreamProfileSchema, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, SubscribeFramesInputSchema, SubscribeFramesResultSchema, SwitchStatusSchema, SystemMetricsSchema, SystemMirror, TIMEZONES, TamperStatusSchema, TankStatusSchema, TargetKindCapsSchema, TargetKindLevelSchema, TargetKindSchema, TargetSchema, TemperatureSensorStatusSchema, TestConnectionResultSchema$1 as TestConnectionResultSchema, TestResultSchema, ToastSchema, TokenScopeSchema, TopologyNodeSchema, TopologyProcessSchema, TopologyServiceSchema, TrackSchema, TrackStateSchema, TrackedDetectionSchema, TurnServerSchema, BrokerInfoSchema$1 as UnifiedBrokerInfoSchema, UpdateIntegrationInputSchema, UpdateStatusSchema, UpdateUserInputSchema, UserRecordSchema, UserSummarySchema, VacuumControlStatusSchema, VacuumStateSchema, ValveStateSchema, ValveStatusSchema, VibrationStatusSchema, VideoEncodeSchema, WELL_KNOWN_TABS, WELL_KNOWN_TAB_MAP, WaterHeaterStatusSchema, WeatherStatusSchema, WebrtcStreamChoiceSchema, WebrtcStreamTargetSchema, WidgetHostEnum, WidgetMetadataSchema, WidgetRemoteSchema, WidgetSizeEnum, YAMNET_TO_MACRO, ZoneKindEnum, ZoneRuleModeEnum, ZoneRuleSchema, ZoneRuleStageEnum, ZoneRulesArraySchema, ZoneSchema, ZoneScopeBreakdownSchema, accessoriesCapability, accessoryStableId, addonPagesCapability, addonPagesSourceCapability, addonRoutesCapability, addonSettingsCapability, addonWidgetsCapability, addonWidgetsSourceCapability, addonsCapability, adminUiCapability, advancedNotifierCapability, airQualitySensorCapability, alarmPanelCapability, alertsCapability, ambientLightSensorCapability, applyTransform, asBoolean, asJsonArray, asJsonObject, asNumber, asString, audioAnalysisCapability, audioAnalyzerCapability, audioCodecCapability, audioMetricsCapability, authProviderCapability, autoAssignProfiles, automationControlCapability, backupCapability, batteryCapability, bestLocationMatch, binaryCapability, bindAddonActions, brightnessCapability, brokerCapability, buildAddonRouteProvider, buildStreamParamsConfigSchema, buttonCapability, cameraCredentialsCapability, cameraPipelineConfigCapability, cameraStreamsCapability, carbonMonoxideCapability, cellsToRects, classifyStream, classifyStreams, climateControlCapability, colorCapability, connectivityCapability, consumablesCapability, contactCapability, controlCapability, cosineSimilarity, coverCapability, createDeviceProxy, createDurableState, createEvent, createLazyTrpcSource, createMirrorSource, createRuntimeStateBridge, createSliceHandle, createSystemProxy, customAction, customModelRegistryCapability, decoderCapability, defaultDeviceFor, defineCustomActions, detectionPipelineCapability, deviceAdoptionCapability, deviceCustomAction, deviceDiscoveryCapability, deviceExportCapability, deviceManagerCapability, deviceMatchesProfile, deviceOpsCapability, deviceProviderCapability, deviceStateCapability, deviceStatusCapability, doorbellCapability, embeddingEncoderCapability, emitDownForOwnedCaps, emitReadiness, encodeProfileFromStreamShape, enumSensorCapability, enumerateSchemaFields, errMsg, evaluateZoneRules, event, eventEmitterCapability, eventsCapability, expandCapMethods, extractSourceInfoFromMetadata, faceGalleryCapability, fanControlCapability, featureProbeCapability, filesystemBrowseCapability, findTimezone, floodCapability, formatForBackend, formatForRuntime, frameworkSwapConfirmSchema, frameworkSwapPackageSchema, gasCapability, getAudioMacroClassIds, getByPath, getCapsByProviderKind, hfModelUrl, htmlToText, humidifierCapability, humiditySensorCapability, hydrateSchema, imageCapability, integrationsCapability, intercomCapability, isAgentOnlyPlacement, isDeployableToAgent, isDeviceConfigCap, isEvent, jobKindSchema, lawnMowerControlCapability, lifecycleJobSchema, lifecycleJobScopeSchema, lifecycleJobStateSchema, lifecycleTaskSchema, localNetworkCapability, locationSimilarity, lockControlCapability, logDestinationCapability, makeProfileBrokerId, makeSourceBrokerId, mapAudioLabelToMacro, markdownToHtmlLite, markdownToText, maskUrlCredentials, mediaPlayerCapability, mergeSourceInfo, meshNetworkCapability, method, metricsProviderCapability, migrateConfigToBands, modelConvertCapability, modelDistributorCapability, modelFormatForRuntime, motionCapability, motionDetectionCapability, motionTriggerCapability, motionZonesCapability, mqttBrokerCapability, nativeObjectDetectionCapability, networkAccessCapability, networkQualityCapability, nodePin, nodesCapability, normalizeAddonInitResult, normalizeUnit, notificationOutputCapability, notifierCapability, numericSensorCapability, oauthIntegrationCapability, osdCapability, parseCameraStreamConfig, parseJsonArray, parseJsonObject, parseJsonUnknown, parseProfileBrokerId, parseStreamParamsFormPatch, pendingFrameworkSwapSchema, pickPreferredRtspEntry, pipelineAnalyticsCapability, pipelineExecutorCapability, pipelineOrchestratorCapability, pipelineRunnerCapability, plateGalleryCapability, platformProbeCapability, powerMeterCapability, prepareNotification, presenceCapability, pressureSensorCapability, privacyMaskCapability, ptzAutotrackCapability, ptzCapability, pythonScriptForBackend, readNodePin, readinessKey, rebootCapability, recordingCapability, rectsToCells, requiresPython, resolveAddonExecution, resolveAddonGroup, resolveAddonPlacement, resolveAddonRuntime, resolveCapMount, resolveDetectionRuntime, resolveDeviceProfile, resolveFormat, resolveModelFormat, resolveRunnerId, restreamerCapability, runInferenceStep, runtimeDevices, scopeKey, scoreRuntimes, scriptRunnerCapability, selectAssignedProfileSlots, setByPath, settingsStoreCapability, sleep, sleepCancellable, smokeCapability, smtpProviderCapability, snapshotCapability, snapshotProviderCapability, ssoBridgeCapability, storageCapability, storageEvictableCapability, storageProviderCapability, streamBrokerCapability, streamCatalogCapability, streamParamsCapability, streamPixels, streamQualityLabel, streamingEngineCapability, supportedRuntimes, switchCapability, synthesizeSourceInfo, systemCapability, tamperCapability, taskLogEntrySchema, taskPhaseSchema, taskTargetSchema, temperatureSensorCapability, textToHtml, toDeviceSummary, toStreamSourceEntry, toastCapability, transcodeBody, turnProviderCapability, updateCapability, userManagementCapability, userPasskeysCapability, vacuumControlCapability, valveCapability, vibrationCapability, videoclipsCapability, waterHeaterCapability, weatherCapability, webrtcCapability, webrtcClientHintsSchema, webrtcSessionCapability, wiringAddonHealthSchema, wiringHealthSnapshotSchema, wiringNodeHealthSchema, wiringProbeKindSchema, wiringProbeResultSchema, zodEntriesToConfigUI, zoneAnalyticsCapability, zoneRulesCapability, zonesCapability };
|
|
27797
|
+
export { ACCESSORY_LABEL, ALL_CAPABILITY_DEFINITIONS, APPLE_SA_TO_MACRO, AUDIO_BACKEND_CHOICES, AUDIO_MACRO_LABELS, AccessoriesStatusSchema, AccessoryKind, AddBrokerInputSchema, AddonAutoUpdateSchema, AddonListItemSchema, AddonPageDeclarationSchema, AddonPageInfoSchema, AdoptInputSchema as AdoptionAdoptInputSchema, AdoptResultSchema as AdoptionAdoptResultSchema, AdoptionFilterSchema, GetCandidateInputSchema as AdoptionGetCandidateInputSchema, ListCandidatesInputSchema as AdoptionListCandidatesInputSchema, ListCandidatesOutputSchema as AdoptionListCandidatesOutputSchema, ReleaseInputSchema as AdoptionReleaseInputSchema, AdoptionStatusSchema, AgentLoadSummarySchema, AirQualitySensorStatusSchema, AlarmArmModeSchema, AlarmPanelStatusSchema, AlarmStateSchema, AlertSchema, AlertSeveritySchema, AlertSourceSchema, AlertStatusSchema, AmbientLightSensorStatusSchema, ApiKeyRecordSchema, ApiKeySummarySchema, ArchiveEntrySchema, ArchiveManifestSchema, AttachmentMediaTypeSchema, AttachmentSchema, AudioAnalysisResultSchema, AudioAnalysisSettingsSchema, AudioChunkInputSchema, AudioClassSummarySchema, AudioClassificationLabelSchema, AudioClassificationResultSchema, AudioCodecInfoSchema, AudioDecodeSessionConfigSchema, AudioEncodeSchema, AudioEncodeSessionConfigSchema, AudioEncodedChunkSchema, AudioEventSchema, AudioLevelSchema, AudioMetricsHistoryPointSchema, AudioMetricsHistorySchema, AudioMetricsSnapshotSchema, AudioPcmChunkSchema, AuthResultSchema, AutoUpdateSettingsSchema, AutomationControlStatusSchema, AvailableIntegrationTypeSchema, BACKEND_TO_FORMAT, BATTERY_DEVICE_PROFILE, BackupDestinationInfoSchema, BackupEntrySchema, BaseAddon, BaseDevice, BaseDeviceProvider, BatteryStatusSchema, BinaryStatusSchema, 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, CAM_PROFILE_ORDER, CAPABILITY_NAMES, CAPABILITY_ROUTER_KEYS, CAP_NAMES_WITH_STATUS, CAP_NODE_PIN_CONTEXT_KEY, CAP_PROVIDER_KIND_MAP, COCO_80_LABELS, COCO_TO_MACRO, CamProfileSchema, CamStreamDescriptorSchema, CamStreamKindSchema, CamStreamResolutionSchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraCredentialsSchema, CameraCredentialsStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CameraStreamSchema, CandidateQueryFilterSchema, CapScopeSchema, CapabilityBindingsSchema, CarbonMonoxideStatusSchema, ChargingStatus, ClientNetworkStatsSchema, ClimateControlStatusSchema, ClipPlaybackSchema, ClipSchema, ClusterAddonNodeDeploymentSchema, ClusterAddonStatusEntrySchema, CollectionColumnSchema, CollectionIndexSchema, ColorStatusSchema, ConfigEntrySchema, ConfigSectionWithValuesSchema, ConfigTabDeclarationSchema, ConnectivityStatusSchema, ConsumableItemSchema, ConsumablesStatusSchema, ContactStatusSchema, ControlKindSchema, ControlStatusSchema, ConvertArtifactSchema, ConvertResultSchema, ConvertTargetSchema, CoverStateSchema, CoverStatusSchema, CreateApiKeyInputSchema, CreateApiKeyResultSchema, CreateIntegrationInputSchema, CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, CreateUserInputSchema, CustomActionInputSchema, CustomModelDescriptorSchema, DATAPLANE_SECRET_HEADER, DEFAULT_ADDON_PLACEMENT, DEFAULT_AUDIO_ANALYZER_CONFIG, DEFAULT_DECODER_HWACCEL_CONFIG, DEFAULT_FEATURES, DEFAULT_RETENTION, DEVICE_CAP_NAMES, DEVICE_PROFILES, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DEVICE_TYPE_INFO, DecodedAudioChunkSchema, DecodedFrameSchema, DecoderAssignmentSchema, DecoderSessionConfigSchema, DecoderStatsSchema, DeleteIntegrationResultSchema, DetectionSourceSchema, DetectorOutputSchema, DeviceCodeSeveritySchema, DeviceConfig, DeviceDiscoveryStatusSchema, ExposeInputSchema as DeviceExportExposeInputSchema, DeviceExportStatusSchema, UnexposeInputSchema as DeviceExportUnexposeInputSchema, DeviceFeature, DeviceInfoSchema, DeviceNetworkStatsSchema, DeviceRole, DeviceRuntimeState, DeviceStatusSchema, DeviceType, DiscoveredChildDeviceSchema, DiscoveredChildStatusSchema, DiscoveredDeviceSchema, DiscoveredTargetSchema, DisposerChain, DoorbellPressEventSchema, DoorbellStatusSchema, EVENT_PAD_MS, EXPRESSION_BUILTINS, EXPRESSION_BUILTIN_NAMES, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, ElementConfigStore, EmbeddingInfoSchema, EmbeddingResultSchema, EncodeProfileSchema, EncodedPacketSchema, EnrichedWidgetMetadataSchema, EnumSensorDateTimeFormatSchema, EnumSensorStatusSchema, EventCategory, EventEmitterStatusSchema, EventFireSchema, EventItemSchema, EventKindSchema, EventSourceType, ExportSetupFieldSchema, ExportSetupSchema, ExposedDeviceSchema, ExposedResourceSchema, ExpressionEvalError, ExpressionParseError, FanControlStatusSchema, FanDirectionSchema, FeatureManifestSchema, FeatureProbeStatusSchema, FloodStatusSchema, FrameHandleFormatSchema, FrameHandleSchema, FrameInputSchema, GasStatusSchema, GetStreamWithCodecInputSchema, GlobalMetricsSchema, HF_BASE_URL, HF_REPO, HWACCEL_OPTIONS, HealthStatusSchema, HistoryPointSchema, HistoryResolutionEnum, HumidifierStatusSchema, HumiditySensorStatusSchema, HvacModeSchema, ImageStatusSchema, InstalledPackageSchema, IntegrationLiteSchema, IntegrationWithStateSchema, IntercomAbilitySchema, IntercomStatusSchema, KNOWN_CAP_NAMES, LabelDefinitionSchema, LawnMowerActivitySchema, LawnMowerControlStatusSchema, LocateSegmentResultSchema, LocationStatSchema, LockControlStatusSchema, LockStateSchema, LogEntrySchema, LogLevelSchema, LogStreamEntrySchema, MACRO_LABELS, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_SOURCE_LENGTH, METHOD_ACCESS_MAP, MODEL_FORMATS, MaskGridDimsSchema, MaskGridShapeSchema, MaskLineShapeSchema, MaskPointSchema, MaskPolygonShapeSchema, MaskPolygonVerticesSchema, MaskRectShapeSchema, MaskShapeKindSchema, MaskShapeSchema, MediaFileSchema, MediaPlayerRepeatSchema, MediaPlayerStateSchema, MediaPlayerStatusSchema, MeshPeerSchema, MeshStatusSchema, MethodAccessSchema, ModelCatalogEntrySchema, ModelConvertInputSchema, ModelConvertMetadataSchema, ModelDistributeInputSchema, ModelDistributeResultSchema, ModelExtraFileSchema, ModelFormatEntrySchema, ModelFormatsSchema, MotionAnalysisResultSchema, MotionEventSchema, MotionOnMotionChangedDataSchema, MotionRegionSchema, MotionSourceEnum, MotionSourcesSchema, MotionStatusSchema, MotionTriggerRuntimeStateSchema, MotionTriggerStatusSchema, MotionZoneOptionsSchema, MotionZonePatchSchema, MotionZoneRegionSchema, MotionZoneStatusSchema, StatusSchema as MqttBrokerStatusSchema, NativeDetectionSchema, NativeObjectClassEnum, NativeObjectDetectionRuntimeStateSchema, NativeObjectDetectionStatusSchema, NetworkAccessStatusSchema, NetworkAddressSchema, NetworkEndpointSchema, NotificationActionSchema, NotificationFormatSchema, NotificationHistoryEntrySchema, NotificationRuleSchema, NotificationSchema, NotifierStatusSchema, NumericSensorStatusSchema, OauthIntegrationDescriptorSchema, ObjectEventSchema, OrchestratorMetricsSchema, OsdOverlayKindEnum, OsdOverlayPatchSchema, OsdOverlaySchema, OsdPositionEnum, OsdStatusSchema, PIPELINE_FLOW_CAPABILITY_NAMES, PIPELINE_OWNER_CAPABILITY_NAMES, PROVIDER_KIND_CAP_NAMES, PYTHON_SCRIPT, PackageUpdateSchema, PackageVersionInfoSchema, PasskeySummarySchema, PcmSampleFormatSchema, PerScopeBreakdownSchema, PickStreamPreferencesSchema, PickStreamRequirementsSchema, PickedCamStreamSchema, PipelineAssignmentSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PlaceholderReasonSchema, PolygonPointSchema, PowerMeterStatusSchema, PresenceStatusSchema, PressureSensorStatusSchema, PrivacyMaskOptionsSchema, PrivacyMaskPatchSchema, PrivacyMaskRegionSchema, PrivacyMaskShapeSchema, PrivacyMaskStatusSchema, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, ProviderStatusSchema, PtzAutotrackRuntimeStateSchema, PtzAutotrackSettingsSchema, PtzAutotrackStatusSchema, PtzAutotrackTargetOptionSchema, PtzMoveCommandSchema, PtzPositionSchema, PtzPresetSchema, PtzStatusSchema, QueryFilterSchema, RECOGNITION_TYPES, RESERVED_BINDING_NAMES, RUNTIME_DEFAULTS, RUNTIME_TO_FORMAT, RawStateResultSchema, ReadSegmentBytesResultSchema, ReadinessRegistry, ReadinessTimeoutError, RecordingAvailabilitySchema, RecordingBandModeSchema, RecordingBandSchema, RecordingBandTriggersSchema, RecordingConfigSchema, RecordingDaysSchema, RecordingDeviceUsageSchema, RecordingLocationUsageSchema, RecordingManifestSchema, RecordingModeSchema, RecordingRangeSchema, RecordingRetentionSchema, RecordingRuleSchema, RecordingScheduleSchema, RecordingStatusSchema, RecordingStorageModeSchema, RecordingStorageUsageSchema, RecordingTriggersSchema, RecordingWeekdaySchema, RegisteredStreamSchema, RenderedAsSchema, ReportMotionInputSchema, RingBuffer, RtpSourceSchema, RtspRestreamEntrySchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, SCOPE_PRESETS, SOURCE_INFO_METADATA_KEY, STREAM_PROFILE_META, STREAM_QUALITY_LABELS, SUB_DETECTION_TYPES, SYSTEM_CAP_NAMES, ScopedTokenSchema, ScopedTokenSummarySchema, ScoredObjectEventSchema, ScriptRunnerStatusSchema, SearchResultSchema, SendEmailInputSchema, SendEmailResultSchema, SendResultSchema, SettingsPatchSchema, SettingsRecordSchema, SettingsSchemaWithValuesSchema, SettingsUpdateResultSchema, ShmRingStatsSchema, SmokeStatusSchema, SmtpStatusSchema, SnapshotImageSchema, SourceInfoSchema, SpatialDetectionSchema, SsoBridgeClaimsSchema, StartEmbeddedInputSchema, AbortUploadInputSchema as StorageAbortUploadInputSchema, BeginDownloadInputSchema as StorageBeginDownloadInputSchema, BeginDownloadResultSchema as StorageBeginDownloadResultSchema, BeginUploadInputSchema as StorageBeginUploadInputSchema, BeginUploadResultSchema as StorageBeginUploadResultSchema, EndDownloadInputSchema as StorageEndDownloadInputSchema, FinalizeUploadInputSchema as StorageFinalizeUploadInputSchema, StorageLocationDeclarationSchema, StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, ProviderInfoSchema as StorageProviderInfoSchema, ReadChunkInputSchema as StorageReadChunkInputSchema, TestLocationResultSchema as StorageTestLocationResultSchema, WriteChunkInputSchema as StorageWriteChunkInputSchema, StreamCodecSchema, StreamFormatSchema, StreamInfoSchema, StreamNetworkStatsSchema, StreamParamsOptionsSchema, StreamParamsStatusSchema, StreamProfileConfigSchema, StreamProfileOptionsSchema, StreamProfilePatchSchema, StreamProfileSchema, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, SubscribeFramesInputSchema, SubscribeFramesResultSchema, SwitchStatusSchema, SystemMetricsSchema, SystemMirror, TIMEZONES, TamperStatusSchema, TankStatusSchema, TargetKindCapsSchema, TargetKindLevelSchema, TargetKindSchema, TargetSchema, TemperatureSensorStatusSchema, TestConnectionResultSchema$1 as TestConnectionResultSchema, TestResultSchema, ToastSchema, TokenScopeSchema, TopologyNodeSchema, TopologyProcessSchema, TopologyServiceSchema, TrackSchema, TrackStateSchema, TrackedDetectionSchema, TurnServerSchema, UNIT_TABLE, BrokerInfoSchema$1 as UnifiedBrokerInfoSchema, UnitConversionError, UpdateIntegrationInputSchema, UpdateStatusSchema, UpdateUserInputSchema, UserRecordSchema, UserSummarySchema, VacuumControlStatusSchema, VacuumStateSchema, ValveStateSchema, ValveStatusSchema, VibrationStatusSchema, VideoEncodeSchema, WELL_KNOWN_TABS, WELL_KNOWN_TAB_MAP, WaterHeaterStatusSchema, WeatherStatusSchema, WebrtcStreamChoiceSchema, WebrtcStreamTargetSchema, WidgetHostEnum, WidgetMetadataSchema, WidgetRemoteSchema, WidgetSizeEnum, YAMNET_TO_MACRO, ZoneKindEnum, ZoneRuleModeEnum, ZoneRuleSchema, ZoneRuleStageEnum, ZoneRulesArraySchema, ZoneSchema, ZoneScopeBreakdownSchema, accessoriesCapability, accessoryStableId, addonPagesCapability, addonPagesSourceCapability, addonRoutesCapability, addonSettingsCapability, addonWidgetsCapability, addonWidgetsSourceCapability, addonsCapability, adminUiCapability, advancedNotifierCapability, airQualitySensorCapability, alarmPanelCapability, alertsCapability, ambientLightSensorCapability, applyTransform, asBoolean, asJsonArray, asJsonObject, asNumber, asString, audioAnalysisCapability, audioAnalyzerCapability, audioCodecCapability, audioMetricsCapability, authProviderCapability, autoAssignProfiles, automationControlCapability, backupCapability, batteryCapability, bestLocationMatch, binaryCapability, bindAddonActions, brightnessCapability, brokerCapability, buildAddonRouteProvider, buildStreamParamsConfigSchema, buttonCapability, cameraCredentialsCapability, cameraPipelineConfigCapability, cameraStreamsCapability, canConvertUnit, carbonMonoxideCapability, cellsToRects, classifyStream, classifyStreams, climateControlCapability, colorCapability, compileExpression, compileExpressionSafe, connectivityCapability, consumablesCapability, contactCapability, controlCapability, convertUnit, cosineSimilarity, coverCapability, createDeviceProxy, createDurableState, createEvent, createExpressionScope, createLazyTrpcSource, createMirrorSource, createRuntimeStateBridge, createSliceHandle, createSystemProxy, customAction, customModelRegistryCapability, decoderCapability, defaultDeviceFor, defineCustomActions, detectionPipelineCapability, deviceAdoptionCapability, deviceCustomAction, deviceDiscoveryCapability, deviceExportCapability, deviceManagerCapability, deviceMatchesProfile, deviceOpsCapability, deviceProviderCapability, deviceStateCapability, deviceStatusCapability, doorbellCapability, embeddingEncoderCapability, emitDownForOwnedCaps, emitReadiness, encodeProfileFromStreamShape, enumSensorCapability, enumerateItemArrayFields, enumerateSchemaFields, errMsg, evaluateAst, evaluateLinkExpression, evaluateZoneRules, event, eventEmitterCapability, eventsCapability, expandCapMethods, extractSourceInfoFromMetadata, faceGalleryCapability, fanControlCapability, featureProbeCapability, filesystemBrowseCapability, findTimezone, floodCapability, formatForBackend, formatForRuntime, frameworkSwapConfirmSchema, frameworkSwapPackageSchema, gasCapability, getAudioMacroClassIds, getByPath, getCapsByProviderKind, hfModelUrl, htmlToText, humidifierCapability, humiditySensorCapability, hydrateSchema, imageCapability, integrationsCapability, intercomCapability, isAgentOnlyPlacement, isDeployableToAgent, isDeviceConfigCap, isEvent, jobKindSchema, lawnMowerControlCapability, lifecycleJobSchema, lifecycleJobScopeSchema, lifecycleJobStateSchema, lifecycleTaskSchema, localNetworkCapability, locationSimilarity, lockControlCapability, logDestinationCapability, makeProfileBrokerId, makeSourceBrokerId, mapAudioLabelToMacro, markdownToHtmlLite, markdownToText, maskUrlCredentials, mediaPlayerCapability, mergeSourceInfo, meshNetworkCapability, method, metricsProviderCapability, migrateConfigToBands, modelConvertCapability, modelDistributorCapability, modelFormatForRuntime, motionCapability, motionDetectionCapability, motionTriggerCapability, motionZonesCapability, mqttBrokerCapability, nativeObjectDetectionCapability, networkAccessCapability, networkQualityCapability, nodePin, nodesCapability, normalizeAddonInitResult, normalizeUnit, notificationOutputCapability, notifierCapability, numericSensorCapability, oauthIntegrationCapability, osdCapability, parseCameraStreamConfig, parseExpression, parseJsonArray, parseJsonObject, parseJsonUnknown, parseProfileBrokerId, parseStreamParamsFormPatch, pendingFrameworkSwapSchema, pickPreferredRtspEntry, pipelineAnalyticsCapability, pipelineExecutorCapability, pipelineOrchestratorCapability, pipelineRunnerCapability, plateGalleryCapability, platformProbeCapability, powerMeterCapability, prepareNotification, presenceCapability, pressureSensorCapability, privacyMaskCapability, ptzAutotrackCapability, ptzCapability, pythonScriptForBackend, readNodePin, readinessKey, rebootCapability, recordingCapability, rectsToCells, requiresPython, resolveAddonExecution, resolveAddonGroup, resolveAddonPlacement, resolveAddonRuntime, resolveCapMount, resolveDetectionRuntime, resolveDeviceProfile, resolveFormat, resolveModelFormat, resolveRunnerId, restreamerCapability, runInferenceStep, runtimeDevices, scopeKey, scoreRuntimes, scriptRunnerCapability, selectAssignedProfileSlots, setByPath, settingsStoreCapability, sleep, sleepCancellable, smokeCapability, smtpProviderCapability, snapshotCapability, snapshotProviderCapability, ssoBridgeCapability, storageCapability, storageEvictableCapability, storageProviderCapability, streamBrokerCapability, streamCatalogCapability, streamParamsCapability, streamPixels, streamQualityLabel, streamingEngineCapability, supportedRuntimes, switchCapability, synthesizeSourceInfo, systemCapability, tamperCapability, taskLogEntrySchema, taskPhaseSchema, taskTargetSchema, temperatureSensorCapability, textToHtml, toDeviceSummary, toExpressionValue, toStreamSourceEntry, toastCapability, tokenize, transcodeBody, tryConvertUnit, turnProviderCapability, unitDimension, unitsForDimension, updateCapability, userManagementCapability, userPasskeysCapability, vacuumControlCapability, validateExpressionSource, valveCapability, vibrationCapability, videoclipsCapability, waterHeaterCapability, weatherCapability, webrtcCapability, webrtcClientHintsSchema, webrtcSessionCapability, wiringAddonHealthSchema, wiringHealthSnapshotSchema, wiringNodeHealthSchema, wiringProbeKindSchema, wiringProbeResultSchema, zodEntriesToConfigUI, zoneAnalyticsCapability, zoneRulesCapability, zonesCapability };
|