@camstack/addon-provider-ecowitt 0.1.13 → 0.1.15
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 +1242 -87
- package/dist/addon.mjs +1242 -87
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -4645,7 +4645,7 @@ function preprocess(fn, schema) {
|
|
|
4645
4645
|
});
|
|
4646
4646
|
}
|
|
4647
4647
|
//#endregion
|
|
4648
|
-
//#region ../types/dist/sleep-
|
|
4648
|
+
//#region ../types/dist/sleep-BiDFW0E7.mjs
|
|
4649
4649
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4650
4650
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4651
4651
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -5458,6 +5458,100 @@ function createDurableState(deps) {
|
|
|
5458
5458
|
};
|
|
5459
5459
|
}
|
|
5460
5460
|
/**
|
|
5461
|
+
* Per-node scoping for the shared addon-settings blob.
|
|
5462
|
+
*
|
|
5463
|
+
* An addon's settings store is hub-central (the `addon-settings` cap is
|
|
5464
|
+
* hub-routed — the hub instance answers for every node), so fields whose
|
|
5465
|
+
* value is a NODE fact (decoder backend, engine pick, probed hardware
|
|
5466
|
+
* capabilities) persist under the node-scoped key `<key>@<nodeId>` inside
|
|
5467
|
+
* the single shared blob. The SCHEMA field key stays bare: the write path
|
|
5468
|
+
* ({@link scopePatch}) maps the bare field onto the target node's scoped
|
|
5469
|
+
* key; the read/hydrate path ({@link projectStore}) maps THIS node's value
|
|
5470
|
+
* back, so UI forms and `resolveConfig` only ever see the bare key.
|
|
5471
|
+
*
|
|
5472
|
+
* Fields opt in via the `perNode: true` schema marker on `ConfigFieldBase`
|
|
5473
|
+
* (`interfaces/config-ui.ts`); `BaseAddon` derives the key set from the
|
|
5474
|
+
* schema and routes reads/writes through these helpers.
|
|
5475
|
+
*
|
|
5476
|
+
* ## No bare-key fallback — deliberate
|
|
5477
|
+
*
|
|
5478
|
+
* {@link readNodeValue} reads the node-scoped key ONLY. A node with no
|
|
5479
|
+
* scoped key resolves to `undefined` so the field's schema `default` wins —
|
|
5480
|
+
* NEVER `store[base]` and never another node's value. A bare legacy key in
|
|
5481
|
+
* the store is invisible to every node, hub included, so one node's
|
|
5482
|
+
* selection can never leak onto another. (This generalizes the
|
|
5483
|
+
* `decoder-backend-keys.ts` semantics — the no-fallback variant — over an
|
|
5484
|
+
* arbitrary set of per-node field keys.)
|
|
5485
|
+
*
|
|
5486
|
+
* Pure functions only — no I/O, no imports beyond the language. This is a
|
|
5487
|
+
* LEAF module: import it via its deep path, never from the root barrel.
|
|
5488
|
+
*/
|
|
5489
|
+
/**
|
|
5490
|
+
* Normalize a raw kernel node id to the bare node id used for scoping.
|
|
5491
|
+
* `localNodeId` can carry a `<node>/<addon>` suffix on forked child
|
|
5492
|
+
* processes; per-node settings are per-NODE, so strip the addon segment.
|
|
5493
|
+
* `undefined` / `null` / empty falls back to `'hub'`.
|
|
5494
|
+
*/
|
|
5495
|
+
function normalizeNodeId(raw) {
|
|
5496
|
+
if (raw === void 0 || raw === null || raw === "") return "hub";
|
|
5497
|
+
const slashIdx = raw.indexOf("/");
|
|
5498
|
+
if (slashIdx < 0) return raw;
|
|
5499
|
+
const bare = raw.slice(0, slashIdx);
|
|
5500
|
+
return bare === "" ? "hub" : bare;
|
|
5501
|
+
}
|
|
5502
|
+
/** The node-scoped store key for a per-node field: `<base>@<nodeId>`. */
|
|
5503
|
+
function nodeScopedKey(base, nodeId) {
|
|
5504
|
+
return `${base}@${normalizeNodeId(nodeId)}`;
|
|
5505
|
+
}
|
|
5506
|
+
/**
|
|
5507
|
+
* Read a node's value for a per-node field from the raw shared store:
|
|
5508
|
+
* the node-scoped key when present, otherwise `undefined`.
|
|
5509
|
+
* Deliberately NO bare-key fallback (see module doc) — the caller lets the
|
|
5510
|
+
* schema `default` win on `undefined`.
|
|
5511
|
+
*/
|
|
5512
|
+
function readNodeValue(store, base, nodeId) {
|
|
5513
|
+
return store[nodeScopedKey(base, nodeId)];
|
|
5514
|
+
}
|
|
5515
|
+
/**
|
|
5516
|
+
* Re-map a UI/settings patch so every bare perNode field persists under the
|
|
5517
|
+
* TARGET node's scoped key; all other keys pass through unchanged. Used on
|
|
5518
|
+
* the write path so a save for one node never clobbers another node's value
|
|
5519
|
+
* (and the bare key is never written). Returns a new object — the input
|
|
5520
|
+
* patch is not mutated.
|
|
5521
|
+
*/
|
|
5522
|
+
function scopePatch(patch, perNodeKeys, nodeId) {
|
|
5523
|
+
const out = {};
|
|
5524
|
+
for (const [key, value] of Object.entries(patch)) out[perNodeKeys.has(key) ? nodeScopedKey(key, nodeId) : key] = value;
|
|
5525
|
+
return out;
|
|
5526
|
+
}
|
|
5527
|
+
/**
|
|
5528
|
+
* Project the raw shared store onto the bare schema keys for ONE node so a
|
|
5529
|
+
* UI schema (whose field keys are bare) hydrates from that node's own
|
|
5530
|
+
* values:
|
|
5531
|
+
*
|
|
5532
|
+
* - EVERY `@`-scoped key (any node's) is dropped from the pass-through.
|
|
5533
|
+
* - Every bare perNode key is dropped from the pass-through (a stray bare
|
|
5534
|
+
* legacy key must never hydrate any node — no bare fallback).
|
|
5535
|
+
* - THIS node's effective value ({@link readNodeValue}) is then laid onto
|
|
5536
|
+
* each bare perNode key; when the node has no scoped key the bare key is
|
|
5537
|
+
* left ABSENT so the field's schema `default` wins.
|
|
5538
|
+
*
|
|
5539
|
+
* Returns a new object — the input store is not mutated.
|
|
5540
|
+
*/
|
|
5541
|
+
function projectStore(store, perNodeKeys, nodeId) {
|
|
5542
|
+
const out = {};
|
|
5543
|
+
for (const [key, value] of Object.entries(store)) {
|
|
5544
|
+
if (key.includes("@")) continue;
|
|
5545
|
+
if (perNodeKeys.has(key)) continue;
|
|
5546
|
+
out[key] = value;
|
|
5547
|
+
}
|
|
5548
|
+
for (const base of perNodeKeys) {
|
|
5549
|
+
const value = readNodeValue(store, base, nodeId);
|
|
5550
|
+
if (value !== void 0) out[base] = value;
|
|
5551
|
+
}
|
|
5552
|
+
return out;
|
|
5553
|
+
}
|
|
5554
|
+
/**
|
|
5461
5555
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
5462
5556
|
*
|
|
5463
5557
|
* - Typed `config` property with automatic resolution from store + defaults
|
|
@@ -5625,23 +5719,63 @@ var BaseAddon = class {
|
|
|
5625
5719
|
deviceSettingsSchema() {
|
|
5626
5720
|
return null;
|
|
5627
5721
|
}
|
|
5628
|
-
async getGlobalSettings(overlay, cap,
|
|
5722
|
+
async getGlobalSettings(overlay, cap, nodeId) {
|
|
5629
5723
|
const schema = this.globalSettingsSchema(cap);
|
|
5630
5724
|
if (!schema) return { sections: [] };
|
|
5631
|
-
const
|
|
5725
|
+
const projected = await this.resolveGlobalStore(nodeId, cap);
|
|
5632
5726
|
return hydrateSchema(schema, overlay ? {
|
|
5633
|
-
...
|
|
5727
|
+
...projected,
|
|
5634
5728
|
...overlay
|
|
5635
|
-
} :
|
|
5729
|
+
} : projected);
|
|
5636
5730
|
}
|
|
5637
|
-
|
|
5638
|
-
|
|
5731
|
+
/**
|
|
5732
|
+
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
5733
|
+
* every `perNode: true` field carries THAT node's scoped value on its bare
|
|
5734
|
+
* key (absent scoped key ⇒ key absent, so the schema `default` wins — no
|
|
5735
|
+
* bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
|
|
5736
|
+
* A no-op passthrough when the schema declares no `perNode` field.
|
|
5737
|
+
*
|
|
5738
|
+
* This is the sanctioned way for a `getGlobalSettings` OVERRIDE that needs
|
|
5739
|
+
* the store for custom option logic (option narrowing, value snapping) to
|
|
5740
|
+
* read it per-node — never `ctx.settings.readAddonStore()` directly.
|
|
5741
|
+
* `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
|
|
5742
|
+
*/
|
|
5743
|
+
async resolveGlobalStore(nodeId, cap) {
|
|
5744
|
+
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
5745
|
+
const keys = this.perNodeKeys(cap);
|
|
5746
|
+
const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
5747
|
+
return keys.size > 0 ? projectStore(raw, keys, node) : raw;
|
|
5748
|
+
}
|
|
5749
|
+
async updateGlobalSettings(patch, nodeId) {
|
|
5750
|
+
const keys = this.perNodeKeys();
|
|
5751
|
+
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
5752
|
+
const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
|
|
5753
|
+
const barePatch = patch;
|
|
5754
|
+
const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
|
|
5755
|
+
await this._ctx?.settings?.writeAddonStore(scoped);
|
|
5756
|
+
if (target !== localNode) return;
|
|
5639
5757
|
await this.resolveConfig();
|
|
5640
5758
|
await this.onConfigChanged();
|
|
5641
5759
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
5642
5760
|
this.maybeAutoRestart(patch, this.globalSettingsSchema());
|
|
5643
5761
|
}
|
|
5644
5762
|
/**
|
|
5763
|
+
* The set of field keys the global settings schema declares `perNode: true`
|
|
5764
|
+
* — derived once per `cap` argument and memoized (schemas are static
|
|
5765
|
+
* declarations). Empty set ⇒ every per-node code path is bypassed and the
|
|
5766
|
+
* settings API behaves exactly like the legacy node-agnostic one.
|
|
5767
|
+
*/
|
|
5768
|
+
_perNodeKeysCache = /* @__PURE__ */ new Map();
|
|
5769
|
+
perNodeKeys(cap) {
|
|
5770
|
+
const cacheKey = cap ?? "";
|
|
5771
|
+
const cached = this._perNodeKeysCache.get(cacheKey);
|
|
5772
|
+
if (cached) return cached;
|
|
5773
|
+
const schema = this.globalSettingsSchema(cap);
|
|
5774
|
+
const keys = new Set(schema ? schema.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
|
|
5775
|
+
this._perNodeKeysCache.set(cacheKey, keys);
|
|
5776
|
+
return keys;
|
|
5777
|
+
}
|
|
5778
|
+
/**
|
|
5645
5779
|
* If any field in `patch` is marked `requiresRestart` in `schema`,
|
|
5646
5780
|
* schedule an addon restart for the next tick. Deferred via
|
|
5647
5781
|
* `setImmediate` so the tRPC mutation that triggered the write has
|
|
@@ -5794,12 +5928,19 @@ var BaseAddon = class {
|
|
|
5794
5928
|
* The merge is shallow: each key in `defaults` is checked against the store.
|
|
5795
5929
|
* Only keys present in defaults are read — the store can contain extra keys
|
|
5796
5930
|
* (e.g. from older versions) without polluting the typed config.
|
|
5931
|
+
*
|
|
5932
|
+
* Keys the global settings schema declares `perNode: true` resolve from
|
|
5933
|
+
* THIS node's scoped key (`<key>@<localNode>`) via `readNodeValue` — never
|
|
5934
|
+
* from the bare key — so a per-node field resolves to this node's own
|
|
5935
|
+
* selection at boot (absent scoped key ⇒ the constructor default wins).
|
|
5797
5936
|
*/
|
|
5798
5937
|
async resolveConfig() {
|
|
5799
5938
|
const stored = await this.readAddonStoreWithRetry();
|
|
5939
|
+
const perNode = this.perNodeKeys();
|
|
5940
|
+
const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
|
|
5800
5941
|
const resolved = { ...this.defaults };
|
|
5801
5942
|
for (const key of Object.keys(this.defaults)) {
|
|
5802
|
-
const storedValue = stored[key];
|
|
5943
|
+
const storedValue = perNode.has(key) ? readNodeValue(stored, key, localNode) : stored[key];
|
|
5803
5944
|
if (storedValue !== void 0 && storedValue !== null) {
|
|
5804
5945
|
const defaultType = typeof this.defaults[key];
|
|
5805
5946
|
if (typeof storedValue === defaultType) resolved[key] = storedValue;
|
|
@@ -5883,6 +6024,27 @@ var BaseAddon = class {
|
|
|
5883
6024
|
}
|
|
5884
6025
|
};
|
|
5885
6026
|
/**
|
|
6027
|
+
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
6028
|
+
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
6029
|
+
* `hydrateSchema` does. Valueless structural fields (separator/info/…)
|
|
6030
|
+
* don't declare `perNode` and are excluded by the `in` narrowing.
|
|
6031
|
+
*/
|
|
6032
|
+
function collectPerNodeFieldKeys(fields) {
|
|
6033
|
+
const collected = [];
|
|
6034
|
+
for (const field of fields) {
|
|
6035
|
+
if (field.type === "group") {
|
|
6036
|
+
collected.push(...collectPerNodeFieldKeys(field.fields));
|
|
6037
|
+
continue;
|
|
6038
|
+
}
|
|
6039
|
+
if (field.type === "sub-tabs") {
|
|
6040
|
+
for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
|
|
6041
|
+
continue;
|
|
6042
|
+
}
|
|
6043
|
+
if ("perNode" in field && field.perNode === true) collected.push(field.key);
|
|
6044
|
+
}
|
|
6045
|
+
return collected;
|
|
6046
|
+
}
|
|
6047
|
+
/**
|
|
5886
6048
|
* Normalize an `ICamstackAddon.initialize()` return value into the
|
|
5887
6049
|
* `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
|
|
5888
6050
|
* envelopes pass through; void stays void.
|
|
@@ -6290,6 +6452,13 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
6290
6452
|
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
6291
6453
|
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
6292
6454
|
DeviceType["Image"] = "image";
|
|
6455
|
+
/** Smart pet feeder — cloud-connected food dispenser with a bowl food
|
|
6456
|
+
* level, battery, desiccant life, feeding state and manual-feed /
|
|
6457
|
+
* call-pet / maintenance actions. Installed with the `pet-feeder` cap;
|
|
6458
|
+
* dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
|
|
6459
|
+
* native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
|
|
6460
|
+
* integrations sharing the same food/desiccant/hopper surface. */
|
|
6461
|
+
DeviceType["PetFeeder"] = "pet-feeder";
|
|
6293
6462
|
return DeviceType;
|
|
6294
6463
|
}({});
|
|
6295
6464
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -7454,6 +7623,601 @@ var _macroLookup = /* @__PURE__ */ new Map();
|
|
|
7454
7623
|
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7455
7624
|
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7456
7625
|
/**
|
|
7626
|
+
* Error types for the safe expression engine. Two distinct classes so callers
|
|
7627
|
+
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
7628
|
+
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
7629
|
+
*/
|
|
7630
|
+
/** Thrown by the tokenizer / parser. Carries a 0-based source `position` when
|
|
7631
|
+
* the failure is anchored to a character (author-facing inline feedback). */
|
|
7632
|
+
var ExpressionParseError = class extends Error {
|
|
7633
|
+
position;
|
|
7634
|
+
constructor(message, position) {
|
|
7635
|
+
super(message);
|
|
7636
|
+
this.name = "ExpressionParseError";
|
|
7637
|
+
this.position = position;
|
|
7638
|
+
}
|
|
7639
|
+
};
|
|
7640
|
+
/** Thrown by the evaluator (unknown identifier, type mismatch, non-finite
|
|
7641
|
+
* result, unknown builtin, step-budget exceeded). */
|
|
7642
|
+
var ExpressionEvalError = class extends Error {
|
|
7643
|
+
constructor(message) {
|
|
7644
|
+
super(message);
|
|
7645
|
+
this.name = "ExpressionEvalError";
|
|
7646
|
+
}
|
|
7647
|
+
};
|
|
7648
|
+
/**
|
|
7649
|
+
* Resource-bound constants for the safe expression engine.
|
|
7650
|
+
*
|
|
7651
|
+
* Every bound is defense-in-depth: the grammar is non-Turing-complete (no
|
|
7652
|
+
* loops, recursion, lambdas or member access — see `ast.ts`), so evaluation is
|
|
7653
|
+
* O(nodeCount) by construction. These caps merely put a hard ceiling on the
|
|
7654
|
+
* work a single author-supplied expression can request, so a hostile or
|
|
7655
|
+
* accidental pathological string can never spend unbounded CPU/memory.
|
|
7656
|
+
*/
|
|
7657
|
+
/** Max source length (chars) — checked BEFORE tokenizing so a huge string is
|
|
7658
|
+
* rejected without allocation. */
|
|
7659
|
+
var MAX_EXPRESSION_SOURCE_LENGTH = 2048;
|
|
7660
|
+
/** A legal binding / identifier name. */
|
|
7661
|
+
var EXPRESSION_IDENTIFIER_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
7662
|
+
/** Binding names an author may NOT use: `now` is auto-injected; the literal
|
|
7663
|
+
* keywords lex as values, not identifiers, so binding to them is meaningless. */
|
|
7664
|
+
var RESERVED_BINDING_NAMES = new Set([
|
|
7665
|
+
"now",
|
|
7666
|
+
"true",
|
|
7667
|
+
"false",
|
|
7668
|
+
"null"
|
|
7669
|
+
]);
|
|
7670
|
+
/**
|
|
7671
|
+
* Tokenizer for the safe expression mini-language. Hand-rolled, single-pass,
|
|
7672
|
+
* zero-dependency. The grammar is deliberately boring: decimal numbers,
|
|
7673
|
+
* single/double-quoted strings with a tiny escape set, identifiers, the three
|
|
7674
|
+
* value keywords (`true`/`false`/`null`) and a fixed punctuator set. Anything
|
|
7675
|
+
* outside that — a bare `.`, `=`, `[`, `]`, `{`, `}`, `;`, backtick, `&`, `|` —
|
|
7676
|
+
* is a parse error with a source position, so member access / assignment /
|
|
7677
|
+
* template literals are lexically impossible.
|
|
7678
|
+
*/
|
|
7679
|
+
var KEYWORDS = new Set([
|
|
7680
|
+
"true",
|
|
7681
|
+
"false",
|
|
7682
|
+
"null"
|
|
7683
|
+
]);
|
|
7684
|
+
function isDigit(ch) {
|
|
7685
|
+
return ch >= "0" && ch <= "9";
|
|
7686
|
+
}
|
|
7687
|
+
function isIdentStart(ch) {
|
|
7688
|
+
return ch >= "A" && ch <= "Z" || ch >= "a" && ch <= "z" || ch === "_";
|
|
7689
|
+
}
|
|
7690
|
+
function isIdentPart(ch) {
|
|
7691
|
+
return isIdentStart(ch) || isDigit(ch);
|
|
7692
|
+
}
|
|
7693
|
+
function isWhitespace(ch) {
|
|
7694
|
+
return ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "\f" || ch === "\v";
|
|
7695
|
+
}
|
|
7696
|
+
/** Tokenize `source` into a flat token list ending with a single `eof` token.
|
|
7697
|
+
* Throws `ExpressionParseError` on any illegal character or unterminated
|
|
7698
|
+
* string. */
|
|
7699
|
+
function tokenize(source) {
|
|
7700
|
+
if (source.length > 2048) throw new ExpressionParseError(`expression too long (${source.length} > ${MAX_EXPRESSION_SOURCE_LENGTH} chars)`, 0);
|
|
7701
|
+
const tokens = [];
|
|
7702
|
+
let i = 0;
|
|
7703
|
+
const n = source.length;
|
|
7704
|
+
while (i < n) {
|
|
7705
|
+
const ch = source[i];
|
|
7706
|
+
if (isWhitespace(ch)) {
|
|
7707
|
+
i += 1;
|
|
7708
|
+
continue;
|
|
7709
|
+
}
|
|
7710
|
+
if (isDigit(ch)) {
|
|
7711
|
+
const start = i;
|
|
7712
|
+
while (i < n && isDigit(source[i])) i += 1;
|
|
7713
|
+
if (i < n && source[i] === ".") {
|
|
7714
|
+
if (i + 1 >= n || !isDigit(source[i + 1])) throw new ExpressionParseError("malformed number: decimal point needs a digit", i);
|
|
7715
|
+
i += 1;
|
|
7716
|
+
while (i < n && isDigit(source[i])) i += 1;
|
|
7717
|
+
}
|
|
7718
|
+
const text = source.slice(start, i);
|
|
7719
|
+
const value = Number(text);
|
|
7720
|
+
if (!Number.isFinite(value)) throw new ExpressionParseError(`malformed number: '${text}'`, start);
|
|
7721
|
+
tokens.push({
|
|
7722
|
+
type: "number",
|
|
7723
|
+
value,
|
|
7724
|
+
pos: start
|
|
7725
|
+
});
|
|
7726
|
+
continue;
|
|
7727
|
+
}
|
|
7728
|
+
if (ch === "'" || ch === "\"") {
|
|
7729
|
+
const quote = ch;
|
|
7730
|
+
const start = i;
|
|
7731
|
+
i += 1;
|
|
7732
|
+
let out = "";
|
|
7733
|
+
let closed = false;
|
|
7734
|
+
while (i < n) {
|
|
7735
|
+
const c = source[i];
|
|
7736
|
+
if (c === "\\") {
|
|
7737
|
+
const next = i + 1 < n ? source[i + 1] : "";
|
|
7738
|
+
if (next === "\\" || next === "'" || next === "\"") {
|
|
7739
|
+
out += next;
|
|
7740
|
+
i += 2;
|
|
7741
|
+
continue;
|
|
7742
|
+
}
|
|
7743
|
+
throw new ExpressionParseError(`invalid string escape: '\\${next}'`, i);
|
|
7744
|
+
}
|
|
7745
|
+
if (c === quote) {
|
|
7746
|
+
closed = true;
|
|
7747
|
+
i += 1;
|
|
7748
|
+
break;
|
|
7749
|
+
}
|
|
7750
|
+
out += c;
|
|
7751
|
+
i += 1;
|
|
7752
|
+
}
|
|
7753
|
+
if (!closed) throw new ExpressionParseError("unterminated string literal", start);
|
|
7754
|
+
tokens.push({
|
|
7755
|
+
type: "string",
|
|
7756
|
+
value: out,
|
|
7757
|
+
pos: start
|
|
7758
|
+
});
|
|
7759
|
+
continue;
|
|
7760
|
+
}
|
|
7761
|
+
if (isIdentStart(ch)) {
|
|
7762
|
+
const start = i;
|
|
7763
|
+
while (i < n && isIdentPart(source[i])) i += 1;
|
|
7764
|
+
const text = source.slice(start, i);
|
|
7765
|
+
if (KEYWORDS.has(text)) tokens.push({
|
|
7766
|
+
type: "keyword",
|
|
7767
|
+
keyword: keywordOf(text),
|
|
7768
|
+
pos: start
|
|
7769
|
+
});
|
|
7770
|
+
else tokens.push({
|
|
7771
|
+
type: "identifier",
|
|
7772
|
+
name: text,
|
|
7773
|
+
pos: start
|
|
7774
|
+
});
|
|
7775
|
+
continue;
|
|
7776
|
+
}
|
|
7777
|
+
const two = i + 1 < n ? source.slice(i, i + 2) : "";
|
|
7778
|
+
if (two === "<=" || two === ">=" || two === "==" || two === "!=" || two === "&&" || two === "||") {
|
|
7779
|
+
tokens.push({
|
|
7780
|
+
type: "punct",
|
|
7781
|
+
punct: two,
|
|
7782
|
+
pos: i
|
|
7783
|
+
});
|
|
7784
|
+
i += 2;
|
|
7785
|
+
continue;
|
|
7786
|
+
}
|
|
7787
|
+
if (isSinglePunct(ch)) {
|
|
7788
|
+
tokens.push({
|
|
7789
|
+
type: "punct",
|
|
7790
|
+
punct: ch,
|
|
7791
|
+
pos: i
|
|
7792
|
+
});
|
|
7793
|
+
i += 1;
|
|
7794
|
+
continue;
|
|
7795
|
+
}
|
|
7796
|
+
throw new ExpressionParseError(`unexpected character '${ch}'`, i);
|
|
7797
|
+
}
|
|
7798
|
+
tokens.push({
|
|
7799
|
+
type: "eof",
|
|
7800
|
+
pos: n
|
|
7801
|
+
});
|
|
7802
|
+
return tokens;
|
|
7803
|
+
}
|
|
7804
|
+
function keywordOf(text) {
|
|
7805
|
+
if (text === "true") return "true";
|
|
7806
|
+
if (text === "false") return "false";
|
|
7807
|
+
return "null";
|
|
7808
|
+
}
|
|
7809
|
+
function isSinglePunct(ch) {
|
|
7810
|
+
return ch === "(" || ch === ")" || ch === "," || ch === "?" || ch === ":" || ch === "+" || ch === "-" || ch === "*" || ch === "/" || ch === "%" || ch === "!" || ch === "<" || ch === ">";
|
|
7811
|
+
}
|
|
7812
|
+
/**
|
|
7813
|
+
* Frozen, null-prototype builtin function table for the expression engine
|
|
7814
|
+
* (spec §4 rule 4). The table is the SOLE surface of callable functions: the
|
|
7815
|
+
* parser rejects any callee not in it, and the evaluator gates each call on an
|
|
7816
|
+
* own-property check against it.
|
|
7817
|
+
*
|
|
7818
|
+
* Because the object has a NULL prototype AND is `Object.freeze`d:
|
|
7819
|
+
* - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
|
|
7820
|
+
* - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
|
|
7821
|
+
* (there is no `Object.prototype` in the chain), so those names are not
|
|
7822
|
+
* callable — they are simply "unknown function" at parse time.
|
|
7823
|
+
*
|
|
7824
|
+
* Every numeric argument is validated as a finite number and every numeric
|
|
7825
|
+
* RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
|
|
7826
|
+
* (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
|
|
7827
|
+
* closed rather than emitting a garbage value.
|
|
7828
|
+
*/
|
|
7829
|
+
function asFiniteNumber(value, name, index) {
|
|
7830
|
+
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
7831
|
+
return value;
|
|
7832
|
+
}
|
|
7833
|
+
function asString$1(value, name, index) {
|
|
7834
|
+
if (typeof value !== "string") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a string`);
|
|
7835
|
+
return value;
|
|
7836
|
+
}
|
|
7837
|
+
function finiteResult(value, name) {
|
|
7838
|
+
if (!Number.isFinite(value)) throw new ExpressionEvalError(`${name}: produced a non-finite result`);
|
|
7839
|
+
return value;
|
|
7840
|
+
}
|
|
7841
|
+
function allFiniteNumbers(args, name) {
|
|
7842
|
+
return args.map((a, idx) => asFiniteNumber(a, name, idx));
|
|
7843
|
+
}
|
|
7844
|
+
var INF = Number.POSITIVE_INFINITY;
|
|
7845
|
+
var table = {
|
|
7846
|
+
min: {
|
|
7847
|
+
minArgs: 1,
|
|
7848
|
+
maxArgs: INF,
|
|
7849
|
+
apply: (args) => finiteResult(Math.min(...allFiniteNumbers(args, "min")), "min")
|
|
7850
|
+
},
|
|
7851
|
+
max: {
|
|
7852
|
+
minArgs: 1,
|
|
7853
|
+
maxArgs: INF,
|
|
7854
|
+
apply: (args) => finiteResult(Math.max(...allFiniteNumbers(args, "max")), "max")
|
|
7855
|
+
},
|
|
7856
|
+
abs: {
|
|
7857
|
+
minArgs: 1,
|
|
7858
|
+
maxArgs: 1,
|
|
7859
|
+
apply: (args) => finiteResult(Math.abs(asFiniteNumber(args[0], "abs", 0)), "abs")
|
|
7860
|
+
},
|
|
7861
|
+
floor: {
|
|
7862
|
+
minArgs: 1,
|
|
7863
|
+
maxArgs: 1,
|
|
7864
|
+
apply: (args) => finiteResult(Math.floor(asFiniteNumber(args[0], "floor", 0)), "floor")
|
|
7865
|
+
},
|
|
7866
|
+
ceil: {
|
|
7867
|
+
minArgs: 1,
|
|
7868
|
+
maxArgs: 1,
|
|
7869
|
+
apply: (args) => finiteResult(Math.ceil(asFiniteNumber(args[0], "ceil", 0)), "ceil")
|
|
7870
|
+
},
|
|
7871
|
+
sqrt: {
|
|
7872
|
+
minArgs: 1,
|
|
7873
|
+
maxArgs: 1,
|
|
7874
|
+
apply: (args) => finiteResult(Math.sqrt(asFiniteNumber(args[0], "sqrt", 0)), "sqrt")
|
|
7875
|
+
},
|
|
7876
|
+
round: {
|
|
7877
|
+
minArgs: 1,
|
|
7878
|
+
maxArgs: 2,
|
|
7879
|
+
apply: (args) => {
|
|
7880
|
+
const x = asFiniteNumber(args[0], "round", 0);
|
|
7881
|
+
const digits = args.length > 1 ? Math.trunc(asFiniteNumber(args[1], "round", 1)) : 0;
|
|
7882
|
+
if (digits < 0 || digits > 100) throw new ExpressionEvalError("round: digits must be between 0 and 100");
|
|
7883
|
+
const factor = 10 ** digits;
|
|
7884
|
+
return finiteResult(Math.round(x * factor) / factor, "round");
|
|
7885
|
+
}
|
|
7886
|
+
},
|
|
7887
|
+
pow: {
|
|
7888
|
+
minArgs: 2,
|
|
7889
|
+
maxArgs: 2,
|
|
7890
|
+
apply: (args) => finiteResult(asFiniteNumber(args[0], "pow", 0) ** asFiniteNumber(args[1], "pow", 1), "pow")
|
|
7891
|
+
},
|
|
7892
|
+
clamp: {
|
|
7893
|
+
minArgs: 3,
|
|
7894
|
+
maxArgs: 3,
|
|
7895
|
+
apply: (args) => {
|
|
7896
|
+
const x = asFiniteNumber(args[0], "clamp", 0);
|
|
7897
|
+
const lo = asFiniteNumber(args[1], "clamp", 1);
|
|
7898
|
+
const hi = asFiniteNumber(args[2], "clamp", 2);
|
|
7899
|
+
if (lo > hi) throw new ExpressionEvalError("clamp: lower bound is greater than upper bound");
|
|
7900
|
+
return finiteResult(Math.min(hi, Math.max(lo, x)), "clamp");
|
|
7901
|
+
}
|
|
7902
|
+
},
|
|
7903
|
+
avg: {
|
|
7904
|
+
minArgs: 1,
|
|
7905
|
+
maxArgs: INF,
|
|
7906
|
+
apply: (args) => {
|
|
7907
|
+
const nums = allFiniteNumbers(args, "avg");
|
|
7908
|
+
return finiteResult(nums.reduce((acc, v) => acc + v, 0) / nums.length, "avg");
|
|
7909
|
+
}
|
|
7910
|
+
},
|
|
7911
|
+
sum: {
|
|
7912
|
+
minArgs: 1,
|
|
7913
|
+
maxArgs: INF,
|
|
7914
|
+
apply: (args) => finiteResult(allFiniteNumbers(args, "sum").reduce((acc, v) => acc + v, 0), "sum")
|
|
7915
|
+
},
|
|
7916
|
+
coalesce: {
|
|
7917
|
+
minArgs: 1,
|
|
7918
|
+
maxArgs: INF,
|
|
7919
|
+
apply: (args) => {
|
|
7920
|
+
for (const a of args) if (a !== null) return a;
|
|
7921
|
+
return null;
|
|
7922
|
+
}
|
|
7923
|
+
},
|
|
7924
|
+
age: {
|
|
7925
|
+
minArgs: 2,
|
|
7926
|
+
maxArgs: 2,
|
|
7927
|
+
apply: (args) => finiteResult(asFiniteNumber(args[0], "age", 0) - asFiniteNumber(args[1], "age", 1), "age")
|
|
7928
|
+
},
|
|
7929
|
+
convert: {
|
|
7930
|
+
minArgs: 3,
|
|
7931
|
+
maxArgs: 3,
|
|
7932
|
+
apply: (args, hooks) => {
|
|
7933
|
+
const x = asFiniteNumber(args[0], "convert", 0);
|
|
7934
|
+
const from = asString$1(args[1], "convert", 1).trim();
|
|
7935
|
+
const to = asString$1(args[2], "convert", 2).trim();
|
|
7936
|
+
if (hooks.convert) {
|
|
7937
|
+
const out = hooks.convert(x, from, to);
|
|
7938
|
+
if (out === null) throw new ExpressionEvalError(`convert: cannot convert '${from}' to '${to}'`);
|
|
7939
|
+
return finiteResult(out, "convert");
|
|
7940
|
+
}
|
|
7941
|
+
if (from === to) return x;
|
|
7942
|
+
throw new ExpressionEvalError("convert: unit conversion table not installed");
|
|
7943
|
+
}
|
|
7944
|
+
}
|
|
7945
|
+
};
|
|
7946
|
+
Object.freeze(Object.assign(Object.create(null), table));
|
|
7947
|
+
/** The set of valid builtin names — used by the parser to reject unknown
|
|
7948
|
+
* callees at parse time (immediate author feedback). */
|
|
7949
|
+
var EXPRESSION_BUILTIN_NAMES = new Set(Object.keys(table));
|
|
7950
|
+
/**
|
|
7951
|
+
* Pratt (precedence-climbing) parser for the safe expression mini-language.
|
|
7952
|
+
*
|
|
7953
|
+
* Precedence (low → high): ternary `?:` (right-assoc) → `||` → `&&` → equality
|
|
7954
|
+
* → relational → additive → multiplicative → unary `! -` → call / primary.
|
|
7955
|
+
* Calls are ONLY `IDENT '(' args? ')'` at primary position — the callee is a
|
|
7956
|
+
* string validated against the builtin table at parse time, so an unknown
|
|
7957
|
+
* function is rejected immediately (author feedback) and a persisted expression
|
|
7958
|
+
* that references a since-removed builtin degrades at read.
|
|
7959
|
+
*
|
|
7960
|
+
* A node counter caps total AST size (`MAX_EXPRESSION_AST_NODES`) and call
|
|
7961
|
+
* arity is capped (`MAX_EXPRESSION_CALL_ARGS`) — both raise `ExpressionParseError`.
|
|
7962
|
+
*/
|
|
7963
|
+
/** Binary/logical operator precedence (higher binds tighter). */
|
|
7964
|
+
var BINARY_PRECEDENCE = {
|
|
7965
|
+
"||": 1,
|
|
7966
|
+
"&&": 2,
|
|
7967
|
+
"==": 3,
|
|
7968
|
+
"!=": 3,
|
|
7969
|
+
"<": 4,
|
|
7970
|
+
"<=": 4,
|
|
7971
|
+
">": 4,
|
|
7972
|
+
">=": 4,
|
|
7973
|
+
"+": 5,
|
|
7974
|
+
"-": 5,
|
|
7975
|
+
"*": 6,
|
|
7976
|
+
"/": 6,
|
|
7977
|
+
"%": 6
|
|
7978
|
+
};
|
|
7979
|
+
function isLogicalOp(op) {
|
|
7980
|
+
return op === "&&" || op === "||";
|
|
7981
|
+
}
|
|
7982
|
+
function isBinaryOp(op) {
|
|
7983
|
+
return op === "+" || op === "-" || op === "*" || op === "/" || op === "%" || op === "==" || op === "!=" || op === "<" || op === "<=" || op === ">" || op === ">=";
|
|
7984
|
+
}
|
|
7985
|
+
var Parser = class {
|
|
7986
|
+
tokens;
|
|
7987
|
+
pos = 0;
|
|
7988
|
+
nodeCount = 0;
|
|
7989
|
+
identifiers = /* @__PURE__ */ new Set();
|
|
7990
|
+
callees = /* @__PURE__ */ new Set();
|
|
7991
|
+
constructor(tokens) {
|
|
7992
|
+
this.tokens = tokens;
|
|
7993
|
+
}
|
|
7994
|
+
parse() {
|
|
7995
|
+
const ast = this.parseTernary();
|
|
7996
|
+
const tok = this.peek();
|
|
7997
|
+
if (tok.type !== "eof") throw new ExpressionParseError("unexpected trailing input", tok.pos);
|
|
7998
|
+
return {
|
|
7999
|
+
ast,
|
|
8000
|
+
identifiers: this.identifiers,
|
|
8001
|
+
callees: this.callees,
|
|
8002
|
+
nodeCount: this.nodeCount
|
|
8003
|
+
};
|
|
8004
|
+
}
|
|
8005
|
+
peek() {
|
|
8006
|
+
return this.tokens[this.pos];
|
|
8007
|
+
}
|
|
8008
|
+
next() {
|
|
8009
|
+
return this.tokens[this.pos++];
|
|
8010
|
+
}
|
|
8011
|
+
/** Consume a punctuator token, erroring if the next token isn't it. */
|
|
8012
|
+
expectPunct(punct) {
|
|
8013
|
+
const tok = this.peek();
|
|
8014
|
+
if (tok.type !== "punct" || tok.punct !== punct) throw new ExpressionParseError(`expected '${punct}'`, tok.pos);
|
|
8015
|
+
this.pos += 1;
|
|
8016
|
+
}
|
|
8017
|
+
matchPunct(punct) {
|
|
8018
|
+
const tok = this.peek();
|
|
8019
|
+
if (tok.type === "punct" && tok.punct === punct) {
|
|
8020
|
+
this.pos += 1;
|
|
8021
|
+
return true;
|
|
8022
|
+
}
|
|
8023
|
+
return false;
|
|
8024
|
+
}
|
|
8025
|
+
countNode() {
|
|
8026
|
+
this.nodeCount += 1;
|
|
8027
|
+
if (this.nodeCount > 256) throw new ExpressionParseError("expression too complex", this.peek().pos);
|
|
8028
|
+
}
|
|
8029
|
+
parseTernary() {
|
|
8030
|
+
const test = this.parseBinary(1);
|
|
8031
|
+
if (this.matchPunct("?")) {
|
|
8032
|
+
const consequent = this.parseTernary();
|
|
8033
|
+
this.expectPunct(":");
|
|
8034
|
+
const alternate = this.parseTernary();
|
|
8035
|
+
this.countNode();
|
|
8036
|
+
return {
|
|
8037
|
+
kind: "conditional",
|
|
8038
|
+
test,
|
|
8039
|
+
consequent,
|
|
8040
|
+
alternate
|
|
8041
|
+
};
|
|
8042
|
+
}
|
|
8043
|
+
return test;
|
|
8044
|
+
}
|
|
8045
|
+
parseBinary(minPrec) {
|
|
8046
|
+
let left = this.parseUnary();
|
|
8047
|
+
for (;;) {
|
|
8048
|
+
const tok = this.peek();
|
|
8049
|
+
if (tok.type !== "punct") break;
|
|
8050
|
+
const prec = BINARY_PRECEDENCE[tok.punct];
|
|
8051
|
+
if (prec === void 0 || prec < minPrec) break;
|
|
8052
|
+
const op = tok.punct;
|
|
8053
|
+
this.pos += 1;
|
|
8054
|
+
const right = this.parseBinary(prec + 1);
|
|
8055
|
+
this.countNode();
|
|
8056
|
+
if (isLogicalOp(op)) left = {
|
|
8057
|
+
kind: "logical",
|
|
8058
|
+
op,
|
|
8059
|
+
left,
|
|
8060
|
+
right
|
|
8061
|
+
};
|
|
8062
|
+
else if (isBinaryOp(op)) left = {
|
|
8063
|
+
kind: "binary",
|
|
8064
|
+
op,
|
|
8065
|
+
left,
|
|
8066
|
+
right
|
|
8067
|
+
};
|
|
8068
|
+
else throw new ExpressionParseError(`unexpected operator '${op}'`, tok.pos);
|
|
8069
|
+
}
|
|
8070
|
+
return left;
|
|
8071
|
+
}
|
|
8072
|
+
parseUnary() {
|
|
8073
|
+
const tok = this.peek();
|
|
8074
|
+
if (tok.type === "punct" && (tok.punct === "!" || tok.punct === "-")) {
|
|
8075
|
+
const op = tok.punct;
|
|
8076
|
+
this.pos += 1;
|
|
8077
|
+
const operand = this.parseUnary();
|
|
8078
|
+
this.countNode();
|
|
8079
|
+
return {
|
|
8080
|
+
kind: "unary",
|
|
8081
|
+
op,
|
|
8082
|
+
operand
|
|
8083
|
+
};
|
|
8084
|
+
}
|
|
8085
|
+
return this.parsePrimary();
|
|
8086
|
+
}
|
|
8087
|
+
parsePrimary() {
|
|
8088
|
+
const tok = this.next();
|
|
8089
|
+
switch (tok.type) {
|
|
8090
|
+
case "number":
|
|
8091
|
+
this.countNode();
|
|
8092
|
+
return {
|
|
8093
|
+
kind: "literal",
|
|
8094
|
+
value: tok.value
|
|
8095
|
+
};
|
|
8096
|
+
case "string":
|
|
8097
|
+
this.countNode();
|
|
8098
|
+
return {
|
|
8099
|
+
kind: "literal",
|
|
8100
|
+
value: tok.value
|
|
8101
|
+
};
|
|
8102
|
+
case "keyword":
|
|
8103
|
+
this.countNode();
|
|
8104
|
+
return {
|
|
8105
|
+
kind: "literal",
|
|
8106
|
+
value: tok.keyword === "null" ? null : tok.keyword === "true"
|
|
8107
|
+
};
|
|
8108
|
+
case "identifier": {
|
|
8109
|
+
const nextTok = this.peek();
|
|
8110
|
+
if (nextTok.type === "punct" && nextTok.punct === "(") return this.parseCall(tok.name, tok.pos);
|
|
8111
|
+
this.identifiers.add(tok.name);
|
|
8112
|
+
this.countNode();
|
|
8113
|
+
return {
|
|
8114
|
+
kind: "identifier",
|
|
8115
|
+
name: tok.name
|
|
8116
|
+
};
|
|
8117
|
+
}
|
|
8118
|
+
case "punct":
|
|
8119
|
+
if (tok.punct === "(") {
|
|
8120
|
+
const inner = this.parseTernary();
|
|
8121
|
+
this.expectPunct(")");
|
|
8122
|
+
return inner;
|
|
8123
|
+
}
|
|
8124
|
+
throw new ExpressionParseError(`unexpected token '${tok.punct}'`, tok.pos);
|
|
8125
|
+
case "eof": throw new ExpressionParseError("unexpected end of expression", tok.pos);
|
|
8126
|
+
}
|
|
8127
|
+
}
|
|
8128
|
+
parseCall(callee, pos) {
|
|
8129
|
+
if (!EXPRESSION_BUILTIN_NAMES.has(callee)) throw new ExpressionParseError(`unknown function '${callee}'`, pos);
|
|
8130
|
+
this.expectPunct("(");
|
|
8131
|
+
const args = [];
|
|
8132
|
+
if (!this.matchPunct(")")) for (;;) {
|
|
8133
|
+
args.push(this.parseTernary());
|
|
8134
|
+
if (args.length > 16) throw new ExpressionParseError(`too many arguments to '${callee}'`, pos);
|
|
8135
|
+
if (this.matchPunct(",")) continue;
|
|
8136
|
+
this.expectPunct(")");
|
|
8137
|
+
break;
|
|
8138
|
+
}
|
|
8139
|
+
this.callees.add(callee);
|
|
8140
|
+
this.countNode();
|
|
8141
|
+
return {
|
|
8142
|
+
kind: "call",
|
|
8143
|
+
callee,
|
|
8144
|
+
args
|
|
8145
|
+
};
|
|
8146
|
+
}
|
|
8147
|
+
};
|
|
8148
|
+
/** Tokenize + parse `source` into a validated `ParsedExpression`. Throws
|
|
8149
|
+
* `ExpressionParseError` on any lexical or grammatical failure. */
|
|
8150
|
+
function parseExpression(source) {
|
|
8151
|
+
return new Parser(tokenize(source)).parse();
|
|
8152
|
+
}
|
|
8153
|
+
Object.freeze({});
|
|
8154
|
+
/**
|
|
8155
|
+
* LRU compile cache for parsed expressions (spec §2.4 "parse once … LRU keyed
|
|
8156
|
+
* by expr"). The cache stores BOTH successes and failures (negative caching),
|
|
8157
|
+
* so a corrupt persisted string costs exactly one tokenize+parse total — not
|
|
8158
|
+
* one per read on a hot resolve path.
|
|
8159
|
+
*
|
|
8160
|
+
* The cache is a module-level singleton: entries are pure, content-addressed
|
|
8161
|
+
* ASTs keyed by the raw source string, so sharing one instance across all
|
|
8162
|
+
* callers is safe and maximises hit rate.
|
|
8163
|
+
*/
|
|
8164
|
+
var cache = /* @__PURE__ */ new Map();
|
|
8165
|
+
function getCached(source) {
|
|
8166
|
+
const hit = cache.get(source);
|
|
8167
|
+
if (hit !== void 0) {
|
|
8168
|
+
cache.delete(source);
|
|
8169
|
+
cache.set(source, hit);
|
|
8170
|
+
return hit;
|
|
8171
|
+
}
|
|
8172
|
+
let result;
|
|
8173
|
+
try {
|
|
8174
|
+
result = {
|
|
8175
|
+
ok: true,
|
|
8176
|
+
parsed: parseExpression(source)
|
|
8177
|
+
};
|
|
8178
|
+
} catch (err) {
|
|
8179
|
+
result = {
|
|
8180
|
+
ok: false,
|
|
8181
|
+
error: err instanceof ExpressionParseError ? err.message : String(err)
|
|
8182
|
+
};
|
|
8183
|
+
}
|
|
8184
|
+
cache.set(source, result);
|
|
8185
|
+
if (cache.size > 256) {
|
|
8186
|
+
const oldest = cache.keys().next().value;
|
|
8187
|
+
if (oldest !== void 0) cache.delete(oldest);
|
|
8188
|
+
}
|
|
8189
|
+
return result;
|
|
8190
|
+
}
|
|
8191
|
+
/** Compile `source`, returning a discriminated result instead of throwing.
|
|
8192
|
+
* Used by read paths that must degrade rather than raise. LRU/negative-cached. */
|
|
8193
|
+
function compileExpressionSafe(source) {
|
|
8194
|
+
return getCached(source);
|
|
8195
|
+
}
|
|
8196
|
+
/**
|
|
8197
|
+
* Author-time validation. Returns `null` when the source is valid, else a
|
|
8198
|
+
* human-readable error message. Checks: the expression compiles; binding count
|
|
8199
|
+
* is within `MAX_EXPRESSION_BINDINGS`; every binding name is a legal identifier,
|
|
8200
|
+
* is not reserved (`now`/keywords) and does not shadow a builtin; and every
|
|
8201
|
+
* FREE identifier of the AST is covered by a binding or the injected `now`.
|
|
8202
|
+
*/
|
|
8203
|
+
function validateExpressionSource(src) {
|
|
8204
|
+
const names = Object.keys(src.bindings);
|
|
8205
|
+
if (names.length > 32) return `too many bindings (${names.length} > 32)`;
|
|
8206
|
+
for (const name of names) {
|
|
8207
|
+
if (!EXPRESSION_IDENTIFIER_RE.test(name)) return `invalid binding name '${name}'`;
|
|
8208
|
+
if (RESERVED_BINDING_NAMES.has(name)) return `binding name '${name}' is reserved`;
|
|
8209
|
+
if (EXPRESSION_BUILTIN_NAMES.has(name)) return `binding name '${name}' shadows a builtin function`;
|
|
8210
|
+
}
|
|
8211
|
+
const compiled = compileExpressionSafe(src.expr);
|
|
8212
|
+
if (!compiled.ok) return compiled.error;
|
|
8213
|
+
const bound = new Set(names);
|
|
8214
|
+
for (const id of compiled.parsed.identifiers) {
|
|
8215
|
+
if (id === "now") continue;
|
|
8216
|
+
if (!bound.has(id)) return `expression references unbound identifier '${id}'`;
|
|
8217
|
+
}
|
|
8218
|
+
return null;
|
|
8219
|
+
}
|
|
8220
|
+
/**
|
|
7457
8221
|
* Accessory device helpers — shared across drivers.
|
|
7458
8222
|
*
|
|
7459
8223
|
* Many vendor-specific drivers register accessory child devices on
|
|
@@ -8298,7 +9062,13 @@ onStatusChanged: { data: object({
|
|
|
8298
9062
|
}) } },
|
|
8299
9063
|
status: {
|
|
8300
9064
|
schema: BatteryStatusSchema,
|
|
8301
|
-
kind: "push"
|
|
9065
|
+
kind: "push",
|
|
9066
|
+
empty: {
|
|
9067
|
+
percentage: 0,
|
|
9068
|
+
charging: "none",
|
|
9069
|
+
sleeping: false,
|
|
9070
|
+
lastUpdated: 0
|
|
9071
|
+
}
|
|
8302
9072
|
},
|
|
8303
9073
|
/**
|
|
8304
9074
|
* Runtime-state slice — every provider that registers this cap
|
|
@@ -9241,21 +10011,38 @@ var connectivityCapability = {
|
|
|
9241
10011
|
},
|
|
9242
10012
|
runtimeState: ConnectivityStatusSchema
|
|
9243
10013
|
};
|
|
10014
|
+
/**
|
|
10015
|
+
* Generic device-consumables capability — surfaces a device's
|
|
10016
|
+
* maintenance items (vacuum filters/brushes, replaceable cartridges,
|
|
10017
|
+
* descaling cycles, …) with their remaining life and an optional
|
|
10018
|
+
* "Replaced" reset action. Device-agnostic: any provider that knows its
|
|
10019
|
+
* device tracks consumables can register it; the cap declares no
|
|
10020
|
+
* vocabulary of its own — the provider names each item verbatim.
|
|
10021
|
+
*
|
|
10022
|
+
* Like `childLayout`, the cap is INERT until a provider sets items: no
|
|
10023
|
+
* provider populates it by guessing (no HA inference). The UI renders a
|
|
10024
|
+
* "No consumables reported" placeholder when `items` is empty.
|
|
10025
|
+
*/
|
|
10026
|
+
/** A single consumable item. Either a continuous `level` (remaining
|
|
10027
|
+
* life %) or a discrete `status` may be known — both may be null when a
|
|
10028
|
+
* provider only knows the item exists. `level` and `status` are not
|
|
10029
|
+
* mutually exclusive; a provider may report both. */
|
|
10030
|
+
var ConsumableItemSchema = object({
|
|
10031
|
+
/** Stable id, e.g. 'main-brush'. */
|
|
10032
|
+
key: string().min(1),
|
|
10033
|
+
/** Display name. */
|
|
10034
|
+
label: string().min(1),
|
|
10035
|
+
/** Remaining life % when known (0..100). */
|
|
10036
|
+
level: number().min(0).max(100).nullable(),
|
|
10037
|
+
/** Discrete state when known (binary mode). */
|
|
10038
|
+
status: _enum(["ok", "replace"]).nullable(),
|
|
10039
|
+
/** Ms epoch of the last replace, when known. */
|
|
10040
|
+
lastResetAt: number().nullable(),
|
|
10041
|
+
/** Whether `reset()` is meaningful for this item. */
|
|
10042
|
+
resettable: boolean()
|
|
10043
|
+
});
|
|
9244
10044
|
var ConsumablesStatusSchema = object({
|
|
9245
|
-
items: array(
|
|
9246
|
-
/** Stable id, e.g. 'main-brush'. */
|
|
9247
|
-
key: string().min(1),
|
|
9248
|
-
/** Display name. */
|
|
9249
|
-
label: string().min(1),
|
|
9250
|
-
/** Remaining life % when known (0..100). */
|
|
9251
|
-
level: number().min(0).max(100).nullable(),
|
|
9252
|
-
/** Discrete state when known (binary mode). */
|
|
9253
|
-
status: _enum(["ok", "replace"]).nullable(),
|
|
9254
|
-
/** Ms epoch of the last replace, when known. */
|
|
9255
|
-
lastResetAt: number().nullable(),
|
|
9256
|
-
/** Whether `reset()` is meaningful for this item. */
|
|
9257
|
-
resettable: boolean()
|
|
9258
|
-
})),
|
|
10045
|
+
items: array(ConsumableItemSchema),
|
|
9259
10046
|
lastChangedAt: number()
|
|
9260
10047
|
});
|
|
9261
10048
|
var consumablesCapability = {
|
|
@@ -9314,7 +10101,25 @@ reset: method(object({
|
|
|
9314
10101
|
}) },
|
|
9315
10102
|
status: {
|
|
9316
10103
|
schema: ConsumablesStatusSchema,
|
|
9317
|
-
kind: "push"
|
|
10104
|
+
kind: "push",
|
|
10105
|
+
empty: {
|
|
10106
|
+
items: [],
|
|
10107
|
+
lastChangedAt: 0
|
|
10108
|
+
},
|
|
10109
|
+
itemArray: {
|
|
10110
|
+
path: "items",
|
|
10111
|
+
keyField: "key",
|
|
10112
|
+
labelField: "label",
|
|
10113
|
+
itemSchema: ConsumableItemSchema,
|
|
10114
|
+
emptyItem: {
|
|
10115
|
+
key: "",
|
|
10116
|
+
label: "",
|
|
10117
|
+
level: null,
|
|
10118
|
+
status: null,
|
|
10119
|
+
lastResetAt: null,
|
|
10120
|
+
resettable: false
|
|
10121
|
+
}
|
|
10122
|
+
}
|
|
9318
10123
|
},
|
|
9319
10124
|
runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
|
|
9320
10125
|
};
|
|
@@ -10556,7 +11361,8 @@ var MotionAnalysisResultSchema = object({
|
|
|
10556
11361
|
});
|
|
10557
11362
|
method(object({
|
|
10558
11363
|
deviceId: number(),
|
|
10559
|
-
frame: FrameInputSchema
|
|
11364
|
+
frame: FrameInputSchema.optional(),
|
|
11365
|
+
frameHandle: FrameHandleSchema.optional()
|
|
10560
11366
|
}), MotionAnalysisResultSchema, { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), object({
|
|
10561
11367
|
deviceId: number(),
|
|
10562
11368
|
detected: boolean(),
|
|
@@ -10803,6 +11609,12 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
|
|
|
10803
11609
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
10804
11610
|
steps: array(PipelineStepInputSchema).min(1),
|
|
10805
11611
|
frame: FrameInputSchema.optional(),
|
|
11612
|
+
/**
|
|
11613
|
+
* CB5 shm passthrough — a `FrameHandle` naming the same ring slot
|
|
11614
|
+
* the decoded pixels live in. One more member of the one-of
|
|
11615
|
+
* frame/frameHandle/image/imageBase64/referenceImage group.
|
|
11616
|
+
*/
|
|
11617
|
+
frameHandle: FrameHandleSchema.optional(),
|
|
10806
11618
|
imageBase64: string().optional(),
|
|
10807
11619
|
/**
|
|
10808
11620
|
* Binary JPEG bytes — preferred over `imageBase64` on internal
|
|
@@ -11045,6 +11857,31 @@ var ReportMotionInputSchema = object({
|
|
|
11045
11857
|
regions: array(MotionRegionSchema).readonly().optional()
|
|
11046
11858
|
});
|
|
11047
11859
|
/**
|
|
11860
|
+
* Where a runner gets a camera's decoded frames (cross-node Phase 2,
|
|
11861
|
+
* restream-owner model — P2c).
|
|
11862
|
+
*
|
|
11863
|
+
* - `local-broker` (DEFAULT): today's path — subscribe to the co-located
|
|
11864
|
+
* stream-broker's shm frame plane. Every pre-P2c attach payload (no
|
|
11865
|
+
* `frameSource` key) parses to this, so the field is additive with zero
|
|
11866
|
+
* behavior change.
|
|
11867
|
+
* - `remote-restream`: the detect node is NOT the camera's source-owner.
|
|
11868
|
+
* The runner acquires the owner's COMPRESSED passthrough restream
|
|
11869
|
+
* (`streamBroker.getStreamWithCodec({video:'copy'})` — refcounted, the
|
|
11870
|
+
* double-pull guard) and decodes LOCALLY via a satellite frame plane +
|
|
11871
|
+
* pull-mode decoder session pinned to its own node. The shm ring stays
|
|
11872
|
+
* node-local; only H.264/H.265 packets cross the wire.
|
|
11873
|
+
* `hubHostnameOverride` mirrors the recorder's `recordingHubHostname`:
|
|
11874
|
+
* when set it overrides the `CAMSTACK_HUB_URL`-derived host the runner
|
|
11875
|
+
* dials for the owner's restream.
|
|
11876
|
+
*/
|
|
11877
|
+
var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal("local-broker") }), object({
|
|
11878
|
+
kind: literal("remote-restream"),
|
|
11879
|
+
/** The camera's source-owner node (slice 1: always the hub). */
|
|
11880
|
+
ownerNodeId: string(),
|
|
11881
|
+
/** Operator override for the owner host the runner dials. */
|
|
11882
|
+
hubHostnameOverride: string().optional()
|
|
11883
|
+
})]).describe("Per-camera frame-source mode for the runner (P2c)");
|
|
11884
|
+
/**
|
|
11048
11885
|
* Camera assignment payload sent by `addon-pipeline-orchestrator` to a
|
|
11049
11886
|
* specific runner instance via `attachCamera`. Carries everything the
|
|
11050
11887
|
* runner needs to subscribe to the local broker and execute inference.
|
|
@@ -11142,7 +11979,15 @@ var RunnerCameraConfigSchema = object({
|
|
|
11142
11979
|
*/
|
|
11143
11980
|
onboardMotionDrivesAnalyzer: boolean().default(true),
|
|
11144
11981
|
occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
|
|
11145
|
-
occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default)
|
|
11982
|
+
occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
|
|
11983
|
+
/**
|
|
11984
|
+
* Where this runner gets the camera's decoded frames (P2c). Defaulted so
|
|
11985
|
+
* every existing payload behaves as `local-broker` — the pre-Phase-2 path.
|
|
11986
|
+
* Populated with `remote-restream` by the orchestrator ONLY when the
|
|
11987
|
+
* camera's detect node differs from its source-owner (P2d, gated by the
|
|
11988
|
+
* `remoteSourcingNodes` rollout setting).
|
|
11989
|
+
*/
|
|
11990
|
+
frameSource: RunnerFrameSourceSchema.default({ kind: "local-broker" })
|
|
11146
11991
|
});
|
|
11147
11992
|
motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
|
|
11148
11993
|
/**
|
|
@@ -11706,6 +12551,157 @@ var numericSensorCapability = {
|
|
|
11706
12551
|
runtimeState: NumericSensorStatusSchema
|
|
11707
12552
|
};
|
|
11708
12553
|
/**
|
|
12554
|
+
* Feeder connectivity / power status — mirrors the HA petkit device-status
|
|
12555
|
+
* enum: `normal` (online, mains), `offline` (not reaching PetKit cloud),
|
|
12556
|
+
* `on_batteries` (running on battery backup). `null` until first reported.
|
|
12557
|
+
*/
|
|
12558
|
+
var PetFeederDeviceStatusSchema = _enum([
|
|
12559
|
+
"normal",
|
|
12560
|
+
"offline",
|
|
12561
|
+
"on_batteries"
|
|
12562
|
+
]);
|
|
12563
|
+
var gramsPortion = number().int().min(4).max(200);
|
|
12564
|
+
var PetFeederStatusSchema = object({
|
|
12565
|
+
/** Food currently in the bowl (grams). Null when the device has not
|
|
12566
|
+
* reported a reading yet. On dual-hopper models this is the combined
|
|
12567
|
+
* bowl reading; per-hopper levels live in `food1`/`food2`. */
|
|
12568
|
+
foodLevel: number().nullable(),
|
|
12569
|
+
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
12570
|
+
* single-hopper models. */
|
|
12571
|
+
food1: number().nullable(),
|
|
12572
|
+
/** Hopper-2 food level (grams) on dual-hopper feeders; null on
|
|
12573
|
+
* single-hopper models. */
|
|
12574
|
+
food2: number().nullable(),
|
|
12575
|
+
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
12576
|
+
* (`device_class: problem`, on = low). True when the bowl is empty /
|
|
12577
|
+
* below the feeder's low threshold. */
|
|
12578
|
+
lowFood: boolean(),
|
|
12579
|
+
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
12580
|
+
* device has no battery reading. */
|
|
12581
|
+
batteryPower: number().min(0).max(100).nullable(),
|
|
12582
|
+
/** Days of desiccant life remaining. Null when the model has no
|
|
12583
|
+
* desiccant sensor. */
|
|
12584
|
+
desiccantLeftDays: number().nullable(),
|
|
12585
|
+
/** True while a feed is in progress. */
|
|
12586
|
+
feeding: boolean(),
|
|
12587
|
+
/** Decoded connectivity / power status (HA petkit device-status enum).
|
|
12588
|
+
* Null until the device has reported a status. */
|
|
12589
|
+
status: PetFeederDeviceStatusSchema.nullable(),
|
|
12590
|
+
/** Decoded human-readable fault message. Null (or the device's `no_error`
|
|
12591
|
+
* sentinel) means healthy; a non-null string is an active fault. Pairs
|
|
12592
|
+
* with `errorCode` for consumers that want the raw integer. */
|
|
12593
|
+
error: string().nullable(),
|
|
12594
|
+
/** Raw device error code (0 / null = no error). */
|
|
12595
|
+
errorCode: number().nullable(),
|
|
12596
|
+
/** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
|
|
12597
|
+
isDualHopper: boolean(),
|
|
12598
|
+
/** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
|
|
12599
|
+
childLock: boolean(),
|
|
12600
|
+
/** Front indicator-light setting. */
|
|
12601
|
+
indicatorLight: boolean(),
|
|
12602
|
+
/** Play a chime when dispensing. */
|
|
12603
|
+
feedSound: boolean(),
|
|
12604
|
+
/** Speaker / prompt volume level (device-scaled integer). */
|
|
12605
|
+
volume: number(),
|
|
12606
|
+
/** Ms epoch when the slice was last refreshed from the cloud. */
|
|
12607
|
+
lastFetchedAt: number()
|
|
12608
|
+
});
|
|
12609
|
+
var petFeederCapability = {
|
|
12610
|
+
name: "pet-feeder",
|
|
12611
|
+
scope: "device",
|
|
12612
|
+
deviceNative: true,
|
|
12613
|
+
mode: "singleton",
|
|
12614
|
+
deviceTypes: [DeviceType.PetFeeder],
|
|
12615
|
+
methods: {
|
|
12616
|
+
/**
|
|
12617
|
+
* Dispense food now. Single-hopper feeders take `grams`; dual-hopper
|
|
12618
|
+
* feeders (D4S/D4SH) accept `hopper1`/`hopper2` to target one or both
|
|
12619
|
+
* hoppers. All portions honour the 4–200 g hardware range. At least
|
|
12620
|
+
* one of the three must be present — the provider rejects an empty
|
|
12621
|
+
* request.
|
|
12622
|
+
*/
|
|
12623
|
+
feed: method(object({
|
|
12624
|
+
deviceId: number().int().nonnegative(),
|
|
12625
|
+
grams: gramsPortion.optional(),
|
|
12626
|
+
hopper1: gramsPortion.optional(),
|
|
12627
|
+
hopper2: gramsPortion.optional()
|
|
12628
|
+
}), _void(), {
|
|
12629
|
+
kind: "mutation",
|
|
12630
|
+
auth: "admin"
|
|
12631
|
+
}),
|
|
12632
|
+
/** Cancel an in-progress manual feed. */
|
|
12633
|
+
cancelFeed: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
12634
|
+
kind: "mutation",
|
|
12635
|
+
auth: "admin"
|
|
12636
|
+
}),
|
|
12637
|
+
/** Reset the desiccant "days remaining" counter after replacing it. */
|
|
12638
|
+
resetDesiccant: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
12639
|
+
kind: "mutation",
|
|
12640
|
+
auth: "admin"
|
|
12641
|
+
}),
|
|
12642
|
+
/** Mark a hopper as refilled (D4H/D4S/D4SH). */
|
|
12643
|
+
markFoodReplenished: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
12644
|
+
kind: "mutation",
|
|
12645
|
+
auth: "admin"
|
|
12646
|
+
}),
|
|
12647
|
+
/** Call the pet with the recorded prompt (D3). */
|
|
12648
|
+
callPet: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
12649
|
+
kind: "mutation",
|
|
12650
|
+
auth: "admin"
|
|
12651
|
+
}),
|
|
12652
|
+
/** Play a stored sound by id (D3 / D4H / D4SH). */
|
|
12653
|
+
playSound: method(object({
|
|
12654
|
+
deviceId: number().int().nonnegative(),
|
|
12655
|
+
soundId: number().int().nonnegative()
|
|
12656
|
+
}), _void(), {
|
|
12657
|
+
kind: "mutation",
|
|
12658
|
+
auth: "admin"
|
|
12659
|
+
}),
|
|
12660
|
+
/** Toggle the child-lock (manual-lock) setting. */
|
|
12661
|
+
setChildLock: method(object({
|
|
12662
|
+
deviceId: number().int().nonnegative(),
|
|
12663
|
+
on: boolean()
|
|
12664
|
+
}), _void(), {
|
|
12665
|
+
kind: "mutation",
|
|
12666
|
+
auth: "admin"
|
|
12667
|
+
}),
|
|
12668
|
+
/** Toggle the front indicator light. */
|
|
12669
|
+
setIndicatorLight: method(object({
|
|
12670
|
+
deviceId: number().int().nonnegative(),
|
|
12671
|
+
on: boolean()
|
|
12672
|
+
}), _void(), {
|
|
12673
|
+
kind: "mutation",
|
|
12674
|
+
auth: "admin"
|
|
12675
|
+
}),
|
|
12676
|
+
/** Toggle the dispense chime. */
|
|
12677
|
+
setFeedSound: method(object({
|
|
12678
|
+
deviceId: number().int().nonnegative(),
|
|
12679
|
+
on: boolean()
|
|
12680
|
+
}), _void(), {
|
|
12681
|
+
kind: "mutation",
|
|
12682
|
+
auth: "admin"
|
|
12683
|
+
}),
|
|
12684
|
+
/** Set the speaker / prompt volume level. */
|
|
12685
|
+
setVolume: method(object({
|
|
12686
|
+
deviceId: number().int().nonnegative(),
|
|
12687
|
+
level: number().int().nonnegative()
|
|
12688
|
+
}), _void(), {
|
|
12689
|
+
kind: "mutation",
|
|
12690
|
+
auth: "admin"
|
|
12691
|
+
})
|
|
12692
|
+
},
|
|
12693
|
+
status: {
|
|
12694
|
+
schema: PetFeederStatusSchema,
|
|
12695
|
+
kind: "poll"
|
|
12696
|
+
},
|
|
12697
|
+
/**
|
|
12698
|
+
* Runtime-state slice — mirrored by the kernel. UI feeder cards read
|
|
12699
|
+
* the full slice via `device.state.petFeeder.value` and refresh on
|
|
12700
|
+
* every poll without re-querying the provider.
|
|
12701
|
+
*/
|
|
12702
|
+
runtimeState: PetFeederStatusSchema
|
|
12703
|
+
};
|
|
12704
|
+
/**
|
|
11709
12705
|
* Multi-metric electrical meter. One slice can carry any combination
|
|
11710
12706
|
* of instantaneous power (W), cumulative energy (kWh), voltage (V),
|
|
11711
12707
|
* and current (A) — all fields optional so a single-metric source
|
|
@@ -13008,6 +14004,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
13008
14004
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
13009
14005
|
notifier: notifierCapability,
|
|
13010
14006
|
numericSensor: numericSensorCapability,
|
|
14007
|
+
petFeeder: petFeederCapability,
|
|
13011
14008
|
powerMeter: powerMeterCapability,
|
|
13012
14009
|
presence: presenceCapability,
|
|
13013
14010
|
pressureSensor: pressureSensorCapability,
|
|
@@ -14924,10 +15921,12 @@ method(object({ codec: string() }), boolean()), method(_void(), object({
|
|
|
14924
15921
|
url: string()
|
|
14925
15922
|
}), _void()), method(object({
|
|
14926
15923
|
sessionId: string(),
|
|
14927
|
-
maxCount: number().default(1)
|
|
15924
|
+
maxCount: number().default(1),
|
|
15925
|
+
waitMs: number().optional()
|
|
14928
15926
|
}), array(DecodedFrameSchema)), method(object({
|
|
14929
15927
|
sessionId: string(),
|
|
14930
|
-
maxCount: number().default(1)
|
|
15928
|
+
maxCount: number().default(1),
|
|
15929
|
+
waitMs: number().optional()
|
|
14931
15930
|
}), array(FrameHandleSchema)), method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()), method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()), method(object({
|
|
14932
15931
|
sessionId: string(),
|
|
14933
15932
|
config: DecoderSessionConfigSchema.partial()
|
|
@@ -15214,14 +16213,63 @@ var ChildLayoutEntrySchema = object({
|
|
|
15214
16213
|
collapsed: boolean().optional()
|
|
15215
16214
|
});
|
|
15216
16215
|
/** Cap-wire shape of a DeviceLink — structurally mirrors `DeviceLink` in
|
|
15217
|
-
* `device-management.ts`.
|
|
16216
|
+
* `device-management.ts`. Source is a union: a FIELD source copies a sibling
|
|
16217
|
+
* accessory's status field (`kind` optional/absent for wire compat); a
|
|
16218
|
+
* LITERAL source carries a per-device constant (no sibling is read); a
|
|
16219
|
+
* GLOBAL source (P2e) copies ANY device's status field, addressed by the
|
|
16220
|
+
* source device's full re-sync-stable `stableId`. */
|
|
16221
|
+
var DeviceLinkFieldSourceSchema = object({
|
|
16222
|
+
kind: literal("field").optional(),
|
|
16223
|
+
sourceKey: string(),
|
|
16224
|
+
cap: string(),
|
|
16225
|
+
fieldPath: string()
|
|
16226
|
+
});
|
|
16227
|
+
var DeviceLinkLiteralSourceSchema = object({
|
|
16228
|
+
kind: literal("literal"),
|
|
16229
|
+
value: union([
|
|
16230
|
+
string(),
|
|
16231
|
+
number(),
|
|
16232
|
+
boolean(),
|
|
16233
|
+
_null()
|
|
16234
|
+
])
|
|
16235
|
+
});
|
|
16236
|
+
var DeviceLinkGlobalSourceSchema = object({
|
|
16237
|
+
kind: literal("global"),
|
|
16238
|
+
sourceStableId: string(),
|
|
16239
|
+
cap: string(),
|
|
16240
|
+
fieldPath: string()
|
|
16241
|
+
});
|
|
16242
|
+
/** Expression source (Stage X): compute the target field from N named bindings
|
|
16243
|
+
* via the safe expression engine. Bindings are field | literal | global — never
|
|
16244
|
+
* another expression (no nesting). The `superRefine` runs the SAME author-time
|
|
16245
|
+
* validation as `validateExpressionSource` (compiles the expr, checks binding
|
|
16246
|
+
* names + identifier coverage) so every wire boundary that parses a DeviceLink
|
|
16247
|
+
* (tRPC mount, kernel create pre-seed, projection output) validates-at-write.
|
|
16248
|
+
* Compiles are LRU-cached, so repeated validation of the same expr is a hit. */
|
|
16249
|
+
var DeviceLinkExpressionSourceSchema = object({
|
|
16250
|
+
kind: literal("expression"),
|
|
16251
|
+
expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
|
|
16252
|
+
bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), union([
|
|
16253
|
+
DeviceLinkFieldSourceSchema,
|
|
16254
|
+
DeviceLinkLiteralSourceSchema,
|
|
16255
|
+
DeviceLinkGlobalSourceSchema
|
|
16256
|
+
]))
|
|
16257
|
+
}).superRefine((src, ctx) => {
|
|
16258
|
+
const err = validateExpressionSource(src);
|
|
16259
|
+
if (err !== null) ctx.addIssue({
|
|
16260
|
+
code: "custom",
|
|
16261
|
+
message: err,
|
|
16262
|
+
path: ["expr"]
|
|
16263
|
+
});
|
|
16264
|
+
});
|
|
15218
16265
|
var DeviceLinkSchema = object({
|
|
15219
16266
|
id: string(),
|
|
15220
|
-
source:
|
|
15221
|
-
|
|
15222
|
-
|
|
15223
|
-
|
|
15224
|
-
|
|
16267
|
+
source: union([
|
|
16268
|
+
DeviceLinkFieldSourceSchema,
|
|
16269
|
+
DeviceLinkLiteralSourceSchema,
|
|
16270
|
+
DeviceLinkGlobalSourceSchema,
|
|
16271
|
+
DeviceLinkExpressionSourceSchema
|
|
16272
|
+
]),
|
|
15225
16273
|
target: object({
|
|
15226
16274
|
cap: string(),
|
|
15227
16275
|
fieldPath: string(),
|
|
@@ -15250,6 +16298,31 @@ var DeviceLinkSchema = object({
|
|
|
15250
16298
|
})
|
|
15251
16299
|
]).optional()
|
|
15252
16300
|
});
|
|
16301
|
+
/** Cap-wire shape of a per-cap display refinement — mirrors
|
|
16302
|
+
* `DeviceCapDisplayOverride` in `device-management.ts`. */
|
|
16303
|
+
var DeviceCapDisplayOverrideSchema = object({
|
|
16304
|
+
unit: string().min(1).optional(),
|
|
16305
|
+
precision: number().int().min(0).max(10).optional()
|
|
16306
|
+
});
|
|
16307
|
+
/** Cap-wire shape of an operator-authored per-device display override —
|
|
16308
|
+
* mirrors `DeviceDisplayOverride` in `device-management.ts`. `precision`
|
|
16309
|
+
* bounds mirror `numeric-sensor.cap.ts` (`int 0-10`). */
|
|
16310
|
+
var DeviceDisplayOverrideSchema = object({
|
|
16311
|
+
icon: string().min(1).optional(),
|
|
16312
|
+
label: string().min(1).optional(),
|
|
16313
|
+
unit: string().min(1).optional(),
|
|
16314
|
+
precision: number().int().min(0).max(10).optional(),
|
|
16315
|
+
hidden: boolean().optional(),
|
|
16316
|
+
perCap: record(string(), DeviceCapDisplayOverrideSchema).optional()
|
|
16317
|
+
});
|
|
16318
|
+
/** Cap-wire shape of a per-role display default — mirrors `RoleDisplayDefault`
|
|
16319
|
+
* in `device-management.ts`. Keyed by `DeviceRole` string (role strings cross
|
|
16320
|
+
* the wire as plain strings everywhere else — cf. `DeviceInfoSchema.role`). */
|
|
16321
|
+
var RoleDisplayDefaultSchema = object({
|
|
16322
|
+
unit: string().min(1).optional(),
|
|
16323
|
+
precision: number().int().min(0).max(10).optional(),
|
|
16324
|
+
icon: string().min(1).optional()
|
|
16325
|
+
});
|
|
15253
16326
|
/**
|
|
15254
16327
|
* Serializable projection of a live IDevice.
|
|
15255
16328
|
* Returned by listAll, getDevice, getChildren.
|
|
@@ -15305,7 +16378,9 @@ var DeviceInfoSchema = object({
|
|
|
15305
16378
|
* `DeviceMeta.childLayout`. Absent ⇒ no layout declared. */
|
|
15306
16379
|
childLayout: array(ChildLayoutEntrySchema).readonly().optional(),
|
|
15307
16380
|
/** Operator-authored cross-device field wirings. See `DeviceMeta.deviceLinks`. */
|
|
15308
|
-
deviceLinks: array(DeviceLinkSchema).readonly().optional()
|
|
16381
|
+
deviceLinks: array(DeviceLinkSchema).readonly().optional(),
|
|
16382
|
+
/** Operator-authored per-device display override. See `DeviceMeta.display`. */
|
|
16383
|
+
display: DeviceDisplayOverrideSchema.optional()
|
|
15309
16384
|
});
|
|
15310
16385
|
var ConfigEntrySchema = object({
|
|
15311
16386
|
key: string(),
|
|
@@ -15370,7 +16445,9 @@ var DeviceMetaSchema = object({
|
|
|
15370
16445
|
deviceLinks: array(DeviceLinkSchema).readonly().optional(),
|
|
15371
16446
|
/** Semantic role string (`DeviceRole`) — propagated from the spawn pre-seed.
|
|
15372
16447
|
* Optional: only present for accessory children that carry a known role. */
|
|
15373
|
-
role: string().nullable().optional()
|
|
16448
|
+
role: string().nullable().optional(),
|
|
16449
|
+
/** Operator-authored per-device display override. See `DeviceMeta.display`. */
|
|
16450
|
+
display: DeviceDisplayOverrideSchema.optional()
|
|
15374
16451
|
});
|
|
15375
16452
|
/** ConfigUISchema passed through as unknown — mirrors device-provider's CreationSchemaOutputSchema */
|
|
15376
16453
|
var ConfigUISchemaOutput = unknown().nullable();
|
|
@@ -15464,7 +16541,19 @@ method(object({
|
|
|
15464
16541
|
}), _void(), {
|
|
15465
16542
|
kind: "mutation",
|
|
15466
16543
|
auth: "admin"
|
|
15467
|
-
}), method(object({
|
|
16544
|
+
}), method(object({
|
|
16545
|
+
deviceId: number(),
|
|
16546
|
+
display: DeviceDisplayOverrideSchema.nullable()
|
|
16547
|
+
}), _void(), {
|
|
16548
|
+
kind: "mutation",
|
|
16549
|
+
auth: "admin"
|
|
16550
|
+
}), method(object({}), object({ defaults: record(string(), RoleDisplayDefaultSchema) }), { kind: "query" }), method(object({ defaults: record(string(), RoleDisplayDefaultSchema) }), _void(), {
|
|
16551
|
+
kind: "mutation",
|
|
16552
|
+
auth: "admin"
|
|
16553
|
+
}), method(object({
|
|
16554
|
+
deviceId: number(),
|
|
16555
|
+
includeSynthesizable: boolean().optional()
|
|
16556
|
+
}), object({ caps: array(object({
|
|
15468
16557
|
cap: string(),
|
|
15469
16558
|
fields: array(object({
|
|
15470
16559
|
path: string(),
|
|
@@ -15474,8 +16563,13 @@ method(object({
|
|
|
15474
16563
|
"boolean",
|
|
15475
16564
|
"enum"
|
|
15476
16565
|
]),
|
|
15477
|
-
enumValues: array(string()).optional()
|
|
15478
|
-
|
|
16566
|
+
enumValues: array(string()).optional(),
|
|
16567
|
+
item: boolean().optional()
|
|
16568
|
+
})).readonly(),
|
|
16569
|
+
itemArray: object({
|
|
16570
|
+
path: string(),
|
|
16571
|
+
keyField: string()
|
|
16572
|
+
}).optional()
|
|
15479
16573
|
})).readonly() }), { kind: "query" }), method(object({
|
|
15480
16574
|
deviceId: number(),
|
|
15481
16575
|
role: string().nullable()
|
|
@@ -15545,7 +16639,11 @@ method(object({
|
|
|
15545
16639
|
deviceId: number(),
|
|
15546
16640
|
entries: array(object({
|
|
15547
16641
|
capName: string(),
|
|
15548
|
-
kind: _enum([
|
|
16642
|
+
kind: _enum([
|
|
16643
|
+
"native",
|
|
16644
|
+
"wrapped",
|
|
16645
|
+
"linked"
|
|
16646
|
+
]),
|
|
15549
16647
|
providerAddonId: string(),
|
|
15550
16648
|
providerNodeId: string(),
|
|
15551
16649
|
nativeAddonId: string()
|
|
@@ -15554,7 +16652,11 @@ method(object({
|
|
|
15554
16652
|
deviceId: number(),
|
|
15555
16653
|
entries: array(object({
|
|
15556
16654
|
capName: string(),
|
|
15557
|
-
kind: _enum([
|
|
16655
|
+
kind: _enum([
|
|
16656
|
+
"native",
|
|
16657
|
+
"wrapped",
|
|
16658
|
+
"linked"
|
|
16659
|
+
]),
|
|
15558
16660
|
providerAddonId: string(),
|
|
15559
16661
|
providerNodeId: string(),
|
|
15560
16662
|
nativeAddonId: string()
|
|
@@ -16796,7 +17898,10 @@ var AgentLoadSummarySchema = object({
|
|
|
16796
17898
|
online: boolean(),
|
|
16797
17899
|
load: RunnerLocalLoadSchema,
|
|
16798
17900
|
/** Computed score used by the L2 capacity balancer (lower = less loaded). */
|
|
16799
|
-
score: number()
|
|
17901
|
+
score: number(),
|
|
17902
|
+
/** This node's decode hwaccel backend (per-node `probedBestHwaccel`), or null
|
|
17903
|
+
* when not yet probed — for the cluster Pipeline table UI (P0.2). */
|
|
17904
|
+
decodeHwaccel: string().nullable()
|
|
16800
17905
|
});
|
|
16801
17906
|
/**
|
|
16802
17907
|
* Aggregate metrics across the whole detection cluster. Replaces the legacy
|
|
@@ -19314,7 +20419,10 @@ var HwAccelBackendInputSchema = _enum([
|
|
|
19314
20419
|
"webgpu",
|
|
19315
20420
|
"none"
|
|
19316
20421
|
]).nullable().optional();
|
|
19317
|
-
var HwAccelResolutionSchema = object({
|
|
20422
|
+
var HwAccelResolutionSchema = object({
|
|
20423
|
+
preferred: array(string()).readonly(),
|
|
20424
|
+
rationale: string()
|
|
20425
|
+
});
|
|
19318
20426
|
var HardwareEncoderIdSchema = _enum([
|
|
19319
20427
|
"h264_videotoolbox",
|
|
19320
20428
|
"hevc_videotoolbox",
|
|
@@ -19329,7 +20437,7 @@ var HardwareEncoderIdSchema = _enum([
|
|
|
19329
20437
|
"libx264",
|
|
19330
20438
|
"libx265"
|
|
19331
20439
|
]);
|
|
19332
|
-
|
|
20440
|
+
object({
|
|
19333
20441
|
encoders: array(object({
|
|
19334
20442
|
encoder: HardwareEncoderIdSchema,
|
|
19335
20443
|
codec: _enum(["H264", "H265"]),
|
|
@@ -19348,15 +20456,7 @@ var HardwareEncodersSchema = object({
|
|
|
19348
20456
|
defaultH265: HardwareEncoderIdSchema,
|
|
19349
20457
|
probedAt: number()
|
|
19350
20458
|
});
|
|
19351
|
-
|
|
19352
|
-
* Decode-side companion to {@link HardwareEncodersSchema}: the `-hwaccel`
|
|
19353
|
-
* methods the configured ffmpeg binary actually supports (parsed from
|
|
19354
|
-
* `ffmpeg -hwaccels`). Used to gate decode-hwaccel attempts so the transcode
|
|
19355
|
-
* egress never spends a spawn on a backend this build cannot offer. Per-stream
|
|
19356
|
-
* decode fragility (e.g. VideoToolbox HEVC) is still handled by the egress's
|
|
19357
|
-
* software fallback — this only filters out wholly-unsupported backends.
|
|
19358
|
-
*/
|
|
19359
|
-
var HardwareDecodeAccelsSchema = object({
|
|
20459
|
+
object({
|
|
19360
20460
|
methods: array(string()).readonly(),
|
|
19361
20461
|
probedAt: number()
|
|
19362
20462
|
});
|
|
@@ -19419,16 +20519,7 @@ var ResolvedInferenceConfigSchema = object({
|
|
|
19419
20519
|
format: ModelFormatSchema,
|
|
19420
20520
|
reason: string()
|
|
19421
20521
|
});
|
|
19422
|
-
method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema), method(object({ requirements: array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema), method(object({
|
|
19423
|
-
prefer: HwAccelBackendInputSchema,
|
|
19424
|
-
nodeId: string().optional()
|
|
19425
|
-
}), HwAccelResolutionSchema), method(_void(), HardwareEncodersSchema), method(_void(), HardwareEncodersSchema, {
|
|
19426
|
-
kind: "mutation",
|
|
19427
|
-
auth: "admin"
|
|
19428
|
-
}), method(_void(), HardwareDecodeAccelsSchema), method(_void(), HardwareDecodeAccelsSchema, {
|
|
19429
|
-
kind: "mutation",
|
|
19430
|
-
auth: "admin"
|
|
19431
|
-
});
|
|
20522
|
+
method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema), method(object({ requirements: array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema), method(object({ prefer: HwAccelBackendInputSchema }), HwAccelResolutionSchema);
|
|
19432
20523
|
var PtzPresetSchema = object({
|
|
19433
20524
|
id: string(),
|
|
19434
20525
|
name: string()
|
|
@@ -19481,6 +20572,16 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
|
|
|
19481
20572
|
kind: "mutation",
|
|
19482
20573
|
auth: "admin"
|
|
19483
20574
|
});
|
|
20575
|
+
/**
|
|
20576
|
+
* `recording` cap — footage availability + HLS playback manifests + per-device
|
|
20577
|
+
* recording config. NOTE on events (source of truth, R5/C3): this cap carries
|
|
20578
|
+
* NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
|
|
20579
|
+
* events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
|
|
20580
|
+
* rows); the recorder's internal EventMap markers are ephemeral in-RAM
|
|
20581
|
+
* annotations that are not exposed here and must not be treated as an event
|
|
20582
|
+
* feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
|
|
20583
|
+
* (`interfaces/recording-config.ts`).
|
|
20584
|
+
*/
|
|
19484
20585
|
var RecordingStatusSchema = object({
|
|
19485
20586
|
deviceId: number(),
|
|
19486
20587
|
enabled: boolean(),
|
|
@@ -21117,6 +22218,12 @@ Object.freeze({
|
|
|
21117
22218
|
addonId: null,
|
|
21118
22219
|
access: "view"
|
|
21119
22220
|
},
|
|
22221
|
+
"deviceManager.getRoleDisplayDefaults": {
|
|
22222
|
+
capName: "device-manager",
|
|
22223
|
+
capScope: "system",
|
|
22224
|
+
addonId: null,
|
|
22225
|
+
access: "view"
|
|
22226
|
+
},
|
|
21120
22227
|
"deviceManager.getSettingsSchema": {
|
|
21121
22228
|
capName: "device-manager",
|
|
21122
22229
|
capScope: "system",
|
|
@@ -21267,6 +22374,12 @@ Object.freeze({
|
|
|
21267
22374
|
addonId: null,
|
|
21268
22375
|
access: "create"
|
|
21269
22376
|
},
|
|
22377
|
+
"deviceManager.setDisplay": {
|
|
22378
|
+
capName: "device-manager",
|
|
22379
|
+
capScope: "system",
|
|
22380
|
+
addonId: null,
|
|
22381
|
+
access: "create"
|
|
22382
|
+
},
|
|
21270
22383
|
"deviceManager.setIntegrationId": {
|
|
21271
22384
|
capName: "device-manager",
|
|
21272
22385
|
capScope: "system",
|
|
@@ -21309,6 +22422,12 @@ Object.freeze({
|
|
|
21309
22422
|
addonId: null,
|
|
21310
22423
|
access: "create"
|
|
21311
22424
|
},
|
|
22425
|
+
"deviceManager.setRoleDisplayDefaults": {
|
|
22426
|
+
capName: "device-manager",
|
|
22427
|
+
capScope: "system",
|
|
22428
|
+
addonId: null,
|
|
22429
|
+
access: "create"
|
|
22430
|
+
},
|
|
21312
22431
|
"deviceManager.setStreamProfileMap": {
|
|
21313
22432
|
capName: "device-manager",
|
|
21314
22433
|
capScope: "system",
|
|
@@ -22359,6 +23478,66 @@ Object.freeze({
|
|
|
22359
23478
|
addonId: null,
|
|
22360
23479
|
access: "create"
|
|
22361
23480
|
},
|
|
23481
|
+
"petFeeder.callPet": {
|
|
23482
|
+
capName: "pet-feeder",
|
|
23483
|
+
capScope: "device",
|
|
23484
|
+
addonId: null,
|
|
23485
|
+
access: "create"
|
|
23486
|
+
},
|
|
23487
|
+
"petFeeder.cancelFeed": {
|
|
23488
|
+
capName: "pet-feeder",
|
|
23489
|
+
capScope: "device",
|
|
23490
|
+
addonId: null,
|
|
23491
|
+
access: "create"
|
|
23492
|
+
},
|
|
23493
|
+
"petFeeder.feed": {
|
|
23494
|
+
capName: "pet-feeder",
|
|
23495
|
+
capScope: "device",
|
|
23496
|
+
addonId: null,
|
|
23497
|
+
access: "create"
|
|
23498
|
+
},
|
|
23499
|
+
"petFeeder.markFoodReplenished": {
|
|
23500
|
+
capName: "pet-feeder",
|
|
23501
|
+
capScope: "device",
|
|
23502
|
+
addonId: null,
|
|
23503
|
+
access: "create"
|
|
23504
|
+
},
|
|
23505
|
+
"petFeeder.playSound": {
|
|
23506
|
+
capName: "pet-feeder",
|
|
23507
|
+
capScope: "device",
|
|
23508
|
+
addonId: null,
|
|
23509
|
+
access: "create"
|
|
23510
|
+
},
|
|
23511
|
+
"petFeeder.resetDesiccant": {
|
|
23512
|
+
capName: "pet-feeder",
|
|
23513
|
+
capScope: "device",
|
|
23514
|
+
addonId: null,
|
|
23515
|
+
access: "delete"
|
|
23516
|
+
},
|
|
23517
|
+
"petFeeder.setChildLock": {
|
|
23518
|
+
capName: "pet-feeder",
|
|
23519
|
+
capScope: "device",
|
|
23520
|
+
addonId: null,
|
|
23521
|
+
access: "create"
|
|
23522
|
+
},
|
|
23523
|
+
"petFeeder.setFeedSound": {
|
|
23524
|
+
capName: "pet-feeder",
|
|
23525
|
+
capScope: "device",
|
|
23526
|
+
addonId: null,
|
|
23527
|
+
access: "create"
|
|
23528
|
+
},
|
|
23529
|
+
"petFeeder.setIndicatorLight": {
|
|
23530
|
+
capName: "pet-feeder",
|
|
23531
|
+
capScope: "device",
|
|
23532
|
+
addonId: null,
|
|
23533
|
+
access: "create"
|
|
23534
|
+
},
|
|
23535
|
+
"petFeeder.setVolume": {
|
|
23536
|
+
capName: "pet-feeder",
|
|
23537
|
+
capScope: "device",
|
|
23538
|
+
addonId: null,
|
|
23539
|
+
access: "create"
|
|
23540
|
+
},
|
|
22362
23541
|
"pipelineAnalytics.clearTracks": {
|
|
22363
23542
|
capName: "pipeline-analytics",
|
|
22364
23543
|
capScope: "device",
|
|
@@ -22965,30 +24144,6 @@ Object.freeze({
|
|
|
22965
24144
|
addonId: null,
|
|
22966
24145
|
access: "view"
|
|
22967
24146
|
},
|
|
22968
|
-
"platformProbe.getHardwareDecodeAccels": {
|
|
22969
|
-
capName: "platform-probe",
|
|
22970
|
-
capScope: "system",
|
|
22971
|
-
addonId: null,
|
|
22972
|
-
access: "view"
|
|
22973
|
-
},
|
|
22974
|
-
"platformProbe.getHardwareEncoders": {
|
|
22975
|
-
capName: "platform-probe",
|
|
22976
|
-
capScope: "system",
|
|
22977
|
-
addonId: null,
|
|
22978
|
-
access: "view"
|
|
22979
|
-
},
|
|
22980
|
-
"platformProbe.refreshHardwareDecodeAccels": {
|
|
22981
|
-
capName: "platform-probe",
|
|
22982
|
-
capScope: "system",
|
|
22983
|
-
addonId: null,
|
|
22984
|
-
access: "create"
|
|
22985
|
-
},
|
|
22986
|
-
"platformProbe.refreshHardwareEncoders": {
|
|
22987
|
-
capName: "platform-probe",
|
|
22988
|
-
capScope: "system",
|
|
22989
|
-
addonId: null,
|
|
22990
|
-
access: "create"
|
|
22991
|
-
},
|
|
22992
24147
|
"platformProbe.resolveHwAccel": {
|
|
22993
24148
|
capName: "platform-probe",
|
|
22994
24149
|
capScope: "system",
|