@camstack/addon-export-hap 1.2.184 → 1.2.186
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/CHANGELOG.md +12 -0
- package/dist/hap-export.addon.js +2735 -746
- package/dist/hap-export.addon.mjs +2735 -746
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
39
39
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../types/dist/event-category-
|
|
42
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
43
43
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
44
44
|
EventCategory["SystemBoot"] = "system.boot";
|
|
45
45
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -666,7 +666,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
666
666
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
667
667
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
668
668
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
669
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
669
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
670
670
|
*/
|
|
671
671
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
672
672
|
/**
|
|
@@ -804,6 +804,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
804
804
|
*/
|
|
805
805
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
806
806
|
/**
|
|
807
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
808
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
809
|
+
*/
|
|
810
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
811
|
+
/**
|
|
807
812
|
* Progress update from a running model conversion job.
|
|
808
813
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
809
814
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -1376,7 +1381,7 @@ var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-
|
|
|
1376
1381
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
1377
1382
|
*
|
|
1378
1383
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
1379
|
-
var uuid$
|
|
1384
|
+
var uuid$4 = (version) => {
|
|
1380
1385
|
if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
1381
1386
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
1382
1387
|
};
|
|
@@ -1946,8 +1951,8 @@ var $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1946
1951
|
v8: 8
|
|
1947
1952
|
}[def.version];
|
|
1948
1953
|
if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1949
|
-
def.pattern ?? (def.pattern = uuid$
|
|
1950
|
-
} else def.pattern ?? (def.pattern = uuid$
|
|
1954
|
+
def.pattern ?? (def.pattern = uuid$4(v));
|
|
1955
|
+
} else def.pattern ?? (def.pattern = uuid$4());
|
|
1951
1956
|
$ZodStringFormat.init(inst, def);
|
|
1952
1957
|
});
|
|
1953
1958
|
var $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
@@ -5103,6 +5108,14 @@ function object(shape, params) {
|
|
|
5103
5108
|
...normalizeParams(params)
|
|
5104
5109
|
});
|
|
5105
5110
|
}
|
|
5111
|
+
function strictObject(shape, params) {
|
|
5112
|
+
return new ZodObject({
|
|
5113
|
+
type: "object",
|
|
5114
|
+
shape,
|
|
5115
|
+
catchall: never(),
|
|
5116
|
+
...normalizeParams(params)
|
|
5117
|
+
});
|
|
5118
|
+
}
|
|
5106
5119
|
function looseObject(shape, params) {
|
|
5107
5120
|
return new ZodObject({
|
|
5108
5121
|
type: "object",
|
|
@@ -5482,7 +5495,7 @@ var ZodIssueCode = {
|
|
|
5482
5495
|
var ZodFirstPartyTypeKind;
|
|
5483
5496
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5484
5497
|
//#endregion
|
|
5485
|
-
//#region ../types/dist/sleep
|
|
5498
|
+
//#region ../types/dist/sleep-6eG9C8Xl.mjs
|
|
5486
5499
|
/**
|
|
5487
5500
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5488
5501
|
* window to float samples (D455).
|
|
@@ -8370,65 +8383,6 @@ var MODEL_FORMATS = [
|
|
|
8370
8383
|
"pt",
|
|
8371
8384
|
"gguf"
|
|
8372
8385
|
];
|
|
8373
|
-
/**
|
|
8374
|
-
* Per-call node pinning for `ctx.api` capability calls.
|
|
8375
|
-
*
|
|
8376
|
-
* A capability call normally resolves to its DEFAULT provider — a `singleton`
|
|
8377
|
-
* cap resolves to the hub, a device-scoped cap to the device's owning node. To
|
|
8378
|
-
* query a SPECIFIC node's provider instead (e.g. a remote agent's own
|
|
8379
|
-
* in-process `platform-probe` hardware, which the hub cannot probe), pin the
|
|
8380
|
-
* call to that node.
|
|
8381
|
-
*
|
|
8382
|
-
* The nodeId rides OUT-OF-BAND in the tRPC call context (NOT in the validated
|
|
8383
|
-
* method args), so capability method signatures stay `nodeId`-free — node
|
|
8384
|
-
* targeting is a property of the CALL, not of the method. The transport lifts
|
|
8385
|
-
* it from `op.context` onto the `CapCallInput.nodeId` field (`ipcParentLink`),
|
|
8386
|
-
* and the hub parent's `onUnownedCall` passes it to the `CapRouteResolver`,
|
|
8387
|
-
* which classifies a pinned agent node as `agent-child-forward`
|
|
8388
|
-
* (`$agent-cap-fwd.forward` → the agent's in-process provider).
|
|
8389
|
-
*
|
|
8390
|
-
* Usage at a call site:
|
|
8391
|
-
*
|
|
8392
|
-
* await api.platformProbe.getCapabilities.query(undefined, nodePin(nodeId))
|
|
8393
|
-
*/
|
|
8394
|
-
/** tRPC `op.context` key carrying a per-call node pin. */
|
|
8395
|
-
var CAP_NODE_PIN_CONTEXT_KEY = "__camstackNodePin";
|
|
8396
|
-
/**
|
|
8397
|
-
* Build the tRPC request options that pin a single capability call to `nodeId`.
|
|
8398
|
-
* Pass as the second argument to `.query(input, …)` / `.mutate(input, …)`.
|
|
8399
|
-
*
|
|
8400
|
-
* ## The id is normalised here, and it has to be
|
|
8401
|
-
*
|
|
8402
|
-
* A forked addon reads its own node from `ctx.kernel.localNodeId`, and inside a
|
|
8403
|
-
* worker that value is a RUNNER id — `hub/export-hap`, not `hub`. Routing
|
|
8404
|
-
* compares a pin against real node ids, so such a pin matches nothing and the
|
|
8405
|
-
* call fails with `no provider registered for cap "…"`. The local-first
|
|
8406
|
-
* resolver already guarded against this (`localNodeId.split('/')[0]`), which
|
|
8407
|
-
* made the hazard invisible: unpinned calls worked, and only an explicit pin —
|
|
8408
|
-
* the thing you reach for when you specifically need THIS node — silently
|
|
8409
|
-
* addressed a node that does not exist.
|
|
8410
|
-
*
|
|
8411
|
-
* Cost of it being missing: `addon-export-hap` pinned `decoder.getInfo` to its
|
|
8412
|
-
* own node to read the host's hardware-decode backend. It never once answered,
|
|
8413
|
-
* so every HomeKit egress transcode decoded in SOFTWARE — including 4K H.265 —
|
|
8414
|
-
* while D67's whole premise was that the decoder addon is the authority on
|
|
8415
|
-
* hardware. The warn said `decoding in SOFTWARE` and read as "this node has no
|
|
8416
|
-
* hardware", which was false.
|
|
8417
|
-
*
|
|
8418
|
-
* Normalising in the ONE constructor fixes every caller at once, which is why
|
|
8419
|
-
* it is here and not at the call sites.
|
|
8420
|
-
*/
|
|
8421
|
-
function nodePin(nodeId) {
|
|
8422
|
-
return { context: { [CAP_NODE_PIN_CONTEXT_KEY]: toNodeId(nodeId) } };
|
|
8423
|
-
}
|
|
8424
|
-
/**
|
|
8425
|
-
* A runner id is `<nodeId>/<addonId>`; a node id has no slash. Taking the head
|
|
8426
|
-
* is idempotent, so passing an already-clean id costs nothing.
|
|
8427
|
-
*/
|
|
8428
|
-
function toNodeId(idOrRunnerId) {
|
|
8429
|
-
const head = idOrRunnerId.split("/")[0];
|
|
8430
|
-
return head === void 0 || head.length === 0 ? idOrRunnerId : head;
|
|
8431
|
-
}
|
|
8432
8386
|
object({
|
|
8433
8387
|
field: string().min(1),
|
|
8434
8388
|
on: literal("advance")
|
|
@@ -8517,9 +8471,135 @@ function optionalMethod(input, output, options) {
|
|
|
8517
8471
|
providerOptional: true
|
|
8518
8472
|
};
|
|
8519
8473
|
}
|
|
8474
|
+
/**
|
|
8475
|
+
* Per-call node pinning for `ctx.api` capability calls.
|
|
8476
|
+
*
|
|
8477
|
+
* A capability call normally resolves to its DEFAULT provider — a `singleton`
|
|
8478
|
+
* cap resolves to the hub, a device-scoped cap to the device's owning node. To
|
|
8479
|
+
* query a SPECIFIC node's provider instead (e.g. a remote agent's own
|
|
8480
|
+
* in-process `platform-probe` hardware, which the hub cannot probe), pin the
|
|
8481
|
+
* call to that node.
|
|
8482
|
+
*
|
|
8483
|
+
* The nodeId rides OUT-OF-BAND in the tRPC call context (NOT in the validated
|
|
8484
|
+
* method args), so capability method signatures stay `nodeId`-free — node
|
|
8485
|
+
* targeting is a property of the CALL, not of the method. The transport lifts
|
|
8486
|
+
* it from `op.context` onto the `CapCallInput.nodeId` field (`ipcParentLink`),
|
|
8487
|
+
* and the hub parent's `onUnownedCall` passes it to the `CapRouteResolver`,
|
|
8488
|
+
* which classifies a pinned agent node as `agent-child-forward`
|
|
8489
|
+
* (`$agent-cap-fwd.forward` → the agent's in-process provider).
|
|
8490
|
+
*
|
|
8491
|
+
* Usage at a call site:
|
|
8492
|
+
*
|
|
8493
|
+
* await api.platformProbe.getCapabilities.query(undefined, nodePin(nodeId))
|
|
8494
|
+
*/
|
|
8495
|
+
/** tRPC `op.context` key carrying a per-call node pin. */
|
|
8496
|
+
var CAP_NODE_PIN_CONTEXT_KEY = "__camstackNodePin";
|
|
8497
|
+
/**
|
|
8498
|
+
* Build the tRPC request options that pin a single capability call to `nodeId`.
|
|
8499
|
+
* Pass as the second argument to `.query(input, …)` / `.mutate(input, …)`.
|
|
8500
|
+
*
|
|
8501
|
+
* ## The id is normalised here, and it has to be
|
|
8502
|
+
*
|
|
8503
|
+
* A forked addon reads its own node from `ctx.kernel.localNodeId`, and inside a
|
|
8504
|
+
* worker that value is a RUNNER id — `hub/export-hap`, not `hub`. Routing
|
|
8505
|
+
* compares a pin against real node ids, so such a pin matches nothing and the
|
|
8506
|
+
* call fails with `no provider registered for cap "…"`. The local-first
|
|
8507
|
+
* resolver already guarded against this (`localNodeId.split('/')[0]`), which
|
|
8508
|
+
* made the hazard invisible: unpinned calls worked, and only an explicit pin —
|
|
8509
|
+
* the thing you reach for when you specifically need THIS node — silently
|
|
8510
|
+
* addressed a node that does not exist.
|
|
8511
|
+
*
|
|
8512
|
+
* Cost of it being missing: `addon-export-hap` pinned `decoder.getInfo` to its
|
|
8513
|
+
* own node to read the host's hardware-decode backend. It never once answered,
|
|
8514
|
+
* so every HomeKit egress transcode decoded in SOFTWARE — including 4K H.265 —
|
|
8515
|
+
* while D67's whole premise was that the decoder addon is the authority on
|
|
8516
|
+
* hardware. The warn said `decoding in SOFTWARE` and read as "this node has no
|
|
8517
|
+
* hardware", which was false.
|
|
8518
|
+
*
|
|
8519
|
+
* Normalising in the ONE constructor fixes every caller at once, which is why
|
|
8520
|
+
* it is here and not at the call sites.
|
|
8521
|
+
*/
|
|
8522
|
+
function nodePin(nodeId) {
|
|
8523
|
+
return { context: { [CAP_NODE_PIN_CONTEXT_KEY]: toNodeId(nodeId) } };
|
|
8524
|
+
}
|
|
8525
|
+
/**
|
|
8526
|
+
* A runner id is `<nodeId>/<addonId>`; a node id has no slash. Taking the head
|
|
8527
|
+
* is idempotent, so passing an already-clean id costs nothing.
|
|
8528
|
+
*/
|
|
8529
|
+
function toNodeId(idOrRunnerId) {
|
|
8530
|
+
const head = idOrRunnerId.split("/")[0];
|
|
8531
|
+
return head === void 0 || head.length === 0 ? idOrRunnerId : head;
|
|
8532
|
+
}
|
|
8533
|
+
/**
|
|
8534
|
+
* `addon-pages-source` — collection cap exposing per-provider raw page
|
|
8535
|
+
* declarations. Every addon that contributes a UI page registers a
|
|
8536
|
+
* provider here. The hub-side singleton aggregator (`addon-pages` cap,
|
|
8537
|
+
* see `addon-pages.cap.ts`) walks this collection, stamps versioned
|
|
8538
|
+
* `bundleUrl` values, and returns the enriched `AddonPageInfo[]` list
|
|
8539
|
+
* that admin-ui consumes.
|
|
8540
|
+
*
|
|
8541
|
+
* The split exists because the public listing has a different output
|
|
8542
|
+
* shape than the per-provider raw declarations, and we want both ends
|
|
8543
|
+
* to flow through codegen instead of relying on a hand-written wrapper.
|
|
8544
|
+
*/
|
|
8545
|
+
var AddonPageDeclarationSchema = object({
|
|
8546
|
+
id: string(),
|
|
8547
|
+
label: string(),
|
|
8548
|
+
icon: string(),
|
|
8549
|
+
path: string(),
|
|
8550
|
+
/**
|
|
8551
|
+
* Module Federation remote name — must match the `name` field on the
|
|
8552
|
+
* page addon's `federation()` plugin config. Used by admin-ui's
|
|
8553
|
+
* `<AddonPageLoader>` to call `loadRemote('<remoteName>/page')`.
|
|
8554
|
+
* Conventionally `addon_<id>_page` (snake_case; MF names cannot
|
|
8555
|
+
* contain hyphens).
|
|
8556
|
+
*/
|
|
8557
|
+
remoteName: string(),
|
|
8558
|
+
/**
|
|
8559
|
+
* Bundle filename inside the addon's `dist/` dir served at
|
|
8560
|
+
* `/api/addon-pages/<addonId>/<bundle>`. With Module Federation this
|
|
8561
|
+
* is always `'remoteEntry.js'`; the value is kept on the metadata so
|
|
8562
|
+
* the static-file route can compute an mtime-based cache-buster URL
|
|
8563
|
+
* without a separate filesystem stat.
|
|
8564
|
+
*/
|
|
8565
|
+
bundle: string(),
|
|
8566
|
+
/**
|
|
8567
|
+
* Sidebar section this page docks into. Well-known ids: `'detection'`,
|
|
8568
|
+
* `'cluster'`, `'administration'` — the page renders inside that group.
|
|
8569
|
+
* Any OTHER string creates (or joins) a custom section rendered after
|
|
8570
|
+
* the built-in groups; its label comes from `sectionLabel` (first
|
|
8571
|
+
* declaration wins), falling back to the id. Absent → the legacy
|
|
8572
|
+
* "Addon Pages" group.
|
|
8573
|
+
*/
|
|
8574
|
+
section: string().optional(),
|
|
8575
|
+
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
8576
|
+
sectionLabel: string().optional()
|
|
8577
|
+
});
|
|
8578
|
+
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
8520
8579
|
var StaticDirOutputSchema$1 = object({ staticDir: string() });
|
|
8521
8580
|
var VersionOutputSchema$1 = object({ version: string() });
|
|
8522
8581
|
method(_void(), StaticDirOutputSchema$1, { auth: "admin" }), method(_void(), VersionOutputSchema$1, { auth: "admin" });
|
|
8582
|
+
/**
|
|
8583
|
+
* The pipeline step-input shape and the run-result bridge, in a module that
|
|
8584
|
+
* imports nothing but zod and types.
|
|
8585
|
+
*
|
|
8586
|
+
* WHY A SEPARATE FILE (addon footprint, D28): both were declared in
|
|
8587
|
+
* `pipeline-executor.cap.ts`, whose import evaluates the whole executor schema
|
|
8588
|
+
* graph. An addon that only needs these two (the benchmark's `runPipelineTest`
|
|
8589
|
+
* action) paid ~130 MB of heap at load. `pipeline-executor.cap.ts` re-exports
|
|
8590
|
+
* them, so every existing import keeps working; addon server code takes them
|
|
8591
|
+
* from `@camstack/types/addon`.
|
|
8592
|
+
*/
|
|
8593
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
8594
|
+
addonId: string(),
|
|
8595
|
+
modelId: string().optional(),
|
|
8596
|
+
enabled: boolean().default(true),
|
|
8597
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
8598
|
+
settings: record(string(), unknown()).optional(),
|
|
8599
|
+
jumpDeviceKey: string().optional()
|
|
8600
|
+
}));
|
|
8601
|
+
/** Typed bridge to the recursive `FrameResult` graph; validation is structural. */
|
|
8602
|
+
var PipelineRunResultBridge = custom();
|
|
8523
8603
|
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
8524
8604
|
var VersionOutputSchema = object({ version: string() });
|
|
8525
8605
|
method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
|
|
@@ -8590,6 +8670,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8590
8670
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8591
8671
|
var CAP_NAMES = Object.freeze([
|
|
8592
8672
|
"accessories",
|
|
8673
|
+
"action-source",
|
|
8674
|
+
"actions",
|
|
8593
8675
|
"addon-pages",
|
|
8594
8676
|
"addon-pages-source",
|
|
8595
8677
|
"addon-routes",
|
|
@@ -8673,6 +8755,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8673
8755
|
"image-settings",
|
|
8674
8756
|
"integrations",
|
|
8675
8757
|
"intercom",
|
|
8758
|
+
"ir-transmitter",
|
|
8676
8759
|
"keychain",
|
|
8677
8760
|
"keychain-admin",
|
|
8678
8761
|
"lawn-mower-control",
|
|
@@ -8701,6 +8784,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8701
8784
|
"network-link",
|
|
8702
8785
|
"network-quality",
|
|
8703
8786
|
"node-certificates",
|
|
8787
|
+
"node-removal-hook",
|
|
8704
8788
|
"nodes",
|
|
8705
8789
|
"notification-output",
|
|
8706
8790
|
"notification-rules",
|
|
@@ -8711,6 +8795,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8711
8795
|
"osd",
|
|
8712
8796
|
"osd-manager",
|
|
8713
8797
|
"pet-feeder",
|
|
8798
|
+
"pet-fountain",
|
|
8714
8799
|
"pipeline-analytics",
|
|
8715
8800
|
"pipeline-executor",
|
|
8716
8801
|
"pipeline-orchestrator",
|
|
@@ -8731,6 +8816,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8731
8816
|
"recording-onboard",
|
|
8732
8817
|
"recording-signal",
|
|
8733
8818
|
"records",
|
|
8819
|
+
"remote",
|
|
8734
8820
|
"running-state",
|
|
8735
8821
|
"scene-monitor",
|
|
8736
8822
|
"script-runner",
|
|
@@ -8754,6 +8840,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8754
8840
|
"system",
|
|
8755
8841
|
"tamper",
|
|
8756
8842
|
"temperature-sensor",
|
|
8843
|
+
"template",
|
|
8757
8844
|
"terminal-session",
|
|
8758
8845
|
"toast",
|
|
8759
8846
|
"training",
|
|
@@ -8778,11 +8865,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8778
8865
|
Object.freeze({
|
|
8779
8866
|
"air-quality-sensor": [
|
|
8780
8867
|
{
|
|
8781
|
-
"path": "
|
|
8868
|
+
"path": "co2",
|
|
8782
8869
|
"valueType": "number"
|
|
8783
8870
|
},
|
|
8784
8871
|
{
|
|
8785
|
-
"path": "
|
|
8872
|
+
"path": "voc",
|
|
8786
8873
|
"valueType": "number"
|
|
8787
8874
|
},
|
|
8788
8875
|
{
|
|
@@ -8832,7 +8919,7 @@ Object.freeze({
|
|
|
8832
8919
|
}
|
|
8833
8920
|
],
|
|
8834
8921
|
"ambient-light-sensor": [{
|
|
8835
|
-
"path": "
|
|
8922
|
+
"path": "illuminance",
|
|
8836
8923
|
"valueType": "number"
|
|
8837
8924
|
}],
|
|
8838
8925
|
"audio-metrics": [
|
|
@@ -8893,7 +8980,7 @@ Object.freeze({
|
|
|
8893
8980
|
],
|
|
8894
8981
|
"battery": [
|
|
8895
8982
|
{
|
|
8896
|
-
"path": "
|
|
8983
|
+
"path": "level",
|
|
8897
8984
|
"valueType": "number"
|
|
8898
8985
|
},
|
|
8899
8986
|
{
|
|
@@ -8915,7 +9002,7 @@ Object.freeze({
|
|
|
8915
9002
|
"valueType": "number"
|
|
8916
9003
|
},
|
|
8917
9004
|
{
|
|
8918
|
-
"path": "
|
|
9005
|
+
"path": "voltage",
|
|
8919
9006
|
"valueType": "number"
|
|
8920
9007
|
},
|
|
8921
9008
|
{
|
|
@@ -8936,7 +9023,7 @@ Object.freeze({
|
|
|
8936
9023
|
"valueType": "boolean"
|
|
8937
9024
|
}],
|
|
8938
9025
|
"brightness": [{
|
|
8939
|
-
"path": "
|
|
9026
|
+
"path": "level",
|
|
8940
9027
|
"valueType": "number"
|
|
8941
9028
|
}],
|
|
8942
9029
|
"broker": [{
|
|
@@ -9137,7 +9224,7 @@ Object.freeze({
|
|
|
9137
9224
|
"valueType": "number"
|
|
9138
9225
|
},
|
|
9139
9226
|
{
|
|
9140
|
-
"path": "
|
|
9227
|
+
"path": "colorTemperature",
|
|
9141
9228
|
"valueType": "number"
|
|
9142
9229
|
}
|
|
9143
9230
|
],
|
|
@@ -9316,15 +9403,15 @@ Object.freeze({
|
|
|
9316
9403
|
"valueType": "string"
|
|
9317
9404
|
},
|
|
9318
9405
|
{
|
|
9319
|
-
"path": "
|
|
9406
|
+
"path": "remaining",
|
|
9320
9407
|
"valueType": "number"
|
|
9321
9408
|
},
|
|
9322
9409
|
{
|
|
9323
|
-
"path": "
|
|
9410
|
+
"path": "delayedStart",
|
|
9324
9411
|
"valueType": "number"
|
|
9325
9412
|
},
|
|
9326
9413
|
{
|
|
9327
|
-
"path": "
|
|
9414
|
+
"path": "progress",
|
|
9328
9415
|
"valueType": "number"
|
|
9329
9416
|
},
|
|
9330
9417
|
{
|
|
@@ -9438,7 +9525,7 @@ Object.freeze({
|
|
|
9438
9525
|
],
|
|
9439
9526
|
"fan-control": [
|
|
9440
9527
|
{
|
|
9441
|
-
"path": "
|
|
9528
|
+
"path": "speed",
|
|
9442
9529
|
"valueType": "number"
|
|
9443
9530
|
},
|
|
9444
9531
|
{
|
|
@@ -9538,7 +9625,7 @@ Object.freeze({
|
|
|
9538
9625
|
}
|
|
9539
9626
|
],
|
|
9540
9627
|
"humidity-sensor": [{
|
|
9541
|
-
"path": "
|
|
9628
|
+
"path": "humidity",
|
|
9542
9629
|
"valueType": "number"
|
|
9543
9630
|
}],
|
|
9544
9631
|
"image": [{
|
|
@@ -9648,7 +9735,7 @@ Object.freeze({
|
|
|
9648
9735
|
"valueType": "number"
|
|
9649
9736
|
},
|
|
9650
9737
|
{
|
|
9651
|
-
"path": "
|
|
9738
|
+
"path": "progress",
|
|
9652
9739
|
"valueType": "number"
|
|
9653
9740
|
},
|
|
9654
9741
|
{
|
|
@@ -9694,6 +9781,11 @@ Object.freeze({
|
|
|
9694
9781
|
"standby"
|
|
9695
9782
|
]
|
|
9696
9783
|
},
|
|
9784
|
+
{
|
|
9785
|
+
"path": "stateSource",
|
|
9786
|
+
"valueType": "enum",
|
|
9787
|
+
"enumValues": ["reported", "assumed"]
|
|
9788
|
+
},
|
|
9697
9789
|
{
|
|
9698
9790
|
"path": "volumeLevel",
|
|
9699
9791
|
"valueType": "number"
|
|
@@ -9727,11 +9819,11 @@ Object.freeze({
|
|
|
9727
9819
|
"valueType": "string"
|
|
9728
9820
|
},
|
|
9729
9821
|
{
|
|
9730
|
-
"path": "
|
|
9822
|
+
"path": "position",
|
|
9731
9823
|
"valueType": "number"
|
|
9732
9824
|
},
|
|
9733
9825
|
{
|
|
9734
|
-
"path": "
|
|
9826
|
+
"path": "duration",
|
|
9735
9827
|
"valueType": "number"
|
|
9736
9828
|
},
|
|
9737
9829
|
{
|
|
@@ -9833,11 +9925,11 @@ Object.freeze({
|
|
|
9833
9925
|
]
|
|
9834
9926
|
},
|
|
9835
9927
|
{
|
|
9836
|
-
"path": "
|
|
9928
|
+
"path": "signal",
|
|
9837
9929
|
"valueType": "number"
|
|
9838
9930
|
},
|
|
9839
9931
|
{
|
|
9840
|
-
"path": "
|
|
9932
|
+
"path": "rssi",
|
|
9841
9933
|
"valueType": "number"
|
|
9842
9934
|
},
|
|
9843
9935
|
{
|
|
@@ -9892,6 +9984,18 @@ Object.freeze({
|
|
|
9892
9984
|
"path": "foodLevel",
|
|
9893
9985
|
"valueType": "number"
|
|
9894
9986
|
},
|
|
9987
|
+
{
|
|
9988
|
+
"path": "bowlFood",
|
|
9989
|
+
"valueType": "number"
|
|
9990
|
+
},
|
|
9991
|
+
{
|
|
9992
|
+
"path": "eating",
|
|
9993
|
+
"valueType": "boolean"
|
|
9994
|
+
},
|
|
9995
|
+
{
|
|
9996
|
+
"path": "supportsMarkRefilled",
|
|
9997
|
+
"valueType": "boolean"
|
|
9998
|
+
},
|
|
9895
9999
|
{
|
|
9896
10000
|
"path": "food1",
|
|
9897
10001
|
"valueType": "number"
|
|
@@ -9908,6 +10012,11 @@ Object.freeze({
|
|
|
9908
10012
|
"path": "batteryPower",
|
|
9909
10013
|
"valueType": "number"
|
|
9910
10014
|
},
|
|
10015
|
+
{
|
|
10016
|
+
"path": "powerSource",
|
|
10017
|
+
"valueType": "enum",
|
|
10018
|
+
"enumValues": ["mains", "battery"]
|
|
10019
|
+
},
|
|
9911
10020
|
{
|
|
9912
10021
|
"path": "desiccantLeftDays",
|
|
9913
10022
|
"valueType": "number"
|
|
@@ -9952,27 +10061,89 @@ Object.freeze({
|
|
|
9952
10061
|
{
|
|
9953
10062
|
"path": "volume",
|
|
9954
10063
|
"valueType": "number"
|
|
10064
|
+
},
|
|
10065
|
+
{
|
|
10066
|
+
"path": "lastFeedGrams",
|
|
10067
|
+
"valueType": "number"
|
|
10068
|
+
},
|
|
10069
|
+
{
|
|
10070
|
+
"path": "lastFeedHopper1",
|
|
10071
|
+
"valueType": "number"
|
|
10072
|
+
},
|
|
10073
|
+
{
|
|
10074
|
+
"path": "lastFeedHopper2",
|
|
10075
|
+
"valueType": "number"
|
|
10076
|
+
}
|
|
10077
|
+
],
|
|
10078
|
+
"pet-fountain": [
|
|
10079
|
+
{
|
|
10080
|
+
"path": "waterLevel",
|
|
10081
|
+
"valueType": "number"
|
|
10082
|
+
},
|
|
10083
|
+
{
|
|
10084
|
+
"path": "waterVolume",
|
|
10085
|
+
"valueType": "number"
|
|
10086
|
+
},
|
|
10087
|
+
{
|
|
10088
|
+
"path": "empty",
|
|
10089
|
+
"valueType": "boolean"
|
|
10090
|
+
},
|
|
10091
|
+
{
|
|
10092
|
+
"path": "pumpRunning",
|
|
10093
|
+
"valueType": "boolean"
|
|
10094
|
+
},
|
|
10095
|
+
{
|
|
10096
|
+
"path": "pumpIntervalEnabled",
|
|
10097
|
+
"valueType": "boolean"
|
|
10098
|
+
},
|
|
10099
|
+
{
|
|
10100
|
+
"path": "pumpOnTime",
|
|
10101
|
+
"valueType": "number"
|
|
10102
|
+
},
|
|
10103
|
+
{
|
|
10104
|
+
"path": "pumpOffTime",
|
|
10105
|
+
"valueType": "number"
|
|
10106
|
+
},
|
|
10107
|
+
{
|
|
10108
|
+
"path": "lastDrink",
|
|
10109
|
+
"valueType": "number"
|
|
10110
|
+
},
|
|
10111
|
+
{
|
|
10112
|
+
"path": "currentHourDrink",
|
|
10113
|
+
"valueType": "number"
|
|
10114
|
+
},
|
|
10115
|
+
{
|
|
10116
|
+
"path": "last24hDrink",
|
|
10117
|
+
"valueType": "number"
|
|
10118
|
+
},
|
|
10119
|
+
{
|
|
10120
|
+
"path": "todayDrink",
|
|
10121
|
+
"valueType": "number"
|
|
10122
|
+
},
|
|
10123
|
+
{
|
|
10124
|
+
"path": "error",
|
|
10125
|
+
"valueType": "string"
|
|
9955
10126
|
}
|
|
9956
10127
|
],
|
|
9957
10128
|
"power-meter": [
|
|
9958
10129
|
{
|
|
9959
|
-
"path": "
|
|
10130
|
+
"path": "power",
|
|
9960
10131
|
"valueType": "number"
|
|
9961
10132
|
},
|
|
9962
10133
|
{
|
|
9963
|
-
"path": "
|
|
10134
|
+
"path": "energy",
|
|
9964
10135
|
"valueType": "number"
|
|
9965
10136
|
},
|
|
9966
10137
|
{
|
|
9967
|
-
"path": "
|
|
10138
|
+
"path": "voltage",
|
|
9968
10139
|
"valueType": "number"
|
|
9969
10140
|
},
|
|
9970
10141
|
{
|
|
9971
|
-
"path": "
|
|
10142
|
+
"path": "current",
|
|
9972
10143
|
"valueType": "number"
|
|
9973
10144
|
},
|
|
9974
10145
|
{
|
|
9975
|
-
"path": "
|
|
10146
|
+
"path": "apparentPower",
|
|
9976
10147
|
"valueType": "number"
|
|
9977
10148
|
},
|
|
9978
10149
|
{
|
|
@@ -10000,14 +10171,10 @@ Object.freeze({
|
|
|
10000
10171
|
{
|
|
10001
10172
|
"path": "gps.accuracyMeters",
|
|
10002
10173
|
"valueType": "number"
|
|
10003
|
-
},
|
|
10004
|
-
{
|
|
10005
|
-
"path": "batteryPercent",
|
|
10006
|
-
"valueType": "number"
|
|
10007
10174
|
}
|
|
10008
10175
|
],
|
|
10009
10176
|
"pressure-sensor": [{
|
|
10010
|
-
"path": "
|
|
10177
|
+
"path": "pressure",
|
|
10011
10178
|
"valueType": "number"
|
|
10012
10179
|
}],
|
|
10013
10180
|
"privacy-mask": [{
|
|
@@ -10321,7 +10488,7 @@ Object.freeze({
|
|
|
10321
10488
|
"valueType": "boolean"
|
|
10322
10489
|
}],
|
|
10323
10490
|
"temperature-sensor": [{
|
|
10324
|
-
"path": "
|
|
10491
|
+
"path": "temperature",
|
|
10325
10492
|
"valueType": "number"
|
|
10326
10493
|
}],
|
|
10327
10494
|
"update": [
|
|
@@ -10369,7 +10536,7 @@ Object.freeze({
|
|
|
10369
10536
|
"valueType": "string"
|
|
10370
10537
|
},
|
|
10371
10538
|
{
|
|
10372
|
-
"path": "
|
|
10539
|
+
"path": "progress",
|
|
10373
10540
|
"valueType": "number"
|
|
10374
10541
|
},
|
|
10375
10542
|
{
|
|
@@ -10495,7 +10662,7 @@ object({
|
|
|
10495
10662
|
params: record(string(), union([string(), number()])).optional()
|
|
10496
10663
|
});
|
|
10497
10664
|
//#endregion
|
|
10498
|
-
//#region ../types/dist/err-msg-
|
|
10665
|
+
//#region ../types/dist/err-msg-DWXWc0Di.mjs
|
|
10499
10666
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10500
10667
|
DeviceType["Camera"] = "camera";
|
|
10501
10668
|
DeviceType["Hub"] = "hub";
|
|
@@ -10587,6 +10754,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10587
10754
|
* native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
|
|
10588
10755
|
* integrations sharing the same food/desiccant/hopper surface. */
|
|
10589
10756
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
10757
|
+
/** Pet water fountain — tank level, water drunk, pump and its duty cycle.
|
|
10758
|
+
* Installed with the `pet-fountain` cap. Reaches CamStack as loose entities
|
|
10759
|
+
* of a container and is BUILT as a composed device (D967). */
|
|
10760
|
+
DeviceType["PetFountain"] = "pet-fountain";
|
|
10590
10761
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10591
10762
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10592
10763
|
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
@@ -10841,6 +11012,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
10841
11012
|
/** Fallback when the notifier service name doesn't match a known
|
|
10842
11013
|
* pattern. */
|
|
10843
11014
|
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
11015
|
+
/** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
|
|
11016
|
+
* cap. A `DeviceType.Generic` device. */
|
|
11017
|
+
DeviceRole["IrTransmitter"] = "ir-transmitter";
|
|
10844
11018
|
return DeviceRole;
|
|
10845
11019
|
}({});
|
|
10846
11020
|
/**
|
|
@@ -10848,13 +11022,13 @@ import { errMsg } from '@camstack/types'
|
|
|
10848
11022
|
* Extract a human-readable message from an unknown error value.
|
|
10849
11023
|
* Replaces the ubiquitous `errMsg(err)` pattern.
|
|
10850
11024
|
*/
|
|
10851
|
-
function errMsg$
|
|
11025
|
+
function errMsg$17(err) {
|
|
10852
11026
|
if (err instanceof Error) return err.message;
|
|
10853
11027
|
if (typeof err === "string") return err;
|
|
10854
11028
|
return String(err);
|
|
10855
11029
|
}
|
|
10856
11030
|
//#endregion
|
|
10857
|
-
//#region ../types/dist/composition-
|
|
11031
|
+
//#region ../types/dist/composition-kSuOifuG.mjs
|
|
10858
11032
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
10859
11033
|
opus: "libopus",
|
|
10860
11034
|
aac: "aac",
|
|
@@ -12534,12 +12708,28 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
12534
12708
|
])
|
|
12535
12709
|
})
|
|
12536
12710
|
]);
|
|
12537
|
-
var
|
|
12711
|
+
var forwardArgUnion = union([
|
|
12712
|
+
string(),
|
|
12713
|
+
number(),
|
|
12714
|
+
boolean(),
|
|
12715
|
+
strictObject({ ["$input"]: string().min(1) }),
|
|
12716
|
+
record(string().min(1), lazy(() => forwardArgUnion))
|
|
12717
|
+
]);
|
|
12718
|
+
var CompositionForwardArgSchema = forwardArgUnion;
|
|
12719
|
+
/**
|
|
12720
|
+
* `forward` (D659, amended by D967): one method of a BUILT capability is one
|
|
12721
|
+
* call of `cap.method` on `source`. Without `args` the built method's input
|
|
12722
|
+
* passes through minus `deviceId`; with `args` the template IS the source's
|
|
12723
|
+
* whole input. `deviceId` is always the source's own, never an argument.
|
|
12724
|
+
*/
|
|
12725
|
+
var CompositionForwardCommandSchema = object({
|
|
12538
12726
|
kind: literal("forward"),
|
|
12539
12727
|
source: CompositionSourceRefSchema,
|
|
12540
12728
|
cap: string().min(1),
|
|
12541
|
-
method: string().min(1)
|
|
12542
|
-
|
|
12729
|
+
method: string().min(1),
|
|
12730
|
+
args: record(string().min(1), CompositionForwardArgSchema).optional()
|
|
12731
|
+
});
|
|
12732
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
|
|
12543
12733
|
/** An item key inside an item-array cap (`consumables.items[<key>]`). */
|
|
12544
12734
|
var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
12545
12735
|
/**
|
|
@@ -12549,7 +12739,13 @@ var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
|
12549
12739
|
*/
|
|
12550
12740
|
var CompositionItemEntrySchema = object({
|
|
12551
12741
|
label: string().min(1).max(80),
|
|
12552
|
-
fields: record(string().min(1), CompositionFieldSourceSchema)
|
|
12742
|
+
fields: record(string().min(1), CompositionFieldSourceSchema),
|
|
12743
|
+
/**
|
|
12744
|
+
* What the cap's `reset` does for THIS item (consumables). Present = the item
|
|
12745
|
+
* is resettable and a `reset` call naming its key forwards here. The item key
|
|
12746
|
+
* selects the command, so it is never an argument: there is no pass-through.
|
|
12747
|
+
*/
|
|
12748
|
+
reset: CompositionForwardCommandSchema.optional()
|
|
12553
12749
|
});
|
|
12554
12750
|
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
12555
12751
|
kind: literal("fields"),
|
|
@@ -12561,7 +12757,7 @@ var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
|
12561
12757
|
* owns the WHOLE array field: the composed value holds exactly these items.
|
|
12562
12758
|
*/
|
|
12563
12759
|
items: record(string().regex(COMPOSITION_ITEM_KEY_RE), CompositionItemEntrySchema).refine((items) => Object.keys(items).length <= 16, { message: `at most 16 items` }).optional(),
|
|
12564
|
-
/**
|
|
12760
|
+
/** Method name → what serves it. Only a BUILT capability takes commands (D967). */
|
|
12565
12761
|
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
12566
12762
|
}), object({
|
|
12567
12763
|
kind: literal("passthrough"),
|
|
@@ -16193,6 +16389,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
16193
16389
|
array(union([string(), number()]))
|
|
16194
16390
|
])
|
|
16195
16391
|
});
|
|
16392
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
16393
|
+
kind: literal("stationary-present"),
|
|
16394
|
+
deviceId: number().int().nonnegative(),
|
|
16395
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
16396
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
16397
|
+
/** The parked object must be in at least one of these zones. */
|
|
16398
|
+
zones: array(string().min(1)).min(1).optional()
|
|
16399
|
+
});
|
|
16196
16400
|
/**
|
|
16197
16401
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
16198
16402
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -16226,7 +16430,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
16226
16430
|
child: AutomationConditionSchema
|
|
16227
16431
|
}),
|
|
16228
16432
|
AutomationConditionLeafSchema,
|
|
16229
|
-
AutomationConditionExpressionSchema
|
|
16433
|
+
AutomationConditionExpressionSchema,
|
|
16434
|
+
AutomationConditionStationaryPresentSchema
|
|
16230
16435
|
]));
|
|
16231
16436
|
/**
|
|
16232
16437
|
* What starts a run.
|
|
@@ -16267,7 +16472,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
16267
16472
|
kind: literal("schedule"),
|
|
16268
16473
|
cron: string().min(1).max(120)
|
|
16269
16474
|
}),
|
|
16270
|
-
object({ kind: literal("manual") })
|
|
16475
|
+
object({ kind: literal("manual") }),
|
|
16476
|
+
object({
|
|
16477
|
+
kind: literal("detection"),
|
|
16478
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
16479
|
+
* matches every raw class that maps to it; any other name matches
|
|
16480
|
+
* exactly. */
|
|
16481
|
+
classes: array(string().min(1)).min(1),
|
|
16482
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
16483
|
+
/** The track must have visited at least one of these zones. */
|
|
16484
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
16485
|
+
/** Best-so-far confidence the track must reach. */
|
|
16486
|
+
minScore: number().min(0).max(1).optional()
|
|
16487
|
+
}),
|
|
16488
|
+
object({
|
|
16489
|
+
kind: literal("stationary"),
|
|
16490
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
16491
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
16492
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
16493
|
+
/** The parked object must be in at least one of these zones. */
|
|
16494
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
16495
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
16496
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
16497
|
+
phase: _enum(["appeared", "departed"])
|
|
16498
|
+
}),
|
|
16499
|
+
object({
|
|
16500
|
+
kind: literal("interval"),
|
|
16501
|
+
minutes: number().int().min(1).max(1440)
|
|
16502
|
+
})
|
|
16271
16503
|
]);
|
|
16272
16504
|
/**
|
|
16273
16505
|
* One action step.
|
|
@@ -16287,28 +16519,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
16287
16519
|
* is called. The runner still receives a number and is untouched; the
|
|
16288
16520
|
* resolution is the recipe's job, not the runner's.
|
|
16289
16521
|
*/
|
|
16522
|
+
var AutomationWaitStepSchema = object({
|
|
16523
|
+
kind: literal("wait"),
|
|
16524
|
+
seconds: number().min(0).max(300)
|
|
16525
|
+
});
|
|
16526
|
+
var AutomationCapStepSchema = object({
|
|
16527
|
+
kind: literal("cap"),
|
|
16528
|
+
/**
|
|
16529
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
16530
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
16531
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
16532
|
+
*/
|
|
16533
|
+
deviceId: union([
|
|
16534
|
+
number().int(),
|
|
16535
|
+
array(number().int()).min(1),
|
|
16536
|
+
object({ $var: string().min(1) })
|
|
16537
|
+
]),
|
|
16538
|
+
cap: string().min(1),
|
|
16539
|
+
method: string().min(1),
|
|
16540
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
16541
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
16542
|
+
* the expression leaf. */
|
|
16543
|
+
args: record(string(), unknown()).optional()
|
|
16544
|
+
});
|
|
16545
|
+
/**
|
|
16546
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
16547
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
16548
|
+
*/
|
|
16549
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
16290
16550
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
16551
|
+
AutomationWaitStepSchema,
|
|
16552
|
+
AutomationCapStepSchema,
|
|
16291
16553
|
object({
|
|
16292
|
-
kind: literal("
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
*/
|
|
16302
|
-
deviceId: union([
|
|
16303
|
-
number().int(),
|
|
16304
|
-
array(number().int()).min(1),
|
|
16305
|
-
object({ $var: string().min(1) })
|
|
16306
|
-
]),
|
|
16307
|
-
cap: string().min(1),
|
|
16308
|
-
method: string().min(1),
|
|
16309
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
16310
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
16311
|
-
args: record(string(), unknown()).optional()
|
|
16554
|
+
kind: literal("action"),
|
|
16555
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
16556
|
+
actionId: string().min(1),
|
|
16557
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
16558
|
+
variables: record(string(), union([
|
|
16559
|
+
string(),
|
|
16560
|
+
number(),
|
|
16561
|
+
boolean()
|
|
16562
|
+
])).optional()
|
|
16312
16563
|
}),
|
|
16313
16564
|
object({
|
|
16314
16565
|
kind: literal("code"),
|
|
@@ -16317,11 +16568,862 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
16317
16568
|
code: string().min(1).max(2e4)
|
|
16318
16569
|
})
|
|
16319
16570
|
]);
|
|
16571
|
+
/**
|
|
16572
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
16573
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
16574
|
+
* actions. Absent means `single`.
|
|
16575
|
+
*
|
|
16576
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
16577
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
16578
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
16579
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
16580
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
16581
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
16582
|
+
* wait, never the single/queued limits.
|
|
16583
|
+
*/
|
|
16584
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
16585
|
+
object({ mode: literal("single") }),
|
|
16586
|
+
object({ mode: literal("restart") }),
|
|
16587
|
+
object({
|
|
16588
|
+
mode: literal("queued"),
|
|
16589
|
+
max: number().int().min(1).max(10)
|
|
16590
|
+
}),
|
|
16591
|
+
object({
|
|
16592
|
+
mode: literal("parallel"),
|
|
16593
|
+
max: number().int().min(1).max(10)
|
|
16594
|
+
}),
|
|
16595
|
+
object({
|
|
16596
|
+
mode: literal("cooldown"),
|
|
16597
|
+
minutes: number().int().min(1).max(1440)
|
|
16598
|
+
})
|
|
16599
|
+
]);
|
|
16320
16600
|
var AutomationRecipeSchema = object({
|
|
16321
16601
|
triggers: array(AutomationTriggerSchema),
|
|
16322
16602
|
conditions: AutomationConditionSchema.optional(),
|
|
16323
|
-
actions: array(AutomationActionSchema)
|
|
16603
|
+
actions: array(AutomationActionSchema),
|
|
16604
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
16605
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
16606
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
16324
16607
|
});
|
|
16608
|
+
new Set([
|
|
16609
|
+
{
|
|
16610
|
+
id: "person",
|
|
16611
|
+
name: "Person"
|
|
16612
|
+
},
|
|
16613
|
+
{
|
|
16614
|
+
id: "vehicle",
|
|
16615
|
+
name: "Vehicle"
|
|
16616
|
+
},
|
|
16617
|
+
{
|
|
16618
|
+
id: "animal",
|
|
16619
|
+
name: "Animal"
|
|
16620
|
+
},
|
|
16621
|
+
{
|
|
16622
|
+
id: "package",
|
|
16623
|
+
name: "Package"
|
|
16624
|
+
}
|
|
16625
|
+
].map((l) => l.id));
|
|
16626
|
+
var COCO_TO_MACRO = {
|
|
16627
|
+
mapping: {
|
|
16628
|
+
person: "person",
|
|
16629
|
+
bicycle: "vehicle",
|
|
16630
|
+
car: "vehicle",
|
|
16631
|
+
motorcycle: "vehicle",
|
|
16632
|
+
airplane: "vehicle",
|
|
16633
|
+
bus: "vehicle",
|
|
16634
|
+
train: "vehicle",
|
|
16635
|
+
truck: "vehicle",
|
|
16636
|
+
boat: "vehicle",
|
|
16637
|
+
bird: "animal",
|
|
16638
|
+
cat: "animal",
|
|
16639
|
+
dog: "animal",
|
|
16640
|
+
horse: "animal",
|
|
16641
|
+
sheep: "animal",
|
|
16642
|
+
cow: "animal",
|
|
16643
|
+
elephant: "animal",
|
|
16644
|
+
bear: "animal",
|
|
16645
|
+
zebra: "animal",
|
|
16646
|
+
giraffe: "animal",
|
|
16647
|
+
suitcase: "package",
|
|
16648
|
+
backpack: "package",
|
|
16649
|
+
handbag: "package"
|
|
16650
|
+
},
|
|
16651
|
+
preserveOriginal: false
|
|
16652
|
+
};
|
|
16653
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
16654
|
+
/**
|
|
16655
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
16656
|
+
* so the editor can paint every block green or red with its reason.
|
|
16657
|
+
*
|
|
16658
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
16659
|
+
* every condition node (containers and leaves, including the ones a
|
|
16660
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
16661
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
16662
|
+
* for an Action run). Skipped
|
|
16663
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
16664
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
16665
|
+
*
|
|
16666
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
16667
|
+
* vocabulary so an Action run records the same step shape.
|
|
16668
|
+
*/
|
|
16669
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
16670
|
+
var TraceValueSchema = union([
|
|
16671
|
+
string(),
|
|
16672
|
+
number(),
|
|
16673
|
+
boolean(),
|
|
16674
|
+
_null(),
|
|
16675
|
+
array(union([string(), number()]))
|
|
16676
|
+
]);
|
|
16677
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
16678
|
+
"ran",
|
|
16679
|
+
"skipped-trigger",
|
|
16680
|
+
"skipped-conditions",
|
|
16681
|
+
"skipped-cooldown",
|
|
16682
|
+
"skipped-overlap",
|
|
16683
|
+
"failed",
|
|
16684
|
+
"aborted"
|
|
16685
|
+
]);
|
|
16686
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
16687
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
16688
|
+
"pass",
|
|
16689
|
+
"fail",
|
|
16690
|
+
"not-evaluated"
|
|
16691
|
+
]);
|
|
16692
|
+
var AutomationTriggerTraceSchema = object({
|
|
16693
|
+
kind: string().min(1),
|
|
16694
|
+
outcome: _enum(["pass", "fail"]),
|
|
16695
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
16696
|
+
reason: string(),
|
|
16697
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
16698
|
+
vars: record(string(), TraceValueSchema)
|
|
16699
|
+
});
|
|
16700
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
16701
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
16702
|
+
path: string().min(1),
|
|
16703
|
+
kind: _enum([
|
|
16704
|
+
"all",
|
|
16705
|
+
"any",
|
|
16706
|
+
"not",
|
|
16707
|
+
"condition",
|
|
16708
|
+
"expression",
|
|
16709
|
+
"stationary-present"
|
|
16710
|
+
]),
|
|
16711
|
+
outcome: TraceNodeOutcomeSchema,
|
|
16712
|
+
reason: string(),
|
|
16713
|
+
deviceId: number().int().optional(),
|
|
16714
|
+
cap: string().optional(),
|
|
16715
|
+
fieldPath: string().optional(),
|
|
16716
|
+
operator: string().optional(),
|
|
16717
|
+
expected: TraceValueSchema.optional(),
|
|
16718
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
16719
|
+
observed: TraceValueSchema.optional()
|
|
16720
|
+
});
|
|
16721
|
+
var AutomationRunVerdictSchema = object({
|
|
16722
|
+
mode: AutomationRunModeSchema,
|
|
16723
|
+
decision: _enum([
|
|
16724
|
+
"run",
|
|
16725
|
+
"queued",
|
|
16726
|
+
"restart",
|
|
16727
|
+
"drop",
|
|
16728
|
+
"cooldown",
|
|
16729
|
+
"bypass"
|
|
16730
|
+
]),
|
|
16731
|
+
reason: string()
|
|
16732
|
+
});
|
|
16733
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
16734
|
+
var AutomationStepTraceSchema = object({
|
|
16735
|
+
/** `actions.<i>` */
|
|
16736
|
+
path: string().min(1),
|
|
16737
|
+
kind: string().min(1),
|
|
16738
|
+
cap: string().optional(),
|
|
16739
|
+
method: string().optional(),
|
|
16740
|
+
deviceId: number().int().optional(),
|
|
16741
|
+
startedAt: number().optional(),
|
|
16742
|
+
endedAt: number().optional(),
|
|
16743
|
+
outcome: _enum([
|
|
16744
|
+
"ok",
|
|
16745
|
+
"error",
|
|
16746
|
+
"not-run"
|
|
16747
|
+
]),
|
|
16748
|
+
message: string().optional()
|
|
16749
|
+
});
|
|
16750
|
+
var AutomationRunTraceSchema = object({
|
|
16751
|
+
runId: string().min(1),
|
|
16752
|
+
startedAt: number(),
|
|
16753
|
+
endedAt: number(),
|
|
16754
|
+
trigger: AutomationTriggerTraceSchema,
|
|
16755
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16756
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16757
|
+
steps: array(AutomationStepTraceSchema),
|
|
16758
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16759
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16760
|
+
repeat: number().int().min(1),
|
|
16761
|
+
/** When the latest of those repeats happened. */
|
|
16762
|
+
lastAt: number()
|
|
16763
|
+
});
|
|
16764
|
+
/**
|
|
16765
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16766
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16767
|
+
*/
|
|
16768
|
+
var AutomationStateDocSchema = object({
|
|
16769
|
+
version: literal(1),
|
|
16770
|
+
lastRunStartedAt: number().nullable(),
|
|
16771
|
+
traces: array(AutomationRunTraceSchema)
|
|
16772
|
+
});
|
|
16773
|
+
/**
|
|
16774
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16775
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16776
|
+
*
|
|
16777
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16778
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16779
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16780
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16781
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16782
|
+
*
|
|
16783
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16784
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16785
|
+
* runtime.
|
|
16786
|
+
*/
|
|
16787
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16788
|
+
var ActionVariableTypeSchema = _enum([
|
|
16789
|
+
"string",
|
|
16790
|
+
"number",
|
|
16791
|
+
"boolean",
|
|
16792
|
+
"select"
|
|
16793
|
+
]);
|
|
16794
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16795
|
+
var ActionVariableValueSchema = union([
|
|
16796
|
+
string(),
|
|
16797
|
+
number(),
|
|
16798
|
+
boolean()
|
|
16799
|
+
]);
|
|
16800
|
+
/**
|
|
16801
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16802
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16803
|
+
*/
|
|
16804
|
+
var ActionVariableSchema = object({
|
|
16805
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16806
|
+
label: string().min(1).max(120).optional(),
|
|
16807
|
+
type: ActionVariableTypeSchema,
|
|
16808
|
+
required: boolean().optional(),
|
|
16809
|
+
default: ActionVariableValueSchema.optional(),
|
|
16810
|
+
/** The allowed values of a `select`. */
|
|
16811
|
+
options: array(string().min(1)).min(1).optional()
|
|
16812
|
+
}).superRefine((v, ctx) => {
|
|
16813
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16814
|
+
code: "custom",
|
|
16815
|
+
message: "a select variable needs options",
|
|
16816
|
+
path: ["options"]
|
|
16817
|
+
});
|
|
16818
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16819
|
+
code: "custom",
|
|
16820
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16821
|
+
path: ["default"]
|
|
16822
|
+
});
|
|
16823
|
+
});
|
|
16824
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16825
|
+
function variableValueError(variable, value) {
|
|
16826
|
+
switch (variable.type) {
|
|
16827
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16828
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16829
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16830
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16831
|
+
}
|
|
16832
|
+
}
|
|
16833
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16834
|
+
function isInternalActionId(actionId) {
|
|
16835
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16836
|
+
}
|
|
16837
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16838
|
+
function addonIdOfActionId(actionId) {
|
|
16839
|
+
if (isInternalActionId(actionId)) return null;
|
|
16840
|
+
const at = actionId.indexOf(":");
|
|
16841
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16842
|
+
}
|
|
16843
|
+
var ActionStatusSchema = object({
|
|
16844
|
+
isRunning: boolean(),
|
|
16845
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16846
|
+
lastRunAt: number().nullable(),
|
|
16847
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16848
|
+
lastError: string().nullable()
|
|
16849
|
+
});
|
|
16850
|
+
var ActionEntrySchema = object({
|
|
16851
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16852
|
+
id: string().min(3),
|
|
16853
|
+
name: string().min(1).max(120),
|
|
16854
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16855
|
+
addonId: string().min(1),
|
|
16856
|
+
source: ActionSourceKindSchema,
|
|
16857
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16858
|
+
readOnly: boolean(),
|
|
16859
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16860
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16861
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16862
|
+
status: ActionStatusSchema
|
|
16863
|
+
}).superRefine((entry, ctx) => {
|
|
16864
|
+
if (entry.source === "internal") {
|
|
16865
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16866
|
+
code: "custom",
|
|
16867
|
+
message: "an internal action id is internal:<uuid>",
|
|
16868
|
+
path: ["id"]
|
|
16869
|
+
});
|
|
16870
|
+
return;
|
|
16871
|
+
}
|
|
16872
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16873
|
+
code: "custom",
|
|
16874
|
+
message: "only an internal action carries steps",
|
|
16875
|
+
path: ["steps"]
|
|
16876
|
+
});
|
|
16877
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16878
|
+
code: "custom",
|
|
16879
|
+
message: "an addon action is read-only here",
|
|
16880
|
+
path: ["readOnly"]
|
|
16881
|
+
});
|
|
16882
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16883
|
+
code: "custom",
|
|
16884
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16885
|
+
path: ["id"]
|
|
16886
|
+
});
|
|
16887
|
+
});
|
|
16888
|
+
/** What an operator writes for an internal action. */
|
|
16889
|
+
var ActionInputSchema = object({
|
|
16890
|
+
name: string().min(1).max(120),
|
|
16891
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16892
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16893
|
+
});
|
|
16894
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16895
|
+
var ActionRunOriginSchema = object({
|
|
16896
|
+
/** The automation block whose step started it. */
|
|
16897
|
+
blockId: string().min(1).optional() });
|
|
16898
|
+
/** `started` = the caller did not ask to wait. */
|
|
16899
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16900
|
+
var ActionRunResultSchema = object({
|
|
16901
|
+
runId: string().min(1),
|
|
16902
|
+
outcome: ActionRunOutcomeSchema,
|
|
16903
|
+
/** Why it did not run, or what failed. */
|
|
16904
|
+
message: string().optional()
|
|
16905
|
+
});
|
|
16906
|
+
_enum([
|
|
16907
|
+
"not-found",
|
|
16908
|
+
"read-only",
|
|
16909
|
+
"invalid-variables",
|
|
16910
|
+
"invalid-steps",
|
|
16911
|
+
"not-linked",
|
|
16912
|
+
"busy"
|
|
16913
|
+
]);
|
|
16914
|
+
object({
|
|
16915
|
+
actionId: string(),
|
|
16916
|
+
runId: string(),
|
|
16917
|
+
isRunning: boolean(),
|
|
16918
|
+
/** Set when the run ended. */
|
|
16919
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16920
|
+
lastRunAt: number().nullable(),
|
|
16921
|
+
lastError: string().nullable()
|
|
16922
|
+
});
|
|
16923
|
+
/**
|
|
16924
|
+
* notification-output — canonical, capability-gated notification delivery.
|
|
16925
|
+
*
|
|
16926
|
+
* Apprise-derived model (see
|
|
16927
|
+
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
16928
|
+
* callers emit ONE canonical `Notification`; each provider declares a
|
|
16929
|
+
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
16930
|
+
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
16931
|
+
* message to what the kind supports — callers never special-case a service.
|
|
16932
|
+
*
|
|
16933
|
+
* DESIGN DECISIONS (locked):
|
|
16934
|
+
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
16935
|
+
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
16936
|
+
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
16937
|
+
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
16938
|
+
* alternative would fork the UI per addon and cannot host the
|
|
16939
|
+
* discovery→adopt flow.
|
|
16940
|
+
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
16941
|
+
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
16942
|
+
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
16943
|
+
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
16944
|
+
* `addonId` the generated collection router extracts from the call input.
|
|
16945
|
+
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
16946
|
+
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
16947
|
+
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
16948
|
+
* base64 fallback needed.
|
|
16949
|
+
*
|
|
16950
|
+
* TODO (deferred, closed-set change — separate decision): add
|
|
16951
|
+
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
16952
|
+
* admin "Integrations" page.
|
|
16953
|
+
*/
|
|
16954
|
+
/**
|
|
16955
|
+
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
16956
|
+
* adapter picks what it supports and the degrade engine filters the rest.
|
|
16957
|
+
*/
|
|
16958
|
+
var AttachmentMediaTypeSchema = _enum([
|
|
16959
|
+
"image",
|
|
16960
|
+
"video",
|
|
16961
|
+
"gif",
|
|
16962
|
+
"audio",
|
|
16963
|
+
"icon"
|
|
16964
|
+
]);
|
|
16965
|
+
/**
|
|
16966
|
+
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
16967
|
+
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
16968
|
+
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
16969
|
+
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
16970
|
+
*/
|
|
16971
|
+
var AttachmentSchema = object({
|
|
16972
|
+
mediaType: AttachmentMediaTypeSchema,
|
|
16973
|
+
url: string().optional(),
|
|
16974
|
+
bytes: _instanceof(Uint8Array).optional(),
|
|
16975
|
+
mime: string().optional(),
|
|
16976
|
+
name: string().optional()
|
|
16977
|
+
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
16978
|
+
var NotificationFormatSchema = _enum([
|
|
16979
|
+
"text",
|
|
16980
|
+
"markdown",
|
|
16981
|
+
"html"
|
|
16982
|
+
]);
|
|
16983
|
+
/**
|
|
16984
|
+
* The CLOSED icon vocabulary an action button may use.
|
|
16985
|
+
*
|
|
16986
|
+
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
16987
|
+
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
16988
|
+
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
16989
|
+
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
16990
|
+
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
16991
|
+
*
|
|
16992
|
+
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
16993
|
+
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
16994
|
+
* differently.
|
|
16995
|
+
*
|
|
16996
|
+
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
16997
|
+
*
|
|
16998
|
+
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
16999
|
+
* the whole set onto its own renderer's vocabulary through a
|
|
17000
|
+
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
17001
|
+
* fallback, so adding a member here fails every adapter's build until someone
|
|
17002
|
+
* decides its glyph, which is the only place that decision can be made
|
|
17003
|
+
* honestly.
|
|
17004
|
+
*
|
|
17005
|
+
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
17006
|
+
* `disarm` straight through; iOS feeds that string to
|
|
17007
|
+
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
17008
|
+
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
17009
|
+
* mapping, and "the field is documented" is not "the value renders".
|
|
17010
|
+
*
|
|
17011
|
+
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
17012
|
+
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
17013
|
+
* so an addon that emits a token the running hub does not know does not lose an
|
|
17014
|
+
* icon — its whole `send` fails Zod validation and the notification never
|
|
17015
|
+
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
17016
|
+
*/
|
|
17017
|
+
var NotificationActionIconSchema = _enum([
|
|
17018
|
+
"acknowledge",
|
|
17019
|
+
"dismiss",
|
|
17020
|
+
"silence",
|
|
17021
|
+
"snooze",
|
|
17022
|
+
"view",
|
|
17023
|
+
"play",
|
|
17024
|
+
"open",
|
|
17025
|
+
"close",
|
|
17026
|
+
"lock",
|
|
17027
|
+
"unlock",
|
|
17028
|
+
"arm",
|
|
17029
|
+
"arm-home",
|
|
17030
|
+
"arm-away",
|
|
17031
|
+
"arm-night",
|
|
17032
|
+
"disarm",
|
|
17033
|
+
"light",
|
|
17034
|
+
"alert",
|
|
17035
|
+
"camera"
|
|
17036
|
+
]);
|
|
17037
|
+
/** A single tap-through action button. */
|
|
17038
|
+
var NotificationActionSchema = object({
|
|
17039
|
+
id: string(),
|
|
17040
|
+
label: string(),
|
|
17041
|
+
url: string().optional(),
|
|
17042
|
+
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
17043
|
+
icon: NotificationActionIconSchema.optional(),
|
|
17044
|
+
/**
|
|
17045
|
+
* Renders in a warning style where the notifier supports it.
|
|
17046
|
+
*
|
|
17047
|
+
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
17048
|
+
* else — see `notification-center/action-token.ts` for what that does and
|
|
17049
|
+
* does not buy.
|
|
17050
|
+
*/
|
|
17051
|
+
destructive: boolean().optional(),
|
|
17052
|
+
/**
|
|
17053
|
+
* How the tap should REACH the url.
|
|
17054
|
+
*
|
|
17055
|
+
* `navigate` (absent, and every button authored before this field) opens it:
|
|
17056
|
+
* the phone leaves the notification and shows whatever the callback returns.
|
|
17057
|
+
* That is right for a button whose answer the operator wants to read.
|
|
17058
|
+
*
|
|
17059
|
+
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
17060
|
+
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
17061
|
+
* an answer to the notification, and being thrown into a browser tab to
|
|
17062
|
+
* confirm it costs more attention than the notification did. A backend that
|
|
17063
|
+
* cannot do a background call renders it as an ordinary link (the adapters
|
|
17064
|
+
* fall back rather than dropping the button), so this is a preference, never
|
|
17065
|
+
* a requirement.
|
|
17066
|
+
*/
|
|
17067
|
+
mode: _enum(["navigate", "background"]).optional()
|
|
17068
|
+
});
|
|
17069
|
+
/** A delivery parameter value: what a notifier declared it takes. */
|
|
17070
|
+
var DeliveryParamValueSchema = union([
|
|
17071
|
+
string(),
|
|
17072
|
+
number(),
|
|
17073
|
+
boolean()
|
|
17074
|
+
]);
|
|
17075
|
+
/**
|
|
17076
|
+
* One extra delivery parameter a notifier KIND declares (D938). A rule that
|
|
17077
|
+
* addresses a target of that kind may set it; a kind that declares nothing is
|
|
17078
|
+
* never handed one. The admin UI derives its control from this descriptor —
|
|
17079
|
+
* no editor knows a service by name.
|
|
17080
|
+
*
|
|
17081
|
+
* Optional fields are `.optional()`, never `.default()` (a Zod default does not
|
|
17082
|
+
* run on the addon cap path).
|
|
17083
|
+
*/
|
|
17084
|
+
var DeliveryParamSchema = object({
|
|
17085
|
+
key: string().min(1),
|
|
17086
|
+
label: string(),
|
|
17087
|
+
/** i18n key of the label, resolved by the declaring addon's namespace. */
|
|
17088
|
+
labelKey: string().optional(),
|
|
17089
|
+
type: _enum([
|
|
17090
|
+
"enum",
|
|
17091
|
+
"number",
|
|
17092
|
+
"boolean",
|
|
17093
|
+
"string"
|
|
17094
|
+
]),
|
|
17095
|
+
/** `enum` only: the closed set of accepted values. */
|
|
17096
|
+
options: array(object({
|
|
17097
|
+
value: string(),
|
|
17098
|
+
label: string()
|
|
17099
|
+
})).optional(),
|
|
17100
|
+
/** `number` only. */
|
|
17101
|
+
min: number().optional(),
|
|
17102
|
+
max: number().optional(),
|
|
17103
|
+
/** What the notifier does when the rule sets nothing; shown as the placeholder. */
|
|
17104
|
+
default: DeliveryParamValueSchema.optional()
|
|
17105
|
+
});
|
|
17106
|
+
/**
|
|
17107
|
+
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
17108
|
+
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
17109
|
+
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
17110
|
+
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
17111
|
+
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
17112
|
+
* `priority` for that one target.
|
|
17113
|
+
*/
|
|
17114
|
+
var NotificationSchema = object({
|
|
17115
|
+
body: string(),
|
|
17116
|
+
title: string().optional(),
|
|
17117
|
+
format: NotificationFormatSchema.default("text"),
|
|
17118
|
+
priority: number().int().min(1).max(5).default(3),
|
|
17119
|
+
level: string().optional(),
|
|
17120
|
+
attachments: array(AttachmentSchema).optional(),
|
|
17121
|
+
clickUrl: string().optional(),
|
|
17122
|
+
actions: array(NotificationActionSchema).optional(),
|
|
17123
|
+
sound: string().optional(),
|
|
17124
|
+
ttl: number().optional(),
|
|
17125
|
+
tag: string().optional(),
|
|
17126
|
+
deviceId: number().optional(),
|
|
17127
|
+
eventId: string().optional(),
|
|
17128
|
+
metadata: record(string(), unknown()).optional(),
|
|
17129
|
+
/**
|
|
17130
|
+
* Values for the parameters the target's kind DECLARES in
|
|
17131
|
+
* {@link TargetKindSchema} `deliveryParams`. Already validated against the
|
|
17132
|
+
* declaration by the sender; a notifier reads only the keys it declared.
|
|
17133
|
+
*/
|
|
17134
|
+
delivery: record(string(), DeliveryParamValueSchema).optional()
|
|
17135
|
+
});
|
|
17136
|
+
/** One declared native severity/priority level for a kind. */
|
|
17137
|
+
var TargetKindLevelSchema = object({
|
|
17138
|
+
id: string(),
|
|
17139
|
+
label: string(),
|
|
17140
|
+
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
17141
|
+
ordinal: number().int().min(1).max(5).nullable(),
|
|
17142
|
+
flags: object({
|
|
17143
|
+
critical: boolean().optional(),
|
|
17144
|
+
silent: boolean().optional(),
|
|
17145
|
+
noPush: boolean().optional()
|
|
17146
|
+
}).optional(),
|
|
17147
|
+
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
17148
|
+
requires: array(string()).optional(),
|
|
17149
|
+
description: string().optional()
|
|
17150
|
+
});
|
|
17151
|
+
/** The full capability block consulted before dispatch. */
|
|
17152
|
+
var TargetKindCapsSchema = object({
|
|
17153
|
+
attachments: object({
|
|
17154
|
+
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
17155
|
+
mode: _enum([
|
|
17156
|
+
"url",
|
|
17157
|
+
"bytes",
|
|
17158
|
+
"both"
|
|
17159
|
+
]),
|
|
17160
|
+
max: number().int().nonnegative(),
|
|
17161
|
+
maxBytes: number().int().positive().optional()
|
|
17162
|
+
}),
|
|
17163
|
+
/** Max action buttons (0 = none). */
|
|
17164
|
+
actions: number().int().nonnegative(),
|
|
17165
|
+
/**
|
|
17166
|
+
* Whether this kind renders a per-action ICON.
|
|
17167
|
+
*
|
|
17168
|
+
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
17169
|
+
* run on the addon cap path — three production failures in one day taught
|
|
17170
|
+
* this repo that once. Absent is read as false by the degrade engine, which
|
|
17171
|
+
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
17172
|
+
* assumed and dropped costs the operator's trust in the field.
|
|
17173
|
+
*/
|
|
17174
|
+
actionIcons: boolean().optional(),
|
|
17175
|
+
levels: array(TargetKindLevelSchema),
|
|
17176
|
+
format: array(NotificationFormatSchema),
|
|
17177
|
+
clickUrl: boolean(),
|
|
17178
|
+
sound: boolean(),
|
|
17179
|
+
ttl: boolean(),
|
|
17180
|
+
bodyMaxLen: number().int().positive()
|
|
17181
|
+
});
|
|
17182
|
+
/**
|
|
17183
|
+
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
17184
|
+
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
17185
|
+
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
17186
|
+
* the union is large and not meant for runtime validation here; the exported
|
|
17187
|
+
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
17188
|
+
*/
|
|
17189
|
+
var ConfigSchemaPassthrough$3 = unknown();
|
|
17190
|
+
var TargetKindSchema = object({
|
|
17191
|
+
kind: string(),
|
|
17192
|
+
label: string(),
|
|
17193
|
+
icon: string(),
|
|
17194
|
+
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
17195
|
+
addonId: string(),
|
|
17196
|
+
/**
|
|
17197
|
+
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
17198
|
+
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
17199
|
+
* when the addon bundles no icon for that kind — the client then falls back
|
|
17200
|
+
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
17201
|
+
*
|
|
17202
|
+
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
17203
|
+
* client, and a native client joins it onto its own hub base.
|
|
17204
|
+
*
|
|
17205
|
+
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
17206
|
+
* field that survived only because the runtime cap-router forwards provider
|
|
17207
|
+
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
17208
|
+
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
17209
|
+
* broken silently the moment output validation was tightened anywhere.
|
|
17210
|
+
*/
|
|
17211
|
+
iconUrl: string().optional(),
|
|
17212
|
+
/**
|
|
17213
|
+
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
17214
|
+
*
|
|
17215
|
+
* The server knows this and therefore says it, because the client cannot
|
|
17216
|
+
* safely guess: a React-Native client renders SVG and raster through two
|
|
17217
|
+
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
17218
|
+
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
17219
|
+
* placeholder glyph for every vector icon while the web build looked fine.
|
|
17220
|
+
*
|
|
17221
|
+
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
17222
|
+
* not been updated — a client that cannot determine the type should prefer
|
|
17223
|
+
* its raster path, which is the safe default for an unknown image.
|
|
17224
|
+
*/
|
|
17225
|
+
iconMediaType: string().optional(),
|
|
17226
|
+
configSchema: ConfigSchemaPassthrough$3,
|
|
17227
|
+
/**
|
|
17228
|
+
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
17229
|
+
* base URL, instance, chat, recipient). A save that changes any of them
|
|
17230
|
+
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
17231
|
+
* editor uses this to ask for the secret on exactly those edits instead of
|
|
17232
|
+
* on every edit.
|
|
17233
|
+
*
|
|
17234
|
+
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
17235
|
+
* kinds) and from a provider older than this field — an editor that finds
|
|
17236
|
+
* it absent must assume ANY edit may need the secret.
|
|
17237
|
+
*/
|
|
17238
|
+
destinationKeys: array(string()).optional(),
|
|
17239
|
+
supportsDiscovery: boolean(),
|
|
17240
|
+
/**
|
|
17241
|
+
* Extra delivery parameters a rule may set for a target of this kind (D938).
|
|
17242
|
+
* Absent = none; the rule editor then offers nothing.
|
|
17243
|
+
*/
|
|
17244
|
+
deliveryParams: array(DeliveryParamSchema).optional(),
|
|
17245
|
+
caps: TargetKindCapsSchema
|
|
17246
|
+
});
|
|
17247
|
+
/**
|
|
17248
|
+
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
17249
|
+
* (return a presence marker only) when serving `listTargets` — never
|
|
17250
|
+
* round-trip a stored secret to the UI.
|
|
17251
|
+
*/
|
|
17252
|
+
var TargetSchema = object({
|
|
17253
|
+
id: string(),
|
|
17254
|
+
name: string(),
|
|
17255
|
+
kind: string(),
|
|
17256
|
+
addonId: string(),
|
|
17257
|
+
enabled: boolean(),
|
|
17258
|
+
config: record(string(), unknown())
|
|
17259
|
+
});
|
|
17260
|
+
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
17261
|
+
var DiscoveredTargetSchema = object({
|
|
17262
|
+
kind: string(),
|
|
17263
|
+
suggestedName: string(),
|
|
17264
|
+
config: record(string(), unknown())
|
|
17265
|
+
});
|
|
17266
|
+
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
17267
|
+
var RenderedAsSchema = object({
|
|
17268
|
+
level: string(),
|
|
17269
|
+
format: NotificationFormatSchema,
|
|
17270
|
+
attachmentsSent: number().int().nonnegative(),
|
|
17271
|
+
actionsSent: number().int().nonnegative(),
|
|
17272
|
+
truncated: boolean(),
|
|
17273
|
+
dropped: array(string())
|
|
17274
|
+
});
|
|
17275
|
+
var SendResultSchema = object({
|
|
17276
|
+
success: boolean(),
|
|
17277
|
+
error: string().optional(),
|
|
17278
|
+
renderedAs: RenderedAsSchema.optional()
|
|
17279
|
+
});
|
|
17280
|
+
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
17281
|
+
var TestResultSchema = SendResultSchema;
|
|
17282
|
+
/**
|
|
17283
|
+
* Pre-save credential probe against a partial (unsaved) target config.
|
|
17284
|
+
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
17285
|
+
*/
|
|
17286
|
+
var ProbeTargetConfigResultSchema = object({
|
|
17287
|
+
ok: boolean(),
|
|
17288
|
+
resolvedUrl: string(),
|
|
17289
|
+
httpStatus: number().int().optional(),
|
|
17290
|
+
stateInstance: string().optional(),
|
|
17291
|
+
error: string().optional()
|
|
17292
|
+
});
|
|
17293
|
+
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
|
|
17294
|
+
kind: string(),
|
|
17295
|
+
config: record(string(), unknown()).optional(),
|
|
17296
|
+
/**
|
|
17297
|
+
* When editing / duplicating, the blank password field never round-trips
|
|
17298
|
+
* the stored token. Pass the source target id so the provider can restore
|
|
17299
|
+
* secrets server-side before dialling (same merge as upsert).
|
|
17300
|
+
*/
|
|
17301
|
+
targetId: string().optional()
|
|
17302
|
+
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
17303
|
+
kind: string(),
|
|
17304
|
+
config: record(string(), unknown()),
|
|
17305
|
+
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
17306
|
+
targetId: string().optional()
|
|
17307
|
+
}), ProbeTargetConfigResultSchema, {
|
|
17308
|
+
kind: "mutation",
|
|
17309
|
+
auth: "admin"
|
|
17310
|
+
}), method(object({
|
|
17311
|
+
targetId: string(),
|
|
17312
|
+
notification: NotificationSchema
|
|
17313
|
+
}), SendResultSchema, {
|
|
17314
|
+
kind: "mutation",
|
|
17315
|
+
auth: "admin"
|
|
17316
|
+
}), method(object({
|
|
17317
|
+
targetId: string(),
|
|
17318
|
+
sample: NotificationSchema.optional()
|
|
17319
|
+
}), TestResultSchema, {
|
|
17320
|
+
kind: "mutation",
|
|
17321
|
+
auth: "admin"
|
|
17322
|
+
}), method(object({
|
|
17323
|
+
target: TargetSchema,
|
|
17324
|
+
/**
|
|
17325
|
+
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
17326
|
+
* existing row. The UI never holds the stored token; blank / redacted
|
|
17327
|
+
* password fields are restored from this source (D634 still applies if
|
|
17328
|
+
* destinations diverge without a re-typed secret).
|
|
17329
|
+
*/
|
|
17330
|
+
cloneSecretsFrom: string().optional()
|
|
17331
|
+
}), TargetSchema, {
|
|
17332
|
+
kind: "mutation",
|
|
17333
|
+
auth: "admin"
|
|
17334
|
+
}), method(object({ targetId: string() }), _void(), {
|
|
17335
|
+
kind: "mutation",
|
|
17336
|
+
auth: "admin"
|
|
17337
|
+
}), method(object({
|
|
17338
|
+
targetId: string(),
|
|
17339
|
+
enabled: boolean()
|
|
17340
|
+
}), _void(), {
|
|
17341
|
+
kind: "mutation",
|
|
17342
|
+
auth: "admin"
|
|
17343
|
+
});
|
|
17344
|
+
function errorText$1(err) {
|
|
17345
|
+
return err instanceof Error ? err.message : String(err);
|
|
17346
|
+
}
|
|
17347
|
+
/** `actions.run` flattens a refusal to `[code] text`; the code leads. */
|
|
17348
|
+
function refusalFromThrown(message) {
|
|
17349
|
+
if (message.startsWith("[busy]")) return "already-running";
|
|
17350
|
+
if (message.startsWith("[not-found]")) return "not-found";
|
|
17351
|
+
return null;
|
|
17352
|
+
}
|
|
17353
|
+
async function runExportedAction(api, log, input) {
|
|
17354
|
+
const { exporter, actionId } = input;
|
|
17355
|
+
const tags = { actionId };
|
|
17356
|
+
const refuse = (reason, detail) => {
|
|
17357
|
+
log.warn(`${exporter}: exported action not run — ${reason}`, {
|
|
17358
|
+
tags,
|
|
17359
|
+
meta: {
|
|
17360
|
+
reason,
|
|
17361
|
+
...detail ? { detail } : {}
|
|
17362
|
+
}
|
|
17363
|
+
});
|
|
17364
|
+
return {
|
|
17365
|
+
status: "refused",
|
|
17366
|
+
reason
|
|
17367
|
+
};
|
|
17368
|
+
};
|
|
17369
|
+
try {
|
|
17370
|
+
const result = await api.actions.run.mutate({ actionId });
|
|
17371
|
+
if (result.outcome === "skipped-overlap") return refuse("already-running", result.message);
|
|
17372
|
+
if (result.outcome === "skipped-cooldown") return refuse("cooldown", result.message);
|
|
17373
|
+
if (result.outcome === "failed" || result.outcome === "aborted") {
|
|
17374
|
+
const message = result.message ?? result.outcome;
|
|
17375
|
+
log.warn(`${exporter}: exported action failed`, {
|
|
17376
|
+
tags,
|
|
17377
|
+
meta: {
|
|
17378
|
+
outcome: result.outcome,
|
|
17379
|
+
message
|
|
17380
|
+
}
|
|
17381
|
+
});
|
|
17382
|
+
return {
|
|
17383
|
+
status: "failed",
|
|
17384
|
+
message
|
|
17385
|
+
};
|
|
17386
|
+
}
|
|
17387
|
+
log.info(`${exporter}: exported action ran`, {
|
|
17388
|
+
tags,
|
|
17389
|
+
meta: { outcome: result.outcome }
|
|
17390
|
+
});
|
|
17391
|
+
return { status: "started" };
|
|
17392
|
+
} catch (err) {
|
|
17393
|
+
const message = errorText$1(err);
|
|
17394
|
+
const reason = refusalFromThrown(message);
|
|
17395
|
+
if (reason !== null) return refuse(reason, message);
|
|
17396
|
+
log.warn(`${exporter}: exported action failed`, {
|
|
17397
|
+
tags,
|
|
17398
|
+
meta: { message }
|
|
17399
|
+
});
|
|
17400
|
+
return {
|
|
17401
|
+
status: "failed",
|
|
17402
|
+
message
|
|
17403
|
+
};
|
|
17404
|
+
}
|
|
17405
|
+
}
|
|
17406
|
+
/**
|
|
17407
|
+
* Split an exporter's selection into what still exists and what was deleted.
|
|
17408
|
+
* Devices are never judged here (their lifecycle is the tombstone, D865).
|
|
17409
|
+
* Callers pass ids from a query that ANSWERED — an unanswered list must not
|
|
17410
|
+
* reach this function (D49: a failed read changes nothing).
|
|
17411
|
+
*/
|
|
17412
|
+
function pruneDeletedEntities(selection, live, log, exporter) {
|
|
17413
|
+
const kept = [];
|
|
17414
|
+
const dropped = [];
|
|
17415
|
+
for (const ref of selection) if (ref.kind === "action" && !live.actionIds.has(ref.actionId)) {
|
|
17416
|
+
dropped.push(ref);
|
|
17417
|
+
log.warn(`${exporter}: exported action was deleted — dropped from the export`, { tags: { actionId: ref.actionId } });
|
|
17418
|
+
} else if (ref.kind === "notifier" && !live.targetIds.has(ref.targetId)) {
|
|
17419
|
+
dropped.push(ref);
|
|
17420
|
+
log.warn(`${exporter}: exported notifier target was deleted — dropped from the export`, { tags: { targetId: ref.targetId } });
|
|
17421
|
+
} else kept.push(ref);
|
|
17422
|
+
return {
|
|
17423
|
+
kept,
|
|
17424
|
+
dropped
|
|
17425
|
+
};
|
|
17426
|
+
}
|
|
16325
17427
|
/**
|
|
16326
17428
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
16327
17429
|
* surface that admin-ui consumes through `useAddonPagesListPages()`.
|
|
@@ -16354,52 +17456,6 @@ var AddonPageInfoSchema = object({
|
|
|
16354
17456
|
bundleUrl: string()
|
|
16355
17457
|
});
|
|
16356
17458
|
method(_void(), array(AddonPageInfoSchema).readonly());
|
|
16357
|
-
/**
|
|
16358
|
-
* `addon-pages-source` — collection cap exposing per-provider raw page
|
|
16359
|
-
* declarations. Every addon that contributes a UI page registers a
|
|
16360
|
-
* provider here. The hub-side singleton aggregator (`addon-pages` cap,
|
|
16361
|
-
* see `addon-pages.cap.ts`) walks this collection, stamps versioned
|
|
16362
|
-
* `bundleUrl` values, and returns the enriched `AddonPageInfo[]` list
|
|
16363
|
-
* that admin-ui consumes.
|
|
16364
|
-
*
|
|
16365
|
-
* The split exists because the public listing has a different output
|
|
16366
|
-
* shape than the per-provider raw declarations, and we want both ends
|
|
16367
|
-
* to flow through codegen instead of relying on a hand-written wrapper.
|
|
16368
|
-
*/
|
|
16369
|
-
var AddonPageDeclarationSchema = object({
|
|
16370
|
-
id: string(),
|
|
16371
|
-
label: string(),
|
|
16372
|
-
icon: string(),
|
|
16373
|
-
path: string(),
|
|
16374
|
-
/**
|
|
16375
|
-
* Module Federation remote name — must match the `name` field on the
|
|
16376
|
-
* page addon's `federation()` plugin config. Used by admin-ui's
|
|
16377
|
-
* `<AddonPageLoader>` to call `loadRemote('<remoteName>/page')`.
|
|
16378
|
-
* Conventionally `addon_<id>_page` (snake_case; MF names cannot
|
|
16379
|
-
* contain hyphens).
|
|
16380
|
-
*/
|
|
16381
|
-
remoteName: string(),
|
|
16382
|
-
/**
|
|
16383
|
-
* Bundle filename inside the addon's `dist/` dir served at
|
|
16384
|
-
* `/api/addon-pages/<addonId>/<bundle>`. With Module Federation this
|
|
16385
|
-
* is always `'remoteEntry.js'`; the value is kept on the metadata so
|
|
16386
|
-
* the static-file route can compute an mtime-based cache-buster URL
|
|
16387
|
-
* without a separate filesystem stat.
|
|
16388
|
-
*/
|
|
16389
|
-
bundle: string(),
|
|
16390
|
-
/**
|
|
16391
|
-
* Sidebar section this page docks into. Well-known ids: `'detection'`,
|
|
16392
|
-
* `'cluster'`, `'administration'` — the page renders inside that group.
|
|
16393
|
-
* Any OTHER string creates (or joins) a custom section rendered after
|
|
16394
|
-
* the built-in groups; its label comes from `sectionLabel` (first
|
|
16395
|
-
* declaration wins), falling back to the id. Absent → the legacy
|
|
16396
|
-
* "Addon Pages" group.
|
|
16397
|
-
*/
|
|
16398
|
-
section: string().optional(),
|
|
16399
|
-
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
16400
|
-
sectionLabel: string().optional()
|
|
16401
|
-
});
|
|
16402
|
-
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
16403
17459
|
var AddonHttpRouteSchema = object({
|
|
16404
17460
|
method: _enum([
|
|
16405
17461
|
"GET",
|
|
@@ -16681,9 +17737,21 @@ var AlertSeveritySchema = _enum([
|
|
|
16681
17737
|
"error",
|
|
16682
17738
|
"critical"
|
|
16683
17739
|
]);
|
|
17740
|
+
/**
|
|
17741
|
+
* An action that RUNS something instead of going somewhere: the admin UI calls
|
|
17742
|
+
* the addon's custom action (`addons.custom`) with exactly these fields. The
|
|
17743
|
+
* producer owns the meaning; the UI knows nothing about the addon or the kind.
|
|
17744
|
+
*/
|
|
17745
|
+
var AlertActionInvokeSchema = object({
|
|
17746
|
+
addonId: string().min(1),
|
|
17747
|
+
action: string().min(1),
|
|
17748
|
+
input: record(string(), unknown()).optional()
|
|
17749
|
+
});
|
|
17750
|
+
/** An action has `href` (a link) OR `invoke` (a button that runs a custom action). */
|
|
16684
17751
|
var AlertActionSchema = object({
|
|
16685
17752
|
label: string(),
|
|
16686
17753
|
href: string().optional(),
|
|
17754
|
+
invoke: AlertActionInvokeSchema.optional(),
|
|
16687
17755
|
/**
|
|
16688
17756
|
* How `href` is followed. Absent / `app`: an admin-ui route (client-side).
|
|
16689
17757
|
* `server`: a route the HUB serves (an addon HTTP route such as an OAuth
|
|
@@ -18901,7 +19969,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18901
19969
|
stateField: string(),
|
|
18902
19970
|
fieldKey: string()
|
|
18903
19971
|
});
|
|
18904
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
19972
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18905
19973
|
var CompositionProblemSchema = object({
|
|
18906
19974
|
code: _enum([
|
|
18907
19975
|
"reserved-variant",
|
|
@@ -18930,7 +19998,11 @@ var CompositionProblemSchema = object({
|
|
|
18930
19998
|
"mixed-quantity",
|
|
18931
19999
|
"helper-mismatch",
|
|
18932
20000
|
"member-constraint",
|
|
18933
|
-
"retention"
|
|
20001
|
+
"retention",
|
|
20002
|
+
"command-method-unknown",
|
|
20003
|
+
"command-source-unknown",
|
|
20004
|
+
"command-input-unknown",
|
|
20005
|
+
"command-input-missing"
|
|
18934
20006
|
]),
|
|
18935
20007
|
path: string(),
|
|
18936
20008
|
message: string()
|
|
@@ -18969,7 +20041,9 @@ var CompositionFieldRoleSchema = _enum([
|
|
|
18969
20041
|
var CompositionFieldItemSchema = object({
|
|
18970
20042
|
arrayPath: string(),
|
|
18971
20043
|
key: string(),
|
|
18972
|
-
label: string()
|
|
20044
|
+
label: string(),
|
|
20045
|
+
/** True when the item carries a `reset` forward: the composer writes `resettable` from this (D967). */
|
|
20046
|
+
resettable: boolean().optional()
|
|
18973
20047
|
});
|
|
18974
20048
|
var CompositionFieldPlanSchema = object({
|
|
18975
20049
|
cap: string(),
|
|
@@ -19174,7 +20248,7 @@ Object.freeze({
|
|
|
19174
20248
|
* One catalog row per base reading a group helper can build (D944 §3).
|
|
19175
20249
|
* Data, not a form default written into the block.
|
|
19176
20250
|
*/
|
|
19177
|
-
var NOW$
|
|
20251
|
+
var NOW$3 = {
|
|
19178
20252
|
fieldPath: "lastFetchedAt",
|
|
19179
20253
|
expr: "now"
|
|
19180
20254
|
};
|
|
@@ -19183,12 +20257,13 @@ var CHANGED = {
|
|
|
19183
20257
|
expr: "now"
|
|
19184
20258
|
};
|
|
19185
20259
|
function numeric(input) {
|
|
20260
|
+
const { alsoFrom, ...base } = input;
|
|
19186
20261
|
return {
|
|
19187
|
-
...
|
|
20262
|
+
...base,
|
|
19188
20263
|
family: "numeric",
|
|
19189
20264
|
deviceType: DeviceType.Sensor,
|
|
19190
20265
|
memberDeviceType: DeviceType.Sensor,
|
|
19191
|
-
memberDeviceTypes: [DeviceType.Sensor],
|
|
20266
|
+
memberDeviceTypes: [DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
|
|
19192
20267
|
activeWhen: void 0,
|
|
19193
20268
|
commandCaps: [],
|
|
19194
20269
|
baseUnit: baseUnitOf(input.quantity),
|
|
@@ -19196,9 +20271,10 @@ function numeric(input) {
|
|
|
19196
20271
|
accept: [{
|
|
19197
20272
|
cap: input.outputCap,
|
|
19198
20273
|
fieldPath: input.outputField
|
|
19199
|
-
}]
|
|
20274
|
+
}, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
|
|
19200
20275
|
};
|
|
19201
20276
|
}
|
|
20277
|
+
var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
|
|
19202
20278
|
function binary(input) {
|
|
19203
20279
|
return {
|
|
19204
20280
|
...input,
|
|
@@ -19220,73 +20296,87 @@ var GROUP_TEMPLATES = [
|
|
|
19220
20296
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
19221
20297
|
role: DeviceRole.TemperatureSensor,
|
|
19222
20298
|
outputCap: "temperature-sensor",
|
|
19223
|
-
outputField: "
|
|
20299
|
+
outputField: "temperature",
|
|
19224
20300
|
quantity: "temperature",
|
|
19225
20301
|
defaultAggregate: "mean",
|
|
19226
20302
|
empty: "null",
|
|
19227
|
-
companions: [NOW$
|
|
20303
|
+
companions: [NOW$3],
|
|
20304
|
+
alsoFrom: {
|
|
20305
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
20306
|
+
accept: {
|
|
20307
|
+
cap: "climate-control",
|
|
20308
|
+
fieldPath: "currentTemp"
|
|
20309
|
+
}
|
|
20310
|
+
}
|
|
19228
20311
|
}),
|
|
19229
20312
|
numeric({
|
|
19230
20313
|
id: "humidity",
|
|
19231
20314
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
19232
20315
|
role: DeviceRole.HumiditySensor,
|
|
19233
20316
|
outputCap: "humidity-sensor",
|
|
19234
|
-
outputField: "
|
|
20317
|
+
outputField: "humidity",
|
|
19235
20318
|
quantity: "humidity",
|
|
19236
20319
|
defaultAggregate: "mean",
|
|
19237
20320
|
empty: "null",
|
|
19238
|
-
companions: [NOW$
|
|
20321
|
+
companions: [NOW$3],
|
|
20322
|
+
alsoFrom: {
|
|
20323
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
20324
|
+
accept: {
|
|
20325
|
+
cap: "climate-control",
|
|
20326
|
+
fieldPath: "currentHumidity"
|
|
20327
|
+
}
|
|
20328
|
+
}
|
|
19239
20329
|
}),
|
|
19240
20330
|
numeric({
|
|
19241
20331
|
id: "pressure",
|
|
19242
20332
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
19243
20333
|
role: DeviceRole.PressureSensor,
|
|
19244
20334
|
outputCap: "pressure-sensor",
|
|
19245
|
-
outputField: "
|
|
20335
|
+
outputField: "pressure",
|
|
19246
20336
|
quantity: "pressure",
|
|
19247
20337
|
defaultAggregate: "mean",
|
|
19248
20338
|
empty: "null",
|
|
19249
|
-
companions: [NOW$
|
|
20339
|
+
companions: [NOW$3]
|
|
19250
20340
|
}),
|
|
19251
20341
|
numeric({
|
|
19252
20342
|
id: "illuminance",
|
|
19253
20343
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
19254
20344
|
role: DeviceRole.AmbientLightSensor,
|
|
19255
20345
|
outputCap: "ambient-light-sensor",
|
|
19256
|
-
outputField: "
|
|
20346
|
+
outputField: "illuminance",
|
|
19257
20347
|
quantity: "illuminance",
|
|
19258
20348
|
defaultAggregate: "mean",
|
|
19259
20349
|
empty: "null",
|
|
19260
|
-
companions: [NOW$
|
|
20350
|
+
companions: [NOW$3]
|
|
19261
20351
|
}),
|
|
19262
20352
|
numeric({
|
|
19263
20353
|
id: "power",
|
|
19264
20354
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
19265
20355
|
role: DeviceRole.PowerSensor,
|
|
19266
20356
|
outputCap: "power-meter",
|
|
19267
|
-
outputField: "
|
|
20357
|
+
outputField: "power",
|
|
19268
20358
|
quantity: "power",
|
|
19269
20359
|
defaultAggregate: "sum",
|
|
19270
20360
|
empty: "omit",
|
|
19271
|
-
companions: [NOW$
|
|
20361
|
+
companions: [NOW$3]
|
|
19272
20362
|
}),
|
|
19273
20363
|
numeric({
|
|
19274
20364
|
id: "energy",
|
|
19275
20365
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
19276
20366
|
role: DeviceRole.EnergySensor,
|
|
19277
20367
|
outputCap: "power-meter",
|
|
19278
|
-
outputField: "
|
|
20368
|
+
outputField: "energy",
|
|
19279
20369
|
quantity: "energy",
|
|
19280
20370
|
defaultAggregate: "sum",
|
|
19281
20371
|
empty: "omit",
|
|
19282
|
-
companions: [NOW$
|
|
20372
|
+
companions: [NOW$3]
|
|
19283
20373
|
}),
|
|
19284
20374
|
numeric({
|
|
19285
20375
|
id: "battery",
|
|
19286
20376
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
19287
20377
|
role: DeviceRole.BatterySensor,
|
|
19288
20378
|
outputCap: "battery",
|
|
19289
|
-
outputField: "
|
|
20379
|
+
outputField: "level",
|
|
19290
20380
|
quantity: "percentage",
|
|
19291
20381
|
defaultAggregate: "mean",
|
|
19292
20382
|
empty: "null",
|
|
@@ -19314,7 +20404,7 @@ var GROUP_TEMPLATES = [
|
|
|
19314
20404
|
quantity: "device",
|
|
19315
20405
|
defaultAggregate: "mean",
|
|
19316
20406
|
empty: "null",
|
|
19317
|
-
companions: [NOW$
|
|
20407
|
+
companions: [NOW$3]
|
|
19318
20408
|
}),
|
|
19319
20409
|
binary({
|
|
19320
20410
|
id: "motion",
|
|
@@ -19864,7 +20954,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19864
20954
|
kind: "mutation",
|
|
19865
20955
|
auth: "admin",
|
|
19866
20956
|
access: "view"
|
|
19867
|
-
})
|
|
20957
|
+
}), method(object({
|
|
20958
|
+
blockId: string().min(1),
|
|
20959
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
20960
|
+
runStartedAt: number().optional(),
|
|
20961
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
20962
|
+
}), _void(), {
|
|
20963
|
+
kind: "mutation",
|
|
20964
|
+
auth: "admin"
|
|
20965
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
20966
|
+
traces: array(AutomationRunTraceSchema),
|
|
20967
|
+
lastError: string().nullable()
|
|
20968
|
+
}), { auth: "admin" });
|
|
19868
20969
|
/**
|
|
19869
20970
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19870
20971
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -21705,6 +22806,36 @@ var ExposeInputSchema = object({
|
|
|
21705
22806
|
capabilities: array(string()).optional()
|
|
21706
22807
|
});
|
|
21707
22808
|
var UnexposeInputSchema = object({ deviceId: string() });
|
|
22809
|
+
/**
|
|
22810
|
+
* What an exporter may expose besides devices (D968). An action and a
|
|
22811
|
+
* notification target are LIST ENTRIES, never devices (D954): they enter an
|
|
22812
|
+
* exporter's own selection, not the device registry.
|
|
22813
|
+
*/
|
|
22814
|
+
var ExportEntityKindSchema = _enum([
|
|
22815
|
+
"device",
|
|
22816
|
+
"action",
|
|
22817
|
+
"notifier"
|
|
22818
|
+
]);
|
|
22819
|
+
var ExportEntityRefSchema = discriminatedUnion("kind", [
|
|
22820
|
+
object({
|
|
22821
|
+
kind: literal("device"),
|
|
22822
|
+
deviceId: string()
|
|
22823
|
+
}),
|
|
22824
|
+
object({
|
|
22825
|
+
kind: literal("action"),
|
|
22826
|
+
actionId: string().min(1)
|
|
22827
|
+
}),
|
|
22828
|
+
object({
|
|
22829
|
+
kind: literal("notifier"),
|
|
22830
|
+
targetId: string().min(1)
|
|
22831
|
+
})
|
|
22832
|
+
]);
|
|
22833
|
+
var ExposedEntitySchema = object({
|
|
22834
|
+
entity: ExportEntityRefSchema,
|
|
22835
|
+
exposedAs: string().optional()
|
|
22836
|
+
});
|
|
22837
|
+
var ExposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
|
|
22838
|
+
var UnexposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
|
|
21708
22839
|
var deviceExportCapability = {
|
|
21709
22840
|
name: "device-export",
|
|
21710
22841
|
scope: "system",
|
|
@@ -21734,6 +22865,16 @@ var deviceExportCapability = {
|
|
|
21734
22865
|
unexposeDevice: method(UnexposeInputSchema, _void(), {
|
|
21735
22866
|
kind: "mutation",
|
|
21736
22867
|
auth: "admin"
|
|
22868
|
+
}),
|
|
22869
|
+
listSupportedEntityKinds: optionalMethod(_void(), array(ExportEntityKindSchema)),
|
|
22870
|
+
listExposedEntities: optionalMethod(_void(), array(ExposedEntitySchema)),
|
|
22871
|
+
exposeEntity: optionalMethod(ExposeEntityInputSchema, _void(), {
|
|
22872
|
+
kind: "mutation",
|
|
22873
|
+
auth: "admin"
|
|
22874
|
+
}),
|
|
22875
|
+
unexposeEntity: optionalMethod(UnexposeEntityInputSchema, _void(), {
|
|
22876
|
+
kind: "mutation",
|
|
22877
|
+
auth: "admin"
|
|
21737
22878
|
})
|
|
21738
22879
|
}
|
|
21739
22880
|
};
|
|
@@ -42876,6 +44017,14 @@ method(object({
|
|
|
42876
44017
|
kind: "mutation",
|
|
42877
44018
|
auth: "admin"
|
|
42878
44019
|
});
|
|
44020
|
+
method(object({
|
|
44021
|
+
nodeId: string().min(1),
|
|
44022
|
+
/** Epoch ms the node was forgotten (the tombstone's `removedAt`). */
|
|
44023
|
+
removedAt: number()
|
|
44024
|
+
}), object({ counts: record(string(), number().int().nonnegative()) }), {
|
|
44025
|
+
kind: "mutation",
|
|
44026
|
+
auth: "admin"
|
|
44027
|
+
});
|
|
42879
44028
|
/**
|
|
42880
44029
|
* `device-removal-hook` — the reliable way an addon learns a device was DELETED,
|
|
42881
44030
|
* so it can delete what it keeps for that device (D865).
|
|
@@ -43523,6 +44672,17 @@ var LlmProfileSchema = object({
|
|
|
43523
44672
|
* field in its editor only when its descriptor lists it in `profileFields`. */
|
|
43524
44673
|
topK: number().int().positive().optional(),
|
|
43525
44674
|
maxTokens: number().int().positive().optional(),
|
|
44675
|
+
/** How hard the model "thinks" before it answers. Omitted = the model's own
|
|
44676
|
+
* default. `off` matters for structured output: a thinking model can spend
|
|
44677
|
+
* the whole completion on reasoning and return an empty `content`. Carried
|
|
44678
|
+
* only by the wires that have it — a kind offers the field in its editor
|
|
44679
|
+
* only when its descriptor lists it in `profileFields`. */
|
|
44680
|
+
reasoningEffort: _enum([
|
|
44681
|
+
"off",
|
|
44682
|
+
"low",
|
|
44683
|
+
"medium",
|
|
44684
|
+
"high"
|
|
44685
|
+
]).optional(),
|
|
43526
44686
|
/** Prompt context window. Advisory for cloud kinds (they enforce their own). */
|
|
43527
44687
|
contextLength: number().int().positive().optional(),
|
|
43528
44688
|
/** Default system prompt. A caller's `system` REPLACES it (never appends —
|
|
@@ -43561,6 +44721,7 @@ var LlmProfileFieldSchema = _enum([
|
|
|
43561
44721
|
"topP",
|
|
43562
44722
|
"topK",
|
|
43563
44723
|
"maxTokens",
|
|
44724
|
+
"reasoningEffort",
|
|
43564
44725
|
"contextLength",
|
|
43565
44726
|
"systemPrompt",
|
|
43566
44727
|
"timeoutMs",
|
|
@@ -43584,7 +44745,7 @@ var LlmProviderWidgetSchema = object({
|
|
|
43584
44745
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
43585
44746
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
43586
44747
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
43587
|
-
var ConfigSchemaPassthrough$
|
|
44748
|
+
var ConfigSchemaPassthrough$2 = unknown();
|
|
43588
44749
|
var LlmProfileKindDescriptorSchema = object({
|
|
43589
44750
|
kind: LlmProfileKindSchema,
|
|
43590
44751
|
label: string(),
|
|
@@ -43593,9 +44754,9 @@ var LlmProfileKindDescriptorSchema = object({
|
|
|
43593
44754
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
43594
44755
|
addonId: string(),
|
|
43595
44756
|
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
43596
|
-
connectionSchema: ConfigSchemaPassthrough$
|
|
44757
|
+
connectionSchema: ConfigSchemaPassthrough$2,
|
|
43597
44758
|
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
43598
|
-
advancedSchema: ConfigSchemaPassthrough$
|
|
44759
|
+
advancedSchema: ConfigSchemaPassthrough$2.optional(),
|
|
43599
44760
|
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
43600
44761
|
features: LlmModelFeaturesSchema,
|
|
43601
44762
|
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
@@ -44121,10 +45282,10 @@ var CpuBreakdownSchema = object({
|
|
|
44121
45282
|
cores: number()
|
|
44122
45283
|
});
|
|
44123
45284
|
var MemoryInfoSchema = object({
|
|
44124
|
-
percent: number(),
|
|
45285
|
+
percent: number().nullable(),
|
|
44125
45286
|
totalBytes: number(),
|
|
44126
|
-
usedBytes: number(),
|
|
44127
|
-
availableBytes: number(),
|
|
45287
|
+
usedBytes: number().nullable(),
|
|
45288
|
+
availableBytes: number().nullable(),
|
|
44128
45289
|
swapUsedBytes: number(),
|
|
44129
45290
|
swapTotalBytes: number()
|
|
44130
45291
|
});
|
|
@@ -44428,8 +45589,9 @@ var GetLoadSeriesInputSchema = object({
|
|
|
44428
45589
|
});
|
|
44429
45590
|
var SystemMetricsSchema = object({
|
|
44430
45591
|
cpuPercent: number(),
|
|
44431
|
-
|
|
44432
|
-
|
|
45592
|
+
/** `null` when the memory sample failed or was not taken yet (D393). */
|
|
45593
|
+
memoryPercent: number().nullable(),
|
|
45594
|
+
memoryUsedMB: number().nullable(),
|
|
44433
45595
|
memoryTotalMB: number(),
|
|
44434
45596
|
diskPercent: number().optional(),
|
|
44435
45597
|
temperature: number().optional(),
|
|
@@ -44665,424 +45827,6 @@ var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
|
|
|
44665
45827
|
sourcePort: number().optional()
|
|
44666
45828
|
});
|
|
44667
45829
|
method(_void(), NetworkEndpointSchema, { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), method(_void(), NetworkEndpointSchema.nullable()), method(_void(), NetworkAccessStatusSchema), method(_void(), array(NetworkEndpointEntrySchema).readonly());
|
|
44668
|
-
/**
|
|
44669
|
-
* notification-output — canonical, capability-gated notification delivery.
|
|
44670
|
-
*
|
|
44671
|
-
* Apprise-derived model (see
|
|
44672
|
-
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
44673
|
-
* callers emit ONE canonical `Notification`; each provider declares a
|
|
44674
|
-
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
44675
|
-
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
44676
|
-
* message to what the kind supports — callers never special-case a service.
|
|
44677
|
-
*
|
|
44678
|
-
* DESIGN DECISIONS (locked):
|
|
44679
|
-
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
44680
|
-
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
44681
|
-
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
44682
|
-
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
44683
|
-
* alternative would fork the UI per addon and cannot host the
|
|
44684
|
-
* discovery→adopt flow.
|
|
44685
|
-
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
44686
|
-
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
44687
|
-
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
44688
|
-
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
44689
|
-
* `addonId` the generated collection router extracts from the call input.
|
|
44690
|
-
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
44691
|
-
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
44692
|
-
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
44693
|
-
* base64 fallback needed.
|
|
44694
|
-
*
|
|
44695
|
-
* TODO (deferred, closed-set change — separate decision): add
|
|
44696
|
-
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
44697
|
-
* admin "Integrations" page.
|
|
44698
|
-
*/
|
|
44699
|
-
/**
|
|
44700
|
-
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
44701
|
-
* adapter picks what it supports and the degrade engine filters the rest.
|
|
44702
|
-
*/
|
|
44703
|
-
var AttachmentMediaTypeSchema = _enum([
|
|
44704
|
-
"image",
|
|
44705
|
-
"video",
|
|
44706
|
-
"gif",
|
|
44707
|
-
"audio",
|
|
44708
|
-
"icon"
|
|
44709
|
-
]);
|
|
44710
|
-
/**
|
|
44711
|
-
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
44712
|
-
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
44713
|
-
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
44714
|
-
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
44715
|
-
*/
|
|
44716
|
-
var AttachmentSchema = object({
|
|
44717
|
-
mediaType: AttachmentMediaTypeSchema,
|
|
44718
|
-
url: string().optional(),
|
|
44719
|
-
bytes: _instanceof(Uint8Array).optional(),
|
|
44720
|
-
mime: string().optional(),
|
|
44721
|
-
name: string().optional()
|
|
44722
|
-
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
44723
|
-
var NotificationFormatSchema = _enum([
|
|
44724
|
-
"text",
|
|
44725
|
-
"markdown",
|
|
44726
|
-
"html"
|
|
44727
|
-
]);
|
|
44728
|
-
/**
|
|
44729
|
-
* The CLOSED icon vocabulary an action button may use.
|
|
44730
|
-
*
|
|
44731
|
-
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
44732
|
-
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
44733
|
-
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
44734
|
-
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
44735
|
-
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
44736
|
-
*
|
|
44737
|
-
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
44738
|
-
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
44739
|
-
* differently.
|
|
44740
|
-
*
|
|
44741
|
-
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
44742
|
-
*
|
|
44743
|
-
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
44744
|
-
* the whole set onto its own renderer's vocabulary through a
|
|
44745
|
-
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
44746
|
-
* fallback, so adding a member here fails every adapter's build until someone
|
|
44747
|
-
* decides its glyph, which is the only place that decision can be made
|
|
44748
|
-
* honestly.
|
|
44749
|
-
*
|
|
44750
|
-
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
44751
|
-
* `disarm` straight through; iOS feeds that string to
|
|
44752
|
-
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
44753
|
-
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
44754
|
-
* mapping, and "the field is documented" is not "the value renders".
|
|
44755
|
-
*
|
|
44756
|
-
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
44757
|
-
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
44758
|
-
* so an addon that emits a token the running hub does not know does not lose an
|
|
44759
|
-
* icon — its whole `send` fails Zod validation and the notification never
|
|
44760
|
-
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
44761
|
-
*/
|
|
44762
|
-
var NotificationActionIconSchema = _enum([
|
|
44763
|
-
"acknowledge",
|
|
44764
|
-
"dismiss",
|
|
44765
|
-
"silence",
|
|
44766
|
-
"snooze",
|
|
44767
|
-
"view",
|
|
44768
|
-
"play",
|
|
44769
|
-
"open",
|
|
44770
|
-
"close",
|
|
44771
|
-
"lock",
|
|
44772
|
-
"unlock",
|
|
44773
|
-
"arm",
|
|
44774
|
-
"arm-home",
|
|
44775
|
-
"arm-away",
|
|
44776
|
-
"arm-night",
|
|
44777
|
-
"disarm",
|
|
44778
|
-
"light",
|
|
44779
|
-
"alert",
|
|
44780
|
-
"camera"
|
|
44781
|
-
]);
|
|
44782
|
-
/** A single tap-through action button. */
|
|
44783
|
-
var NotificationActionSchema = object({
|
|
44784
|
-
id: string(),
|
|
44785
|
-
label: string(),
|
|
44786
|
-
url: string().optional(),
|
|
44787
|
-
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
44788
|
-
icon: NotificationActionIconSchema.optional(),
|
|
44789
|
-
/**
|
|
44790
|
-
* Renders in a warning style where the notifier supports it.
|
|
44791
|
-
*
|
|
44792
|
-
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
44793
|
-
* else — see `notification-center/action-token.ts` for what that does and
|
|
44794
|
-
* does not buy.
|
|
44795
|
-
*/
|
|
44796
|
-
destructive: boolean().optional(),
|
|
44797
|
-
/**
|
|
44798
|
-
* How the tap should REACH the url.
|
|
44799
|
-
*
|
|
44800
|
-
* `navigate` (absent, and every button authored before this field) opens it:
|
|
44801
|
-
* the phone leaves the notification and shows whatever the callback returns.
|
|
44802
|
-
* That is right for a button whose answer the operator wants to read.
|
|
44803
|
-
*
|
|
44804
|
-
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
44805
|
-
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
44806
|
-
* an answer to the notification, and being thrown into a browser tab to
|
|
44807
|
-
* confirm it costs more attention than the notification did. A backend that
|
|
44808
|
-
* cannot do a background call renders it as an ordinary link (the adapters
|
|
44809
|
-
* fall back rather than dropping the button), so this is a preference, never
|
|
44810
|
-
* a requirement.
|
|
44811
|
-
*/
|
|
44812
|
-
mode: _enum(["navigate", "background"]).optional()
|
|
44813
|
-
});
|
|
44814
|
-
/**
|
|
44815
|
-
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
44816
|
-
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
44817
|
-
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
44818
|
-
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
44819
|
-
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
44820
|
-
* `priority` for that one target.
|
|
44821
|
-
*/
|
|
44822
|
-
var NotificationSchema = object({
|
|
44823
|
-
body: string(),
|
|
44824
|
-
title: string().optional(),
|
|
44825
|
-
format: NotificationFormatSchema.default("text"),
|
|
44826
|
-
priority: number().int().min(1).max(5).default(3),
|
|
44827
|
-
level: string().optional(),
|
|
44828
|
-
attachments: array(AttachmentSchema).optional(),
|
|
44829
|
-
clickUrl: string().optional(),
|
|
44830
|
-
actions: array(NotificationActionSchema).optional(),
|
|
44831
|
-
sound: string().optional(),
|
|
44832
|
-
ttl: number().optional(),
|
|
44833
|
-
tag: string().optional(),
|
|
44834
|
-
deviceId: number().optional(),
|
|
44835
|
-
eventId: string().optional(),
|
|
44836
|
-
metadata: record(string(), unknown()).optional()
|
|
44837
|
-
});
|
|
44838
|
-
/** One declared native severity/priority level for a kind. */
|
|
44839
|
-
var TargetKindLevelSchema = object({
|
|
44840
|
-
id: string(),
|
|
44841
|
-
label: string(),
|
|
44842
|
-
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
44843
|
-
ordinal: number().int().min(1).max(5).nullable(),
|
|
44844
|
-
flags: object({
|
|
44845
|
-
critical: boolean().optional(),
|
|
44846
|
-
silent: boolean().optional(),
|
|
44847
|
-
noPush: boolean().optional()
|
|
44848
|
-
}).optional(),
|
|
44849
|
-
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
44850
|
-
requires: array(string()).optional(),
|
|
44851
|
-
description: string().optional()
|
|
44852
|
-
});
|
|
44853
|
-
/** The full capability block consulted before dispatch. */
|
|
44854
|
-
var TargetKindCapsSchema = object({
|
|
44855
|
-
attachments: object({
|
|
44856
|
-
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
44857
|
-
mode: _enum([
|
|
44858
|
-
"url",
|
|
44859
|
-
"bytes",
|
|
44860
|
-
"both"
|
|
44861
|
-
]),
|
|
44862
|
-
max: number().int().nonnegative(),
|
|
44863
|
-
maxBytes: number().int().positive().optional()
|
|
44864
|
-
}),
|
|
44865
|
-
/** Max action buttons (0 = none). */
|
|
44866
|
-
actions: number().int().nonnegative(),
|
|
44867
|
-
/**
|
|
44868
|
-
* Whether this kind renders a per-action ICON.
|
|
44869
|
-
*
|
|
44870
|
-
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
44871
|
-
* run on the addon cap path — three production failures in one day taught
|
|
44872
|
-
* this repo that once. Absent is read as false by the degrade engine, which
|
|
44873
|
-
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
44874
|
-
* assumed and dropped costs the operator's trust in the field.
|
|
44875
|
-
*/
|
|
44876
|
-
actionIcons: boolean().optional(),
|
|
44877
|
-
levels: array(TargetKindLevelSchema),
|
|
44878
|
-
format: array(NotificationFormatSchema),
|
|
44879
|
-
clickUrl: boolean(),
|
|
44880
|
-
sound: boolean(),
|
|
44881
|
-
ttl: boolean(),
|
|
44882
|
-
bodyMaxLen: number().int().positive()
|
|
44883
|
-
});
|
|
44884
|
-
/**
|
|
44885
|
-
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
44886
|
-
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
44887
|
-
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
44888
|
-
* the union is large and not meant for runtime validation here; the exported
|
|
44889
|
-
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
44890
|
-
*/
|
|
44891
|
-
var ConfigSchemaPassthrough$2 = unknown();
|
|
44892
|
-
var TargetKindSchema = object({
|
|
44893
|
-
kind: string(),
|
|
44894
|
-
label: string(),
|
|
44895
|
-
icon: string(),
|
|
44896
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
44897
|
-
addonId: string(),
|
|
44898
|
-
/**
|
|
44899
|
-
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
44900
|
-
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
44901
|
-
* when the addon bundles no icon for that kind — the client then falls back
|
|
44902
|
-
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
44903
|
-
*
|
|
44904
|
-
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
44905
|
-
* client, and a native client joins it onto its own hub base.
|
|
44906
|
-
*
|
|
44907
|
-
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
44908
|
-
* field that survived only because the runtime cap-router forwards provider
|
|
44909
|
-
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
44910
|
-
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
44911
|
-
* broken silently the moment output validation was tightened anywhere.
|
|
44912
|
-
*/
|
|
44913
|
-
iconUrl: string().optional(),
|
|
44914
|
-
/**
|
|
44915
|
-
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
44916
|
-
*
|
|
44917
|
-
* The server knows this and therefore says it, because the client cannot
|
|
44918
|
-
* safely guess: a React-Native client renders SVG and raster through two
|
|
44919
|
-
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
44920
|
-
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
44921
|
-
* placeholder glyph for every vector icon while the web build looked fine.
|
|
44922
|
-
*
|
|
44923
|
-
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
44924
|
-
* not been updated — a client that cannot determine the type should prefer
|
|
44925
|
-
* its raster path, which is the safe default for an unknown image.
|
|
44926
|
-
*/
|
|
44927
|
-
iconMediaType: string().optional(),
|
|
44928
|
-
configSchema: ConfigSchemaPassthrough$2,
|
|
44929
|
-
/**
|
|
44930
|
-
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
44931
|
-
* base URL, instance, chat, recipient). A save that changes any of them
|
|
44932
|
-
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
44933
|
-
* editor uses this to ask for the secret on exactly those edits instead of
|
|
44934
|
-
* on every edit.
|
|
44935
|
-
*
|
|
44936
|
-
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
44937
|
-
* kinds) and from a provider older than this field — an editor that finds
|
|
44938
|
-
* it absent must assume ANY edit may need the secret.
|
|
44939
|
-
*/
|
|
44940
|
-
destinationKeys: array(string()).optional(),
|
|
44941
|
-
supportsDiscovery: boolean(),
|
|
44942
|
-
caps: TargetKindCapsSchema
|
|
44943
|
-
});
|
|
44944
|
-
/**
|
|
44945
|
-
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
44946
|
-
* (return a presence marker only) when serving `listTargets` — never
|
|
44947
|
-
* round-trip a stored secret to the UI.
|
|
44948
|
-
*/
|
|
44949
|
-
var TargetSchema = object({
|
|
44950
|
-
id: string(),
|
|
44951
|
-
name: string(),
|
|
44952
|
-
kind: string(),
|
|
44953
|
-
addonId: string(),
|
|
44954
|
-
enabled: boolean(),
|
|
44955
|
-
config: record(string(), unknown())
|
|
44956
|
-
});
|
|
44957
|
-
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
44958
|
-
var DiscoveredTargetSchema = object({
|
|
44959
|
-
kind: string(),
|
|
44960
|
-
suggestedName: string(),
|
|
44961
|
-
config: record(string(), unknown())
|
|
44962
|
-
});
|
|
44963
|
-
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
44964
|
-
var RenderedAsSchema = object({
|
|
44965
|
-
level: string(),
|
|
44966
|
-
format: NotificationFormatSchema,
|
|
44967
|
-
attachmentsSent: number().int().nonnegative(),
|
|
44968
|
-
actionsSent: number().int().nonnegative(),
|
|
44969
|
-
truncated: boolean(),
|
|
44970
|
-
dropped: array(string())
|
|
44971
|
-
});
|
|
44972
|
-
var SendResultSchema = object({
|
|
44973
|
-
success: boolean(),
|
|
44974
|
-
error: string().optional(),
|
|
44975
|
-
renderedAs: RenderedAsSchema.optional()
|
|
44976
|
-
});
|
|
44977
|
-
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
44978
|
-
var TestResultSchema = SendResultSchema;
|
|
44979
|
-
/**
|
|
44980
|
-
* Pre-save credential probe against a partial (unsaved) target config.
|
|
44981
|
-
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
44982
|
-
*/
|
|
44983
|
-
var ProbeTargetConfigResultSchema = object({
|
|
44984
|
-
ok: boolean(),
|
|
44985
|
-
resolvedUrl: string(),
|
|
44986
|
-
httpStatus: number().int().optional(),
|
|
44987
|
-
stateInstance: string().optional(),
|
|
44988
|
-
error: string().optional()
|
|
44989
|
-
});
|
|
44990
|
-
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
|
|
44991
|
-
kind: string(),
|
|
44992
|
-
config: record(string(), unknown()).optional(),
|
|
44993
|
-
/**
|
|
44994
|
-
* When editing / duplicating, the blank password field never round-trips
|
|
44995
|
-
* the stored token. Pass the source target id so the provider can restore
|
|
44996
|
-
* secrets server-side before dialling (same merge as upsert).
|
|
44997
|
-
*/
|
|
44998
|
-
targetId: string().optional()
|
|
44999
|
-
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
45000
|
-
kind: string(),
|
|
45001
|
-
config: record(string(), unknown()),
|
|
45002
|
-
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
45003
|
-
targetId: string().optional()
|
|
45004
|
-
}), ProbeTargetConfigResultSchema, {
|
|
45005
|
-
kind: "mutation",
|
|
45006
|
-
auth: "admin"
|
|
45007
|
-
}), method(object({
|
|
45008
|
-
targetId: string(),
|
|
45009
|
-
notification: NotificationSchema
|
|
45010
|
-
}), SendResultSchema, {
|
|
45011
|
-
kind: "mutation",
|
|
45012
|
-
auth: "admin"
|
|
45013
|
-
}), method(object({
|
|
45014
|
-
targetId: string(),
|
|
45015
|
-
sample: NotificationSchema.optional()
|
|
45016
|
-
}), TestResultSchema, {
|
|
45017
|
-
kind: "mutation",
|
|
45018
|
-
auth: "admin"
|
|
45019
|
-
}), method(object({
|
|
45020
|
-
target: TargetSchema,
|
|
45021
|
-
/**
|
|
45022
|
-
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
45023
|
-
* existing row. The UI never holds the stored token; blank / redacted
|
|
45024
|
-
* password fields are restored from this source (D634 still applies if
|
|
45025
|
-
* destinations diverge without a re-typed secret).
|
|
45026
|
-
*/
|
|
45027
|
-
cloneSecretsFrom: string().optional()
|
|
45028
|
-
}), TargetSchema, {
|
|
45029
|
-
kind: "mutation",
|
|
45030
|
-
auth: "admin"
|
|
45031
|
-
}), method(object({ targetId: string() }), _void(), {
|
|
45032
|
-
kind: "mutation",
|
|
45033
|
-
auth: "admin"
|
|
45034
|
-
}), method(object({
|
|
45035
|
-
targetId: string(),
|
|
45036
|
-
enabled: boolean()
|
|
45037
|
-
}), _void(), {
|
|
45038
|
-
kind: "mutation",
|
|
45039
|
-
auth: "admin"
|
|
45040
|
-
});
|
|
45041
|
-
new Set([
|
|
45042
|
-
{
|
|
45043
|
-
id: "person",
|
|
45044
|
-
name: "Person"
|
|
45045
|
-
},
|
|
45046
|
-
{
|
|
45047
|
-
id: "vehicle",
|
|
45048
|
-
name: "Vehicle"
|
|
45049
|
-
},
|
|
45050
|
-
{
|
|
45051
|
-
id: "animal",
|
|
45052
|
-
name: "Animal"
|
|
45053
|
-
},
|
|
45054
|
-
{
|
|
45055
|
-
id: "package",
|
|
45056
|
-
name: "Package"
|
|
45057
|
-
}
|
|
45058
|
-
].map((l) => l.id));
|
|
45059
|
-
var COCO_TO_MACRO = {
|
|
45060
|
-
mapping: {
|
|
45061
|
-
person: "person",
|
|
45062
|
-
bicycle: "vehicle",
|
|
45063
|
-
car: "vehicle",
|
|
45064
|
-
motorcycle: "vehicle",
|
|
45065
|
-
airplane: "vehicle",
|
|
45066
|
-
bus: "vehicle",
|
|
45067
|
-
train: "vehicle",
|
|
45068
|
-
truck: "vehicle",
|
|
45069
|
-
boat: "vehicle",
|
|
45070
|
-
bird: "animal",
|
|
45071
|
-
cat: "animal",
|
|
45072
|
-
dog: "animal",
|
|
45073
|
-
horse: "animal",
|
|
45074
|
-
sheep: "animal",
|
|
45075
|
-
cow: "animal",
|
|
45076
|
-
elephant: "animal",
|
|
45077
|
-
bear: "animal",
|
|
45078
|
-
zebra: "animal",
|
|
45079
|
-
giraffe: "animal",
|
|
45080
|
-
suitcase: "package",
|
|
45081
|
-
backpack: "package",
|
|
45082
|
-
handbag: "package"
|
|
45083
|
-
},
|
|
45084
|
-
preserveOriginal: false
|
|
45085
|
-
};
|
|
45086
45830
|
var AUDIO_MACRO_LABELS = [
|
|
45087
45831
|
{
|
|
45088
45832
|
id: "speech",
|
|
@@ -51483,14 +52227,6 @@ var EngineProvisioningSchema = object({
|
|
|
51483
52227
|
*/
|
|
51484
52228
|
configIssues: array(string()).optional()
|
|
51485
52229
|
});
|
|
51486
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
51487
|
-
addonId: string(),
|
|
51488
|
-
modelId: string().optional(),
|
|
51489
|
-
enabled: boolean().default(true),
|
|
51490
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
51491
|
-
settings: record(string(), unknown()).optional(),
|
|
51492
|
-
jumpDeviceKey: string().optional()
|
|
51493
|
-
}));
|
|
51494
52230
|
var ModelSubstitutionSchema = object({
|
|
51495
52231
|
addonId: string(),
|
|
51496
52232
|
chosen: string(),
|
|
@@ -51569,7 +52305,6 @@ var ConfigUISchemaBridge = custom();
|
|
|
51569
52305
|
var ConfigUISchemaNullableBridge = custom();
|
|
51570
52306
|
var InferenceCapabilitiesBridge = custom();
|
|
51571
52307
|
var ModelAvailabilityListBridge = custom();
|
|
51572
|
-
var PipelineRunResultBridge = custom();
|
|
51573
52308
|
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
51574
52309
|
modelId: string(),
|
|
51575
52310
|
settings: record(string(), unknown()).readonly()
|
|
@@ -57347,7 +58082,9 @@ var ManifestShapeSchema = object({
|
|
|
57347
58082
|
icon: string().optional()
|
|
57348
58083
|
}).optional(),
|
|
57349
58084
|
protected: boolean().optional(),
|
|
57350
|
-
removable: boolean().optional()
|
|
58085
|
+
removable: boolean().optional(),
|
|
58086
|
+
/** Declared Integrations-page block (mirror of `AddonDeclaration.integrationSection`). */
|
|
58087
|
+
integrationSection: _enum(["system", "providers"]).optional()
|
|
57351
58088
|
});
|
|
57352
58089
|
var AddonProcessSchema = object({
|
|
57353
58090
|
pid: number().optional(),
|
|
@@ -57712,9 +58449,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
57712
58449
|
}), LogStreamEntrySchema, { kind: "subscription" });
|
|
57713
58450
|
object({
|
|
57714
58451
|
/** Carbon dioxide concentration in ppm. */
|
|
57715
|
-
|
|
58452
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
57716
58453
|
/** Total volatile organic compounds in ppb. */
|
|
57717
|
-
|
|
58454
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
57718
58455
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
57719
58456
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
57720
58457
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -57731,7 +58468,7 @@ DeviceType.Sensor;
|
|
|
57731
58468
|
*/
|
|
57732
58469
|
var AmbientLightSensorStatusSchema = object({
|
|
57733
58470
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
57734
|
-
|
|
58471
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
57735
58472
|
precision: 0,
|
|
57736
58473
|
label: "Illuminance"
|
|
57737
58474
|
})),
|
|
@@ -57828,6 +58565,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
|
|
|
57828
58565
|
* would produce more than `maxPoints` samples. */
|
|
57829
58566
|
sampleEveryMs: number().int().positive().optional()
|
|
57830
58567
|
}), AudioMetricsHistorySchema);
|
|
58568
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58569
|
+
actionId: string().min(1),
|
|
58570
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
58571
|
+
}), _void(), {
|
|
58572
|
+
kind: "mutation",
|
|
58573
|
+
auth: "admin"
|
|
58574
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
58575
|
+
kind: "mutation",
|
|
58576
|
+
auth: "admin"
|
|
58577
|
+
});
|
|
58578
|
+
/**
|
|
58579
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
58580
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
58581
|
+
*
|
|
58582
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
58583
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
58584
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
58585
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
58586
|
+
* drift (D3).
|
|
58587
|
+
*
|
|
58588
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
58589
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
58590
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
58591
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
58592
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
58593
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
58594
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
58595
|
+
*
|
|
58596
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
58597
|
+
* logged — never queued.
|
|
58598
|
+
*/
|
|
58599
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
58600
|
+
var ActionLinksSchema = object({
|
|
58601
|
+
deviceId: number().int().nonnegative(),
|
|
58602
|
+
actionIds: array(string().min(1)).max(100)
|
|
58603
|
+
});
|
|
58604
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58605
|
+
actionId: string().min(1),
|
|
58606
|
+
deviceId: number().int().nonnegative().optional()
|
|
58607
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
58608
|
+
role: "viewer",
|
|
58609
|
+
auth: "protected",
|
|
58610
|
+
kind: "query",
|
|
58611
|
+
caller: "required"
|
|
58612
|
+
}), method(object({
|
|
58613
|
+
actionId: string().min(1),
|
|
58614
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
58615
|
+
wait: boolean().optional(),
|
|
58616
|
+
origin: ActionRunOriginSchema.optional(),
|
|
58617
|
+
deviceId: number().int().nonnegative().optional()
|
|
58618
|
+
}), ActionRunResultSchema, {
|
|
58619
|
+
role: "viewer",
|
|
58620
|
+
auth: "protected",
|
|
58621
|
+
kind: "mutation",
|
|
58622
|
+
caller: "required"
|
|
58623
|
+
}), method(ActionIdInput, _void(), {
|
|
58624
|
+
kind: "mutation",
|
|
58625
|
+
auth: "admin"
|
|
58626
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
58627
|
+
kind: "mutation",
|
|
58628
|
+
auth: "admin"
|
|
58629
|
+
}), method(object({
|
|
58630
|
+
actionId: string().min(1),
|
|
58631
|
+
action: ActionInputSchema.partial()
|
|
58632
|
+
}), object({ action: ActionEntrySchema }), {
|
|
58633
|
+
kind: "mutation",
|
|
58634
|
+
auth: "admin"
|
|
58635
|
+
}), method(ActionIdInput, _void(), {
|
|
58636
|
+
kind: "mutation",
|
|
58637
|
+
auth: "admin"
|
|
58638
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
58639
|
+
role: "viewer",
|
|
58640
|
+
auth: "protected",
|
|
58641
|
+
kind: "query"
|
|
58642
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
58643
|
+
kind: "mutation",
|
|
58644
|
+
auth: "admin"
|
|
58645
|
+
});
|
|
57831
58646
|
object({
|
|
57832
58647
|
/** Whether the automation is currently enabled. Disabled automations
|
|
57833
58648
|
* ignore their trigger block — manual `trigger` still works. */
|
|
@@ -57881,7 +58696,7 @@ var BatteryStatusSchema = object({
|
|
|
57881
58696
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
57882
58697
|
* declines to band a non-finite reading, which is the correct shape.
|
|
57883
58698
|
*/
|
|
57884
|
-
|
|
58699
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
57885
58700
|
/**
|
|
57886
58701
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
57887
58702
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -57891,7 +58706,7 @@ var BatteryStatusSchema = object({
|
|
|
57891
58706
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
57892
58707
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
57893
58708
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
57894
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
58709
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
57895
58710
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
57896
58711
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
57897
58712
|
*/
|
|
@@ -57915,7 +58730,7 @@ var BatteryStatusSchema = object({
|
|
|
57915
58730
|
* that only report charge. A second reading on this cap, not a second
|
|
57916
58731
|
* `numeric-sensor` on the same device.
|
|
57917
58732
|
*/
|
|
57918
|
-
|
|
58733
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
57919
58734
|
/**
|
|
57920
58735
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
57921
58736
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -57949,7 +58764,7 @@ var BatteryStatusSchema = object({
|
|
|
57949
58764
|
/**
|
|
57950
58765
|
* True when the source is a BINARY low-battery indicator (HA
|
|
57951
58766
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
57952
|
-
* charge level — `
|
|
58767
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
57953
58768
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
57954
58769
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
57955
58770
|
*/
|
|
@@ -57975,26 +58790,388 @@ object({
|
|
|
57975
58790
|
DeviceType.Sensor;
|
|
57976
58791
|
object({
|
|
57977
58792
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
57978
|
-
|
|
58793
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
57979
58794
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
57980
58795
|
lastChangedAt: number()
|
|
57981
58796
|
});
|
|
57982
58797
|
DeviceType.Light, method(object({
|
|
57983
58798
|
deviceId: number().int().nonnegative(),
|
|
57984
|
-
|
|
58799
|
+
level: number().min(0).max(100)
|
|
57985
58800
|
}), _void(), {
|
|
57986
58801
|
kind: "mutation",
|
|
57987
58802
|
auth: "protected"
|
|
57988
58803
|
}), object({
|
|
57989
58804
|
deviceId: number(),
|
|
57990
|
-
|
|
58805
|
+
level: number().min(0).max(100),
|
|
57991
58806
|
lastChangedAt: number()
|
|
57992
58807
|
});
|
|
58808
|
+
/**
|
|
58809
|
+
* The role vocabulary of a remote (D963): what a button MEANS, independent of
|
|
58810
|
+
* how it is wired. A layout template places buttons by role; a device binds a
|
|
58811
|
+
* role to an action; an exporter asks for a role by name. Roles are shared so
|
|
58812
|
+
* one layout fits every appliance and one voice command fits every binding.
|
|
58813
|
+
*
|
|
58814
|
+
* A role outside this list is `custom:<key>` — the operator's own button (a
|
|
58815
|
+
* SmartIR source, a channel preset). The key is a lowercase slug.
|
|
58816
|
+
*/
|
|
58817
|
+
var REMOTE_KNOWN_ROLES = [
|
|
58818
|
+
"power",
|
|
58819
|
+
"power_on",
|
|
58820
|
+
"power_off",
|
|
58821
|
+
"volume_up",
|
|
58822
|
+
"volume_down",
|
|
58823
|
+
"mute",
|
|
58824
|
+
"channel_up",
|
|
58825
|
+
"channel_down",
|
|
58826
|
+
"up",
|
|
58827
|
+
"down",
|
|
58828
|
+
"left",
|
|
58829
|
+
"right",
|
|
58830
|
+
"ok",
|
|
58831
|
+
"back",
|
|
58832
|
+
"home",
|
|
58833
|
+
"menu",
|
|
58834
|
+
"info",
|
|
58835
|
+
"guide",
|
|
58836
|
+
"exit",
|
|
58837
|
+
"input",
|
|
58838
|
+
"play",
|
|
58839
|
+
"pause",
|
|
58840
|
+
"play_pause",
|
|
58841
|
+
"stop",
|
|
58842
|
+
"next",
|
|
58843
|
+
"previous",
|
|
58844
|
+
"fast_forward",
|
|
58845
|
+
"rewind",
|
|
58846
|
+
"digit_0",
|
|
58847
|
+
"digit_1",
|
|
58848
|
+
"digit_2",
|
|
58849
|
+
"digit_3",
|
|
58850
|
+
"digit_4",
|
|
58851
|
+
"digit_5",
|
|
58852
|
+
"digit_6",
|
|
58853
|
+
"digit_7",
|
|
58854
|
+
"digit_8",
|
|
58855
|
+
"digit_9"
|
|
58856
|
+
];
|
|
58857
|
+
var CUSTOM_KEY_RE = /^[a-z0-9][a-z0-9_]{0,47}$/;
|
|
58858
|
+
var KNOWN_ROLES = new Set(REMOTE_KNOWN_ROLES);
|
|
58859
|
+
function isRemoteKnownRole(value) {
|
|
58860
|
+
return KNOWN_ROLES.has(value);
|
|
58861
|
+
}
|
|
58862
|
+
function isRemoteCustomKey(key) {
|
|
58863
|
+
return CUSTOM_KEY_RE.test(key);
|
|
58864
|
+
}
|
|
58865
|
+
/** The key of a `custom:<key>` role, or null for any other string. */
|
|
58866
|
+
function customKeyOfRole(role) {
|
|
58867
|
+
if (!role.startsWith("custom:")) return null;
|
|
58868
|
+
const key = role.slice(7);
|
|
58869
|
+
return isRemoteCustomKey(key) ? key : null;
|
|
58870
|
+
}
|
|
58871
|
+
function isRemoteRole(value) {
|
|
58872
|
+
return isRemoteKnownRole(value) || customKeyOfRole(value) !== null;
|
|
58873
|
+
}
|
|
58874
|
+
var RemoteRoleSchema = string().refine(isRemoteRole, { message: "a role is one of the known roles or custom:<key> (lowercase letters, digits, _)" });
|
|
58875
|
+
var RemoteBindingSchema = object({ action: AutomationCapStepSchema.extend({ deviceId: number().int().nonnegative() }) });
|
|
58876
|
+
var RemoteCustomButtonSchema = object({
|
|
58877
|
+
/** The slug after `custom:` in the role. */
|
|
58878
|
+
key: string().refine(isRemoteCustomKey, { message: "a lowercase slug" }),
|
|
58879
|
+
/** What the operator calls it, and what a voice command may name. */
|
|
58880
|
+
name: string().min(1).max(60)
|
|
58881
|
+
});
|
|
58882
|
+
var RemotePowerModeSchema = _enum(["toggle", "discrete"]);
|
|
58883
|
+
var RemoteConfigSchema = object({
|
|
58884
|
+
layoutTemplateId: string().min(1).nullable(),
|
|
58885
|
+
/**
|
|
58886
|
+
* The transmitter device new bindings and an import send through. A binding
|
|
58887
|
+
* names its own device, so one command may override it.
|
|
58888
|
+
*/
|
|
58889
|
+
defaultTransmitterId: number().int().nonnegative().nullable().default(null),
|
|
58890
|
+
/** Keyed by role. A role with no entry falls back to the native cap. */
|
|
58891
|
+
bindings: record(string(), RemoteBindingSchema),
|
|
58892
|
+
customButtons: array(RemoteCustomButtonSchema).max(100),
|
|
58893
|
+
power: object({ mode: RemotePowerModeSchema })
|
|
58894
|
+
}).superRefine((config, ctx) => {
|
|
58895
|
+
const roles = Object.keys(config.bindings);
|
|
58896
|
+
if (roles.length > 200) ctx.addIssue({
|
|
58897
|
+
code: "custom",
|
|
58898
|
+
message: "too many bindings",
|
|
58899
|
+
path: ["bindings"]
|
|
58900
|
+
});
|
|
58901
|
+
for (const role of roles) if (!isRemoteRole(role)) ctx.addIssue({
|
|
58902
|
+
code: "custom",
|
|
58903
|
+
message: `"${role}" is not a role`,
|
|
58904
|
+
path: ["bindings", role]
|
|
58905
|
+
});
|
|
58906
|
+
const keys = /* @__PURE__ */ new Set();
|
|
58907
|
+
config.customButtons.forEach((button, index) => {
|
|
58908
|
+
if (keys.has(button.key)) ctx.addIssue({
|
|
58909
|
+
code: "custom",
|
|
58910
|
+
message: `custom button "${button.key}" is listed twice`,
|
|
58911
|
+
path: [
|
|
58912
|
+
"customButtons",
|
|
58913
|
+
index,
|
|
58914
|
+
"key"
|
|
58915
|
+
]
|
|
58916
|
+
});
|
|
58917
|
+
keys.add(button.key);
|
|
58918
|
+
});
|
|
58919
|
+
for (const role of roles) {
|
|
58920
|
+
const key = customKeyOfRole(role);
|
|
58921
|
+
if (key !== null && !keys.has(key)) ctx.addIssue({
|
|
58922
|
+
code: "custom",
|
|
58923
|
+
message: `${role} is bound but has no entry in customButtons`,
|
|
58924
|
+
path: ["bindings", role]
|
|
58925
|
+
});
|
|
58926
|
+
}
|
|
58927
|
+
});
|
|
58928
|
+
object({
|
|
58929
|
+
power: object({
|
|
58930
|
+
state: _enum(["on", "off"]),
|
|
58931
|
+
at: number()
|
|
58932
|
+
}).nullable(),
|
|
58933
|
+
muted: object({
|
|
58934
|
+
value: boolean(),
|
|
58935
|
+
at: number()
|
|
58936
|
+
}).nullable()
|
|
58937
|
+
});
|
|
58938
|
+
var RemoteLayoutButtonSchema = object({
|
|
58939
|
+
id: string().min(1).max(40),
|
|
58940
|
+
/** 0-based grid position. */
|
|
58941
|
+
row: number().int().min(0).max(24),
|
|
58942
|
+
col: number().int().min(0).max(24),
|
|
58943
|
+
rowSpan: number().int().min(1).max(24),
|
|
58944
|
+
colSpan: number().int().min(1).max(24),
|
|
58945
|
+
icon: string().min(1).max(60).optional(),
|
|
58946
|
+
label: string().min(1).max(40).optional(),
|
|
58947
|
+
role: RemoteRoleSchema
|
|
58948
|
+
});
|
|
58949
|
+
object({
|
|
58950
|
+
columns: number().int().min(1).max(24),
|
|
58951
|
+
rows: number().int().min(1).max(24),
|
|
58952
|
+
buttons: array(RemoteLayoutButtonSchema).max(200)
|
|
58953
|
+
}).superRefine((grid, ctx) => {
|
|
58954
|
+
const ids = /* @__PURE__ */ new Set();
|
|
58955
|
+
const taken = /* @__PURE__ */ new Map();
|
|
58956
|
+
grid.buttons.forEach((button, index) => {
|
|
58957
|
+
if (ids.has(button.id)) ctx.addIssue({
|
|
58958
|
+
code: "custom",
|
|
58959
|
+
message: `button id "${button.id}" is used twice`,
|
|
58960
|
+
path: [
|
|
58961
|
+
"buttons",
|
|
58962
|
+
index,
|
|
58963
|
+
"id"
|
|
58964
|
+
]
|
|
58965
|
+
});
|
|
58966
|
+
ids.add(button.id);
|
|
58967
|
+
if (button.row + button.rowSpan > grid.rows || button.col + button.colSpan > grid.columns) {
|
|
58968
|
+
ctx.addIssue({
|
|
58969
|
+
code: "custom",
|
|
58970
|
+
message: `button "${button.id}" leaves the grid`,
|
|
58971
|
+
path: ["buttons", index]
|
|
58972
|
+
});
|
|
58973
|
+
return;
|
|
58974
|
+
}
|
|
58975
|
+
for (let r = button.row; r < button.row + button.rowSpan; r += 1) for (let c = button.col; c < button.col + button.colSpan; c += 1) {
|
|
58976
|
+
const cell = `${r}:${c}`;
|
|
58977
|
+
const other = taken.get(cell);
|
|
58978
|
+
if (other !== void 0) {
|
|
58979
|
+
ctx.addIssue({
|
|
58980
|
+
code: "custom",
|
|
58981
|
+
message: `buttons "${other}" and "${button.id}" overlap`,
|
|
58982
|
+
path: ["buttons", index]
|
|
58983
|
+
});
|
|
58984
|
+
return;
|
|
58985
|
+
}
|
|
58986
|
+
taken.set(cell, button.id);
|
|
58987
|
+
}
|
|
58988
|
+
});
|
|
58989
|
+
});
|
|
58990
|
+
var RemoteBoundCommandSchema = object({
|
|
58991
|
+
role: RemoteRoleSchema,
|
|
58992
|
+
/** The operator's name for a custom button; absent for a known role. */
|
|
58993
|
+
label: string().optional(),
|
|
58994
|
+
custom: boolean()
|
|
58995
|
+
});
|
|
58996
|
+
var RemoteCommandListSchema = object({
|
|
58997
|
+
layoutTemplateId: string().nullable(),
|
|
58998
|
+
power: object({ mode: RemotePowerModeSchema }),
|
|
58999
|
+
/** Only the roles that are BOUND — the ones a press can reach. */
|
|
59000
|
+
commands: array(RemoteBoundCommandSchema)
|
|
59001
|
+
});
|
|
59002
|
+
var RemoteRefusalReasonSchema = _enum([
|
|
59003
|
+
"no-remote",
|
|
59004
|
+
"unbound-role",
|
|
59005
|
+
"action-failed"
|
|
59006
|
+
]);
|
|
59007
|
+
var RemoteSendResultSchema = discriminatedUnion("status", [
|
|
59008
|
+
object({
|
|
59009
|
+
status: literal("sent"),
|
|
59010
|
+
/** How many times the action ran. */
|
|
59011
|
+
sends: number().int().min(1)
|
|
59012
|
+
}),
|
|
59013
|
+
object({
|
|
59014
|
+
status: literal("skipped"),
|
|
59015
|
+
reason: literal("already-in-state")
|
|
59016
|
+
}),
|
|
59017
|
+
object({
|
|
59018
|
+
status: literal("refused"),
|
|
59019
|
+
reason: RemoteRefusalReasonSchema,
|
|
59020
|
+
detail: string().optional()
|
|
59021
|
+
})
|
|
59022
|
+
]);
|
|
59023
|
+
var RemoteMediaCommandSchema = _enum([
|
|
59024
|
+
"play",
|
|
59025
|
+
"pause",
|
|
59026
|
+
"stop",
|
|
59027
|
+
"next",
|
|
59028
|
+
"previous",
|
|
59029
|
+
"setMute",
|
|
59030
|
+
"selectSource"
|
|
59031
|
+
]);
|
|
59032
|
+
/** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
|
|
59033
|
+
var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
|
|
59034
|
+
var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status: literal("saved") }), object({
|
|
59035
|
+
status: literal("refused"),
|
|
59036
|
+
reason: _enum(["unknown-template", "not-a-media-player"]),
|
|
59037
|
+
detail: string()
|
|
59038
|
+
})]);
|
|
59039
|
+
var deviceInput = object({ deviceId: number().int().nonnegative() });
|
|
59040
|
+
DeviceType.MediaPlayer;
|
|
59041
|
+
method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
|
|
59042
|
+
kind: "mutation",
|
|
59043
|
+
auth: "admin"
|
|
59044
|
+
}), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
|
|
59045
|
+
role: RemoteRoleSchema,
|
|
59046
|
+
/** Sends in a row (volume steps). */
|
|
59047
|
+
repeat: number().int().min(1).max(50).default(1)
|
|
59048
|
+
}), RemoteSendResultSchema, {
|
|
59049
|
+
kind: "mutation",
|
|
59050
|
+
auth: "protected"
|
|
59051
|
+
}), method(deviceInput.extend({
|
|
59052
|
+
command: RemoteMediaCommandSchema,
|
|
59053
|
+
muted: boolean().optional(),
|
|
59054
|
+
source: string().optional(),
|
|
59055
|
+
repeat: number().int().min(1).max(50).default(1)
|
|
59056
|
+
}), RemoteMediaCommandResultSchema, {
|
|
59057
|
+
kind: "mutation",
|
|
59058
|
+
auth: "protected"
|
|
59059
|
+
});
|
|
59060
|
+
var TemplateKindSchema = _enum(["remote"]);
|
|
59061
|
+
/**
|
|
59062
|
+
* template — the generic store of reusable, named operator data (D963). A
|
|
59063
|
+
* record is `{ id, kind, name, payload }`; the kinds (today only `remote`, the
|
|
59064
|
+
* button grid of a remote) and the schema each payload must satisfy are
|
|
59065
|
+
* declared by the system in `template-kinds.ts`. Nothing here is specific to a
|
|
59066
|
+
* kind: the engine validates a payload against its kind's schema and, on a
|
|
59067
|
+
* delete, asks the kind's owner whether anything still points at the record.
|
|
59068
|
+
*
|
|
59069
|
+
* Every refusal is a typed result — a UI says "unknown kind" or names the
|
|
59070
|
+
* devices that still use a template, without parsing text.
|
|
59071
|
+
*/
|
|
59072
|
+
var TemplateRecordSchema = object({
|
|
59073
|
+
id: string().min(1),
|
|
59074
|
+
kind: TemplateKindSchema,
|
|
59075
|
+
name: string().min(1).max(120),
|
|
59076
|
+
/** Shaped by the kind; `checkTemplatePayload(kind, payload)` reads it. */
|
|
59077
|
+
payload: unknown(),
|
|
59078
|
+
createdAt: number(),
|
|
59079
|
+
updatedAt: number()
|
|
59080
|
+
});
|
|
59081
|
+
var TemplateWriteResultSchema = discriminatedUnion("status", [object({
|
|
59082
|
+
status: literal("saved"),
|
|
59083
|
+
template: TemplateRecordSchema
|
|
59084
|
+
}), object({
|
|
59085
|
+
status: literal("refused"),
|
|
59086
|
+
reason: _enum(["invalid-payload", "not-found"]),
|
|
59087
|
+
detail: string()
|
|
59088
|
+
})]);
|
|
59089
|
+
/** A device still pointing at a template. */
|
|
59090
|
+
var TemplateUserSchema = object({
|
|
59091
|
+
deviceId: number().int().nonnegative(),
|
|
59092
|
+
name: string()
|
|
59093
|
+
});
|
|
59094
|
+
var TemplateDeleteResultSchema = discriminatedUnion("status", [
|
|
59095
|
+
object({ status: literal("deleted") }),
|
|
59096
|
+
object({ status: literal("not-found") }),
|
|
59097
|
+
object({
|
|
59098
|
+
status: literal("in-use"),
|
|
59099
|
+
devices: array(TemplateUserSchema).min(1)
|
|
59100
|
+
})
|
|
59101
|
+
]);
|
|
59102
|
+
method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSchema), { auth: "protected" }), method(object({ id: string().min(1) }), TemplateRecordSchema.nullable(), { auth: "protected" }), method(object({
|
|
59103
|
+
kind: TemplateKindSchema,
|
|
59104
|
+
name: string().min(1).max(120),
|
|
59105
|
+
payload: unknown()
|
|
59106
|
+
}), TemplateWriteResultSchema, {
|
|
59107
|
+
kind: "mutation",
|
|
59108
|
+
auth: "admin"
|
|
59109
|
+
}), method(object({
|
|
59110
|
+
id: string().min(1),
|
|
59111
|
+
name: string().min(1).max(120).optional(),
|
|
59112
|
+
payload: unknown().optional()
|
|
59113
|
+
}), TemplateWriteResultSchema, {
|
|
59114
|
+
kind: "mutation",
|
|
59115
|
+
auth: "admin"
|
|
59116
|
+
}), method(object({ id: string().min(1) }), TemplateDeleteResultSchema, {
|
|
59117
|
+
kind: "mutation",
|
|
59118
|
+
auth: "admin"
|
|
59119
|
+
});
|
|
57993
59120
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
57994
59121
|
kind: "mutation",
|
|
57995
59122
|
auth: "protected"
|
|
57996
59123
|
});
|
|
57997
59124
|
/**
|
|
59125
|
+
* A pulse train in signed microseconds: mark (+) first, then space (-), strictly
|
|
59126
|
+
* alternating, no zeros, 2..1024 entries.
|
|
59127
|
+
*/
|
|
59128
|
+
var IrTimingsSchema = array(number().int()).min(2).max(1024).superRefine((timings, ctx) => {
|
|
59129
|
+
timings.forEach((value, index) => {
|
|
59130
|
+
const expectMark = index % 2 === 0;
|
|
59131
|
+
if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
|
|
59132
|
+
code: "custom",
|
|
59133
|
+
message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
|
|
59134
|
+
path: [index]
|
|
59135
|
+
});
|
|
59136
|
+
});
|
|
59137
|
+
});
|
|
59138
|
+
/** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
|
|
59139
|
+
var TransmitSettingsSchema = object({
|
|
59140
|
+
carrierHz: number().int().positive().optional(),
|
|
59141
|
+
dutyCyclePercent: number().int().min(1).max(100).optional(),
|
|
59142
|
+
repeat: number().int().min(0).max(20).optional(),
|
|
59143
|
+
repeatDelayMs: number().int().min(0).optional()
|
|
59144
|
+
});
|
|
59145
|
+
/** The setting keys a transmitter may declare as settable (`getInfo.settable`). */
|
|
59146
|
+
var TransmitSettingKeySchema = _enum([
|
|
59147
|
+
"carrierHz",
|
|
59148
|
+
"dutyCyclePercent",
|
|
59149
|
+
"repeat",
|
|
59150
|
+
"repeatDelayMs"
|
|
59151
|
+
]);
|
|
59152
|
+
var IrMediumSchema = _enum(["ir", "rf"]);
|
|
59153
|
+
var IrSendResultSchema = object({
|
|
59154
|
+
ok: literal(true),
|
|
59155
|
+
/** Settings the transmitter could not apply; the train was still sent. */
|
|
59156
|
+
ignoredSettings: array(string())
|
|
59157
|
+
});
|
|
59158
|
+
var IrTransmitterInfoSchema = object({
|
|
59159
|
+
media: array(IrMediumSchema),
|
|
59160
|
+
settable: array(TransmitSettingKeySchema),
|
|
59161
|
+
maxTimings: number().int().positive()
|
|
59162
|
+
});
|
|
59163
|
+
DeviceType.Generic, method(object({
|
|
59164
|
+
deviceId: number().int().nonnegative(),
|
|
59165
|
+
timings: IrTimingsSchema,
|
|
59166
|
+
settings: TransmitSettingsSchema.optional()
|
|
59167
|
+
}), IrSendResultSchema, {
|
|
59168
|
+
kind: "mutation",
|
|
59169
|
+
auth: "protected"
|
|
59170
|
+
}), method(object({ deviceId: number().int().nonnegative() }), IrTransmitterInfoSchema, {
|
|
59171
|
+
kind: "query",
|
|
59172
|
+
auth: "protected"
|
|
59173
|
+
});
|
|
59174
|
+
/**
|
|
57998
59175
|
* `calendar-source` — collection cap exposing per-provider calendars and
|
|
57999
59176
|
* their events. Every addon that contributes calendars (Home Assistant,
|
|
58000
59177
|
* a future Google Calendar addon, …) registers a provider here. The hub
|
|
@@ -58492,11 +59669,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
58492
59669
|
}),
|
|
58493
59670
|
object({
|
|
58494
59671
|
mode: literal("mired"),
|
|
58495
|
-
|
|
59672
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
58496
59673
|
})
|
|
58497
59674
|
]);
|
|
58498
59675
|
object({
|
|
58499
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
59676
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
58500
59677
|
* the bulb's current state. */
|
|
58501
59678
|
mode: _enum([
|
|
58502
59679
|
"rgb",
|
|
@@ -58508,7 +59685,7 @@ object({
|
|
|
58508
59685
|
/** Populated when `mode === 'hsv'`. */
|
|
58509
59686
|
hsv: HsvTripletSchema.optional(),
|
|
58510
59687
|
/** Populated when `mode === 'mired'`. */
|
|
58511
|
-
|
|
59688
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
58512
59689
|
/** Ms epoch of the last operator-driven change. */
|
|
58513
59690
|
lastChangedAt: number()
|
|
58514
59691
|
});
|
|
@@ -58527,7 +59704,7 @@ DeviceType.Light, method(object({
|
|
|
58527
59704
|
]),
|
|
58528
59705
|
rgb: RgbTripletSchema.optional(),
|
|
58529
59706
|
hsv: HsvTripletSchema.optional(),
|
|
58530
|
-
|
|
59707
|
+
colorTemperature: number().int().optional(),
|
|
58531
59708
|
lastChangedAt: number()
|
|
58532
59709
|
});
|
|
58533
59710
|
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
@@ -58965,11 +60142,11 @@ object({
|
|
|
58965
60142
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
58966
60143
|
availablePrograms: array(string()),
|
|
58967
60144
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
58968
|
-
|
|
60145
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58969
60146
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
58970
|
-
|
|
60147
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58971
60148
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
58972
|
-
|
|
60149
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58973
60150
|
/** True when the door is reported open; null when the door state is not known. */
|
|
58974
60151
|
doorOpen: boolean().nullable(),
|
|
58975
60152
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -59014,7 +60191,7 @@ object({
|
|
|
59014
60191
|
/** Ms epoch of the last value received from the appliance; 0 = never. */
|
|
59015
60192
|
lastFetchedAt: number()
|
|
59016
60193
|
});
|
|
59017
|
-
var DeviceIdSchema = number().int().nonnegative();
|
|
60194
|
+
var DeviceIdSchema$1 = number().int().nonnegative();
|
|
59018
60195
|
/** A value a program option or setting can take. */
|
|
59019
60196
|
var DishwasherValueSchema = union([
|
|
59020
60197
|
boolean(),
|
|
@@ -59078,77 +60255,77 @@ var DishwasherOptionsSchema = object({
|
|
|
59078
60255
|
options: array(DishwasherOptionDescriptorSchema)
|
|
59079
60256
|
});
|
|
59080
60257
|
DeviceType.Dishwasher, method(object({
|
|
59081
|
-
deviceId: DeviceIdSchema,
|
|
60258
|
+
deviceId: DeviceIdSchema$1,
|
|
59082
60259
|
program: string().min(1).optional(),
|
|
59083
60260
|
options: record(string(), DishwasherValueSchema).optional()
|
|
59084
60261
|
}), _void(), {
|
|
59085
60262
|
kind: "mutation",
|
|
59086
60263
|
auth: "protected"
|
|
59087
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60264
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59088
60265
|
kind: "mutation",
|
|
59089
60266
|
auth: "protected"
|
|
59090
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60267
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59091
60268
|
kind: "mutation",
|
|
59092
60269
|
auth: "protected"
|
|
59093
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60270
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59094
60271
|
kind: "mutation",
|
|
59095
60272
|
auth: "protected"
|
|
59096
60273
|
}), method(object({
|
|
59097
|
-
deviceId: DeviceIdSchema,
|
|
60274
|
+
deviceId: DeviceIdSchema$1,
|
|
59098
60275
|
program: string().min(1)
|
|
59099
60276
|
}), _void(), {
|
|
59100
60277
|
kind: "mutation",
|
|
59101
60278
|
auth: "protected"
|
|
59102
60279
|
}), method(object({
|
|
59103
|
-
deviceId: DeviceIdSchema,
|
|
60280
|
+
deviceId: DeviceIdSchema$1,
|
|
59104
60281
|
on: boolean()
|
|
59105
60282
|
}), _void(), {
|
|
59106
60283
|
kind: "mutation",
|
|
59107
60284
|
auth: "protected"
|
|
59108
60285
|
}), method(object({
|
|
59109
|
-
deviceId: DeviceIdSchema,
|
|
60286
|
+
deviceId: DeviceIdSchema$1,
|
|
59110
60287
|
on: boolean()
|
|
59111
60288
|
}), _void(), {
|
|
59112
60289
|
kind: "mutation",
|
|
59113
60290
|
auth: "protected"
|
|
59114
60291
|
}), method(object({
|
|
59115
|
-
deviceId: DeviceIdSchema,
|
|
60292
|
+
deviceId: DeviceIdSchema$1,
|
|
59116
60293
|
on: boolean()
|
|
59117
60294
|
}), _void(), {
|
|
59118
60295
|
kind: "mutation",
|
|
59119
60296
|
auth: "protected"
|
|
59120
60297
|
}), method(object({
|
|
59121
|
-
deviceId: DeviceIdSchema,
|
|
60298
|
+
deviceId: DeviceIdSchema$1,
|
|
59122
60299
|
on: boolean()
|
|
59123
60300
|
}), _void(), {
|
|
59124
60301
|
kind: "mutation",
|
|
59125
60302
|
auth: "protected"
|
|
59126
60303
|
}), method(object({
|
|
59127
|
-
deviceId: DeviceIdSchema,
|
|
60304
|
+
deviceId: DeviceIdSchema$1,
|
|
59128
60305
|
on: boolean()
|
|
59129
60306
|
}), _void(), {
|
|
59130
60307
|
kind: "mutation",
|
|
59131
60308
|
auth: "protected"
|
|
59132
60309
|
}), method(object({
|
|
59133
|
-
deviceId: DeviceIdSchema,
|
|
60310
|
+
deviceId: DeviceIdSchema$1,
|
|
59134
60311
|
on: boolean()
|
|
59135
60312
|
}), _void(), {
|
|
59136
60313
|
kind: "mutation",
|
|
59137
60314
|
auth: "protected"
|
|
59138
60315
|
}), method(object({
|
|
59139
|
-
deviceId: DeviceIdSchema,
|
|
60316
|
+
deviceId: DeviceIdSchema$1,
|
|
59140
60317
|
on: boolean()
|
|
59141
60318
|
}), _void(), {
|
|
59142
60319
|
kind: "mutation",
|
|
59143
60320
|
auth: "protected"
|
|
59144
60321
|
}), method(object({
|
|
59145
|
-
deviceId: DeviceIdSchema,
|
|
60322
|
+
deviceId: DeviceIdSchema$1,
|
|
59146
60323
|
key: string().min(1),
|
|
59147
60324
|
value: DishwasherValueSchema
|
|
59148
60325
|
}), _void(), {
|
|
59149
60326
|
kind: "mutation",
|
|
59150
60327
|
auth: "protected"
|
|
59151
|
-
}), method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" });
|
|
60328
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
|
|
59152
60329
|
DeviceType.Camera;
|
|
59153
60330
|
object({
|
|
59154
60331
|
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
@@ -59587,7 +60764,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
59587
60764
|
object({
|
|
59588
60765
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
59589
60766
|
* speed surface (single-speed fan). */
|
|
59590
|
-
|
|
60767
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59591
60768
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
59592
60769
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
59593
60770
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -59607,7 +60784,7 @@ object({
|
|
|
59607
60784
|
});
|
|
59608
60785
|
DeviceType.Fan, method(object({
|
|
59609
60786
|
deviceId: number().int().nonnegative(),
|
|
59610
|
-
|
|
60787
|
+
speed: number().min(0).max(100)
|
|
59611
60788
|
}), _void(), {
|
|
59612
60789
|
kind: "mutation",
|
|
59613
60790
|
auth: "protected"
|
|
@@ -59806,7 +60983,7 @@ DeviceType.Humidifier, method(object({
|
|
|
59806
60983
|
*/
|
|
59807
60984
|
var HumiditySensorStatusSchema = object({
|
|
59808
60985
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
59809
|
-
|
|
60986
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
59810
60987
|
precision: 0,
|
|
59811
60988
|
label: "Humidity"
|
|
59812
60989
|
})),
|
|
@@ -60249,7 +61426,7 @@ object({
|
|
|
60249
61426
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60250
61427
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
60251
61428
|
* task is active / progress is unavailable. */
|
|
60252
|
-
|
|
61429
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60253
61430
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
60254
61431
|
* or null when unknown. */
|
|
60255
61432
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -60721,9 +61898,35 @@ var MediaInfoSchema = object({
|
|
|
60721
61898
|
/** Optional cover-art / thumbnail URL. */
|
|
60722
61899
|
imageUrl: string().optional()
|
|
60723
61900
|
});
|
|
61901
|
+
/**
|
|
61902
|
+
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
61903
|
+
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
61904
|
+
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
61905
|
+
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
61906
|
+
* guess, never as a reading.
|
|
61907
|
+
*/
|
|
61908
|
+
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
61909
|
+
/** The fields of a media-player status a driver can only guess. */
|
|
61910
|
+
var MediaPlayerAssumedFieldSchema = _enum([
|
|
61911
|
+
"state",
|
|
61912
|
+
"volumeLevel",
|
|
61913
|
+
"isMuted",
|
|
61914
|
+
"source"
|
|
61915
|
+
]);
|
|
60724
61916
|
object({
|
|
60725
61917
|
/** Playback lifecycle state. */
|
|
60726
61918
|
state: MediaPlayerStateSchema,
|
|
61919
|
+
/**
|
|
61920
|
+
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
61921
|
+
* A slice written before this field existed parses as `reported`.
|
|
61922
|
+
*/
|
|
61923
|
+
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
61924
|
+
/**
|
|
61925
|
+
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
61926
|
+
* this is not empty; a field not listed here is a reading even then (power
|
|
61927
|
+
* from a running-state source, mute guessed from the last send).
|
|
61928
|
+
*/
|
|
61929
|
+
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
60727
61930
|
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
60728
61931
|
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
60729
61932
|
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -60739,10 +61942,10 @@ object({
|
|
|
60739
61942
|
currentMedia: MediaInfoSchema.nullable(),
|
|
60740
61943
|
/** Current playback position in ms. Null when not seekable or
|
|
60741
61944
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
60742
|
-
|
|
61945
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
60743
61946
|
/** Total duration of the current media in ms. Null when unknown
|
|
60744
61947
|
* (live stream) or nothing is playing. */
|
|
60745
|
-
|
|
61948
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
60746
61949
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
60747
61950
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
60748
61951
|
shuffle: boolean().nullable(),
|
|
@@ -60769,7 +61972,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
|
|
|
60769
61972
|
auth: "protected"
|
|
60770
61973
|
}), method(object({
|
|
60771
61974
|
deviceId: number().int().nonnegative(),
|
|
60772
|
-
|
|
61975
|
+
position: number().int().nonnegative()
|
|
60773
61976
|
}), _void(), {
|
|
60774
61977
|
kind: "mutation",
|
|
60775
61978
|
auth: "protected"
|
|
@@ -61442,9 +62645,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
61442
62645
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
61443
62646
|
* SKIP a null rather than coerce it.
|
|
61444
62647
|
*/
|
|
61445
|
-
|
|
62648
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61446
62649
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
61447
|
-
|
|
62650
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
61448
62651
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
61449
62652
|
ssid: string().optional(),
|
|
61450
62653
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -61576,7 +62779,8 @@ var TopologyNodeSchema = object({
|
|
|
61576
62779
|
isHub: boolean(),
|
|
61577
62780
|
isOnline: boolean(),
|
|
61578
62781
|
cpuPercent: number(),
|
|
61579
|
-
|
|
62782
|
+
/** `null` when the node's memory read failed or it has not reported one (D393). */
|
|
62783
|
+
memoryPercent: number().nullable(),
|
|
61580
62784
|
uptime: number(),
|
|
61581
62785
|
lastSeen: string(),
|
|
61582
62786
|
localIps: array(string()).readonly(),
|
|
@@ -62105,10 +63309,21 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
62105
63309
|
]);
|
|
62106
63310
|
var gramsPortion = number().int().min(4).max(200);
|
|
62107
63311
|
object({
|
|
62108
|
-
/** Food
|
|
62109
|
-
*
|
|
62110
|
-
* bowl
|
|
63312
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
63313
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
63314
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
63315
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
63316
|
+
* the device has not reported yet. */
|
|
62111
63317
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
63318
|
+
/** Food in the BOWL, a mass (stored in kilograms, D944). Reported only by a
|
|
63319
|
+
* feeder with a bowl scale; null when the model has none or its reading is
|
|
63320
|
+
* of an unproven unit. */
|
|
63321
|
+
bowlFood: number().nullable().meta(readingMeta("mass")),
|
|
63322
|
+
/** True while the pet is eating (`state.eating`). */
|
|
63323
|
+
eating: boolean(),
|
|
63324
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
63325
|
+
* the client must not offer it. */
|
|
63326
|
+
supportsMarkRefilled: boolean(),
|
|
62112
63327
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
62113
63328
|
* single-hopper models. */
|
|
62114
63329
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -62116,12 +63331,17 @@ object({
|
|
|
62116
63331
|
* single-hopper models. */
|
|
62117
63332
|
food2: number().nullable().meta(readingMeta("none")),
|
|
62118
63333
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
62119
|
-
* (`device_class: problem`, on = low). True when the
|
|
62120
|
-
*
|
|
63334
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
63335
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
62121
63336
|
lowFood: boolean(),
|
|
62122
|
-
/** Battery charge 0..100 (%).
|
|
62123
|
-
*
|
|
63337
|
+
/** Battery charge 0..100 (%). On a feeder running on `mains` this is the
|
|
63338
|
+
* BACKUP battery's charge, not the power source. Null when the device has
|
|
63339
|
+
* no battery reading. */
|
|
62124
63340
|
batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
63341
|
+
/** What the feeder is powered from right now: `mains` (plugged in, the
|
|
63342
|
+
* battery is only a backup) or `battery`. Null when the device does not
|
|
63343
|
+
* report it. */
|
|
63344
|
+
powerSource: _enum(["mains", "battery"]).nullable(),
|
|
62125
63345
|
/**
|
|
62126
63346
|
* Desiccant life remaining, stored in seconds (duration base, D944).
|
|
62127
63347
|
* Providers convert from the days the feeder reports. Null when the
|
|
@@ -62149,6 +63369,14 @@ object({
|
|
|
62149
63369
|
feedSound: boolean(),
|
|
62150
63370
|
/** Speaker / prompt volume level (device-scaled integer). */
|
|
62151
63371
|
volume: number().meta(readingMeta("none")),
|
|
63372
|
+
/** Portion (grams) of the last manual feed sent from a single-hopper
|
|
63373
|
+
* stepper — the default the next manual feed starts from. Persisted per
|
|
63374
|
+
* device by the provider; null until a manual feed has been sent. */
|
|
63375
|
+
lastFeedGrams: gramsPortion.nullable(),
|
|
63376
|
+
/** Hopper-1 portion of the last manual feed (dual-hopper); null until sent. */
|
|
63377
|
+
lastFeedHopper1: gramsPortion.nullable(),
|
|
63378
|
+
/** Hopper-2 portion of the last manual feed (dual-hopper); null until sent. */
|
|
63379
|
+
lastFeedHopper2: gramsPortion.nullable(),
|
|
62152
63380
|
/** Ms epoch when the slice was last refreshed from the cloud. */
|
|
62153
63381
|
lastFetchedAt: number()
|
|
62154
63382
|
});
|
|
@@ -62203,6 +63431,64 @@ DeviceType.PetFeeder, method(object({
|
|
|
62203
63431
|
kind: "mutation",
|
|
62204
63432
|
auth: "protected"
|
|
62205
63433
|
});
|
|
63434
|
+
object({
|
|
63435
|
+
/** Water in the tank, 0..100 (%). Null while the source has not reported. */
|
|
63436
|
+
waterLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
63437
|
+
/** Water in the tank, in litres. Null while the source has not reported. */
|
|
63438
|
+
waterVolume: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63439
|
+
/** True when the tank is empty. Null while unknown. */
|
|
63440
|
+
empty: boolean().nullable(),
|
|
63441
|
+
/** True while the pump is running. Null while unknown. */
|
|
63442
|
+
pumpRunning: boolean().nullable(),
|
|
63443
|
+
/** True when the pump works on an on/off duty cycle rather than continuously. */
|
|
63444
|
+
pumpIntervalEnabled: boolean().nullable(),
|
|
63445
|
+
/** How long the pump runs per cycle, in seconds. */
|
|
63446
|
+
pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
63447
|
+
/** How long the pump rests per cycle, in seconds. */
|
|
63448
|
+
pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
63449
|
+
/** Water drunk in the last drink, in litres. */
|
|
63450
|
+
lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63451
|
+
/** Water drunk in the current hour, in litres. */
|
|
63452
|
+
currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63453
|
+
/** Water drunk over the last 24 hours (rolling), in litres. */
|
|
63454
|
+
last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63455
|
+
/** Water drunk since local midnight, in litres. */
|
|
63456
|
+
todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63457
|
+
/** Decoded fault message. Null means healthy; a non-null string is an active fault. */
|
|
63458
|
+
error: string().nullable(),
|
|
63459
|
+
/** Ms epoch when the slice was last refreshed. */
|
|
63460
|
+
lastFetchedAt: number()
|
|
63461
|
+
});
|
|
63462
|
+
var DeviceIdSchema = number().int().nonnegative();
|
|
63463
|
+
var MinutesSchema = number().int().min(0);
|
|
63464
|
+
DeviceType.PetFountain, method(object({
|
|
63465
|
+
deviceId: DeviceIdSchema,
|
|
63466
|
+
on: boolean()
|
|
63467
|
+
}), _void(), {
|
|
63468
|
+
kind: "mutation",
|
|
63469
|
+
auth: "protected"
|
|
63470
|
+
}), method(object({
|
|
63471
|
+
deviceId: DeviceIdSchema,
|
|
63472
|
+
on: boolean()
|
|
63473
|
+
}), _void(), {
|
|
63474
|
+
kind: "mutation",
|
|
63475
|
+
auth: "protected"
|
|
63476
|
+
}), method(object({
|
|
63477
|
+
deviceId: DeviceIdSchema,
|
|
63478
|
+
minutes: MinutesSchema
|
|
63479
|
+
}), _void(), {
|
|
63480
|
+
kind: "mutation",
|
|
63481
|
+
auth: "protected"
|
|
63482
|
+
}), method(object({
|
|
63483
|
+
deviceId: DeviceIdSchema,
|
|
63484
|
+
minutes: MinutesSchema
|
|
63485
|
+
}), _void(), {
|
|
63486
|
+
kind: "mutation",
|
|
63487
|
+
auth: "protected"
|
|
63488
|
+
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
63489
|
+
kind: "mutation",
|
|
63490
|
+
auth: "protected"
|
|
63491
|
+
});
|
|
62206
63492
|
var VehicleSchema = object({
|
|
62207
63493
|
id: string(),
|
|
62208
63494
|
name: string(),
|
|
@@ -62584,16 +63870,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
62584
63870
|
auth: "admin"
|
|
62585
63871
|
});
|
|
62586
63872
|
object({
|
|
62587
|
-
/** Instantaneous power draw
|
|
62588
|
-
|
|
63873
|
+
/** Instantaneous power draw (watts). */
|
|
63874
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
62589
63875
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
62590
|
-
|
|
62591
|
-
/** Voltage
|
|
62592
|
-
|
|
63876
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
63877
|
+
/** Voltage (volts). */
|
|
63878
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
62593
63879
|
/** Current in amperes. */
|
|
62594
|
-
|
|
63880
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
62595
63881
|
/** Apparent power in volt-amperes. */
|
|
62596
|
-
|
|
63882
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
62597
63883
|
/** Power factor (0..1) if reported. */
|
|
62598
63884
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
62599
63885
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -62648,16 +63934,13 @@ var PresenceStatusSchema = object({
|
|
|
62648
63934
|
location: string().nullable(),
|
|
62649
63935
|
/** GPS coordinates when available. Null otherwise. */
|
|
62650
63936
|
gps: GpsLocationSchema.nullable(),
|
|
62651
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
62652
|
-
* when not reported. */
|
|
62653
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62654
63937
|
/** Ms epoch when the slice was last updated. */
|
|
62655
63938
|
lastChangedAt: number()
|
|
62656
63939
|
});
|
|
62657
63940
|
DeviceType.Presence;
|
|
62658
63941
|
object({
|
|
62659
63942
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
62660
|
-
|
|
63943
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
62661
63944
|
/** Ms epoch when the slice was last updated. */
|
|
62662
63945
|
lastFetchedAt: number()
|
|
62663
63946
|
});
|
|
@@ -65681,7 +66964,7 @@ DeviceType.Sensor;
|
|
|
65681
66964
|
*/
|
|
65682
66965
|
var TemperatureSensorStatusSchema = object({
|
|
65683
66966
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
65684
|
-
|
|
66967
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
65685
66968
|
precision: 1,
|
|
65686
66969
|
label: "Temperature"
|
|
65687
66970
|
})),
|
|
@@ -65945,7 +67228,7 @@ object({
|
|
|
65945
67228
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
65946
67229
|
availableFanSpeeds: array(string()),
|
|
65947
67230
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
65948
|
-
|
|
67231
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
65949
67232
|
/** Current error code (0 / null = no error). */
|
|
65950
67233
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
65951
67234
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -66814,9 +68097,17 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
66814
68097
|
kind: "mutation",
|
|
66815
68098
|
auth: "admin"
|
|
66816
68099
|
});
|
|
68100
|
+
discriminatedUnion("kind", [object({
|
|
68101
|
+
kind: literal("raw"),
|
|
68102
|
+
timings: array(number().int()),
|
|
68103
|
+
settings: TransmitSettingsSchema.optional()
|
|
68104
|
+
}), object({
|
|
68105
|
+
kind: literal("pronto"),
|
|
68106
|
+
code: string()
|
|
68107
|
+
})]);
|
|
66817
68108
|
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
66818
68109
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
66819
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
68110
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
66820
68111
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
66821
68112
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
66822
68113
|
new Set(CAP_NAMES);
|
|
@@ -66869,7 +68160,7 @@ var AccessoryKind = {
|
|
|
66869
68160
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
66870
68161
|
};
|
|
66871
68162
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
66872
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
68163
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
66873
68164
|
new Set(Object.values(DeviceType));
|
|
66874
68165
|
Object.freeze({
|
|
66875
68166
|
"accessories.getStatus": {
|
|
@@ -66886,6 +68177,104 @@ Object.freeze({
|
|
|
66886
68177
|
access: "create",
|
|
66887
68178
|
role: "admin"
|
|
66888
68179
|
},
|
|
68180
|
+
"actions.create": {
|
|
68181
|
+
capName: "actions",
|
|
68182
|
+
capScope: "system",
|
|
68183
|
+
addonId: null,
|
|
68184
|
+
access: "create",
|
|
68185
|
+
role: "admin"
|
|
68186
|
+
},
|
|
68187
|
+
"actions.delete": {
|
|
68188
|
+
capName: "actions",
|
|
68189
|
+
capScope: "system",
|
|
68190
|
+
addonId: null,
|
|
68191
|
+
access: "delete",
|
|
68192
|
+
role: "admin"
|
|
68193
|
+
},
|
|
68194
|
+
"actions.get": {
|
|
68195
|
+
capName: "actions",
|
|
68196
|
+
capScope: "system",
|
|
68197
|
+
addonId: null,
|
|
68198
|
+
access: "view",
|
|
68199
|
+
role: "viewer"
|
|
68200
|
+
},
|
|
68201
|
+
"actions.getLinks": {
|
|
68202
|
+
capName: "actions",
|
|
68203
|
+
capScope: "system",
|
|
68204
|
+
addonId: null,
|
|
68205
|
+
access: "view",
|
|
68206
|
+
role: "admin"
|
|
68207
|
+
},
|
|
68208
|
+
"actions.getTraces": {
|
|
68209
|
+
capName: "actions",
|
|
68210
|
+
capScope: "system",
|
|
68211
|
+
addonId: null,
|
|
68212
|
+
access: "view",
|
|
68213
|
+
role: "admin"
|
|
68214
|
+
},
|
|
68215
|
+
"actions.list": {
|
|
68216
|
+
capName: "actions",
|
|
68217
|
+
capScope: "system",
|
|
68218
|
+
addonId: null,
|
|
68219
|
+
access: "view",
|
|
68220
|
+
role: "admin"
|
|
68221
|
+
},
|
|
68222
|
+
"actions.listForCamera": {
|
|
68223
|
+
capName: "actions",
|
|
68224
|
+
capScope: "system",
|
|
68225
|
+
addonId: null,
|
|
68226
|
+
access: "view",
|
|
68227
|
+
role: "viewer"
|
|
68228
|
+
},
|
|
68229
|
+
"actions.run": {
|
|
68230
|
+
capName: "actions",
|
|
68231
|
+
capScope: "system",
|
|
68232
|
+
addonId: null,
|
|
68233
|
+
access: "create",
|
|
68234
|
+
role: "viewer"
|
|
68235
|
+
},
|
|
68236
|
+
"actions.setLinks": {
|
|
68237
|
+
capName: "actions",
|
|
68238
|
+
capScope: "system",
|
|
68239
|
+
addonId: null,
|
|
68240
|
+
access: "create",
|
|
68241
|
+
role: "admin"
|
|
68242
|
+
},
|
|
68243
|
+
"actions.stop": {
|
|
68244
|
+
capName: "actions",
|
|
68245
|
+
capScope: "system",
|
|
68246
|
+
addonId: null,
|
|
68247
|
+
access: "create",
|
|
68248
|
+
role: "admin"
|
|
68249
|
+
},
|
|
68250
|
+
"actions.update": {
|
|
68251
|
+
capName: "actions",
|
|
68252
|
+
capScope: "system",
|
|
68253
|
+
addonId: null,
|
|
68254
|
+
access: "create",
|
|
68255
|
+
role: "admin"
|
|
68256
|
+
},
|
|
68257
|
+
"actionSource.listActions": {
|
|
68258
|
+
capName: "action-source",
|
|
68259
|
+
capScope: "system",
|
|
68260
|
+
addonId: null,
|
|
68261
|
+
access: "view",
|
|
68262
|
+
role: "admin"
|
|
68263
|
+
},
|
|
68264
|
+
"actionSource.runAction": {
|
|
68265
|
+
capName: "action-source",
|
|
68266
|
+
capScope: "system",
|
|
68267
|
+
addonId: null,
|
|
68268
|
+
access: "create",
|
|
68269
|
+
role: "admin"
|
|
68270
|
+
},
|
|
68271
|
+
"actionSource.stopAction": {
|
|
68272
|
+
capName: "action-source",
|
|
68273
|
+
capScope: "system",
|
|
68274
|
+
addonId: null,
|
|
68275
|
+
access: "create",
|
|
68276
|
+
role: "admin"
|
|
68277
|
+
},
|
|
66889
68278
|
"addonPages.listPages": {
|
|
66890
68279
|
capName: "addon-pages",
|
|
66891
68280
|
capScope: "system",
|
|
@@ -68167,6 +69556,13 @@ Object.freeze({
|
|
|
68167
69556
|
access: "view",
|
|
68168
69557
|
role: "admin"
|
|
68169
69558
|
},
|
|
69559
|
+
"coreBlocks.getAutomationRunState": {
|
|
69560
|
+
capName: "core-blocks",
|
|
69561
|
+
capScope: "system",
|
|
69562
|
+
addonId: null,
|
|
69563
|
+
access: "view",
|
|
69564
|
+
role: "admin"
|
|
69565
|
+
},
|
|
68170
69566
|
"coreBlocks.getBlockSettings": {
|
|
68171
69567
|
capName: "core-blocks",
|
|
68172
69568
|
capScope: "system",
|
|
@@ -68188,6 +69584,13 @@ Object.freeze({
|
|
|
68188
69584
|
access: "view",
|
|
68189
69585
|
role: "admin"
|
|
68190
69586
|
},
|
|
69587
|
+
"coreBlocks.getTraces": {
|
|
69588
|
+
capName: "core-blocks",
|
|
69589
|
+
capScope: "system",
|
|
69590
|
+
addonId: null,
|
|
69591
|
+
access: "view",
|
|
69592
|
+
role: "admin"
|
|
69593
|
+
},
|
|
68191
69594
|
"coreBlocks.getTypeDefs": {
|
|
68192
69595
|
capName: "core-blocks",
|
|
68193
69596
|
capScope: "system",
|
|
@@ -68223,6 +69626,13 @@ Object.freeze({
|
|
|
68223
69626
|
access: "create",
|
|
68224
69627
|
role: "admin"
|
|
68225
69628
|
},
|
|
69629
|
+
"coreBlocks.reportAutomationRun": {
|
|
69630
|
+
capName: "core-blocks",
|
|
69631
|
+
capScope: "system",
|
|
69632
|
+
addonId: null,
|
|
69633
|
+
access: "create",
|
|
69634
|
+
role: "admin"
|
|
69635
|
+
},
|
|
68226
69636
|
"coreBlocks.restart": {
|
|
68227
69637
|
capName: "core-blocks",
|
|
68228
69638
|
capScope: "system",
|
|
@@ -68685,6 +70095,13 @@ Object.freeze({
|
|
|
68685
70095
|
access: "create",
|
|
68686
70096
|
role: "admin"
|
|
68687
70097
|
},
|
|
70098
|
+
"deviceExport.exposeEntity": {
|
|
70099
|
+
capName: "device-export",
|
|
70100
|
+
capScope: "system",
|
|
70101
|
+
addonId: null,
|
|
70102
|
+
access: "create",
|
|
70103
|
+
role: "admin"
|
|
70104
|
+
},
|
|
68688
70105
|
"deviceExport.getDeviceLiveContribution": {
|
|
68689
70106
|
capName: "device-export",
|
|
68690
70107
|
capScope: "system",
|
|
@@ -68713,6 +70130,13 @@ Object.freeze({
|
|
|
68713
70130
|
access: "view",
|
|
68714
70131
|
role: "admin"
|
|
68715
70132
|
},
|
|
70133
|
+
"deviceExport.listExposedEntities": {
|
|
70134
|
+
capName: "device-export",
|
|
70135
|
+
capScope: "system",
|
|
70136
|
+
addonId: null,
|
|
70137
|
+
access: "view",
|
|
70138
|
+
role: "admin"
|
|
70139
|
+
},
|
|
68716
70140
|
"deviceExport.listSupportedDeviceKinds": {
|
|
68717
70141
|
capName: "device-export",
|
|
68718
70142
|
capScope: "system",
|
|
@@ -68720,6 +70144,13 @@ Object.freeze({
|
|
|
68720
70144
|
access: "view",
|
|
68721
70145
|
role: "admin"
|
|
68722
70146
|
},
|
|
70147
|
+
"deviceExport.listSupportedEntityKinds": {
|
|
70148
|
+
capName: "device-export",
|
|
70149
|
+
capScope: "system",
|
|
70150
|
+
addonId: null,
|
|
70151
|
+
access: "view",
|
|
70152
|
+
role: "admin"
|
|
70153
|
+
},
|
|
68723
70154
|
"deviceExport.unexposeDevice": {
|
|
68724
70155
|
capName: "device-export",
|
|
68725
70156
|
capScope: "system",
|
|
@@ -68727,6 +70158,13 @@ Object.freeze({
|
|
|
68727
70158
|
access: "create",
|
|
68728
70159
|
role: "admin"
|
|
68729
70160
|
},
|
|
70161
|
+
"deviceExport.unexposeEntity": {
|
|
70162
|
+
capName: "device-export",
|
|
70163
|
+
capScope: "system",
|
|
70164
|
+
addonId: null,
|
|
70165
|
+
access: "create",
|
|
70166
|
+
role: "admin"
|
|
70167
|
+
},
|
|
68730
70168
|
"deviceExtension.listCandidates": {
|
|
68731
70169
|
capName: "device-extension",
|
|
68732
70170
|
capScope: "device",
|
|
@@ -70302,6 +71740,20 @@ Object.freeze({
|
|
|
70302
71740
|
access: "create",
|
|
70303
71741
|
role: "viewer"
|
|
70304
71742
|
},
|
|
71743
|
+
"irTransmitter.getInfo": {
|
|
71744
|
+
capName: "ir-transmitter",
|
|
71745
|
+
capScope: "device",
|
|
71746
|
+
addonId: null,
|
|
71747
|
+
access: "view",
|
|
71748
|
+
role: "viewer"
|
|
71749
|
+
},
|
|
71750
|
+
"irTransmitter.send": {
|
|
71751
|
+
capName: "ir-transmitter",
|
|
71752
|
+
capScope: "device",
|
|
71753
|
+
addonId: null,
|
|
71754
|
+
access: "create",
|
|
71755
|
+
role: "viewer"
|
|
71756
|
+
},
|
|
70305
71757
|
"keychain.delete": {
|
|
70306
71758
|
capName: "keychain",
|
|
70307
71759
|
capScope: "system",
|
|
@@ -71534,6 +72986,13 @@ Object.freeze({
|
|
|
71534
72986
|
access: "create",
|
|
71535
72987
|
role: "admin"
|
|
71536
72988
|
},
|
|
72989
|
+
"nodeRemovalHook.onNodeRemoved": {
|
|
72990
|
+
capName: "node-removal-hook",
|
|
72991
|
+
capScope: "system",
|
|
72992
|
+
addonId: null,
|
|
72993
|
+
access: "create",
|
|
72994
|
+
role: "admin"
|
|
72995
|
+
},
|
|
71537
72996
|
"nodes.clusterAddonStatus": {
|
|
71538
72997
|
capName: "nodes",
|
|
71539
72998
|
capScope: "system",
|
|
@@ -72171,6 +73630,48 @@ Object.freeze({
|
|
|
72171
73630
|
access: "create",
|
|
72172
73631
|
role: "viewer"
|
|
72173
73632
|
},
|
|
73633
|
+
"petFountain.getStatus": {
|
|
73634
|
+
capName: "pet-fountain",
|
|
73635
|
+
capScope: "device",
|
|
73636
|
+
addonId: null,
|
|
73637
|
+
access: "view",
|
|
73638
|
+
role: "viewer"
|
|
73639
|
+
},
|
|
73640
|
+
"petFountain.resetDailyConsumption": {
|
|
73641
|
+
capName: "pet-fountain",
|
|
73642
|
+
capScope: "device",
|
|
73643
|
+
addonId: null,
|
|
73644
|
+
access: "delete",
|
|
73645
|
+
role: "viewer"
|
|
73646
|
+
},
|
|
73647
|
+
"petFountain.setPump": {
|
|
73648
|
+
capName: "pet-fountain",
|
|
73649
|
+
capScope: "device",
|
|
73650
|
+
addonId: null,
|
|
73651
|
+
access: "create",
|
|
73652
|
+
role: "viewer"
|
|
73653
|
+
},
|
|
73654
|
+
"petFountain.setPumpInterval": {
|
|
73655
|
+
capName: "pet-fountain",
|
|
73656
|
+
capScope: "device",
|
|
73657
|
+
addonId: null,
|
|
73658
|
+
access: "create",
|
|
73659
|
+
role: "viewer"
|
|
73660
|
+
},
|
|
73661
|
+
"petFountain.setPumpOffMinutes": {
|
|
73662
|
+
capName: "pet-fountain",
|
|
73663
|
+
capScope: "device",
|
|
73664
|
+
addonId: null,
|
|
73665
|
+
access: "create",
|
|
73666
|
+
role: "viewer"
|
|
73667
|
+
},
|
|
73668
|
+
"petFountain.setPumpOnMinutes": {
|
|
73669
|
+
capName: "pet-fountain",
|
|
73670
|
+
capScope: "device",
|
|
73671
|
+
addonId: null,
|
|
73672
|
+
access: "create",
|
|
73673
|
+
role: "viewer"
|
|
73674
|
+
},
|
|
72174
73675
|
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
72175
73676
|
capName: "pipeline-analytics",
|
|
72176
73677
|
capScope: "device",
|
|
@@ -74425,6 +75926,41 @@ Object.freeze({
|
|
|
74425
75926
|
access: "create",
|
|
74426
75927
|
role: "admin"
|
|
74427
75928
|
},
|
|
75929
|
+
"remote.getConfig": {
|
|
75930
|
+
capName: "remote",
|
|
75931
|
+
capScope: "system",
|
|
75932
|
+
addonId: null,
|
|
75933
|
+
access: "view",
|
|
75934
|
+
role: "admin"
|
|
75935
|
+
},
|
|
75936
|
+
"remote.listCommands": {
|
|
75937
|
+
capName: "remote",
|
|
75938
|
+
capScope: "system",
|
|
75939
|
+
addonId: null,
|
|
75940
|
+
access: "view",
|
|
75941
|
+
role: "admin"
|
|
75942
|
+
},
|
|
75943
|
+
"remote.sendCommand": {
|
|
75944
|
+
capName: "remote",
|
|
75945
|
+
capScope: "system",
|
|
75946
|
+
addonId: null,
|
|
75947
|
+
access: "create",
|
|
75948
|
+
role: "admin"
|
|
75949
|
+
},
|
|
75950
|
+
"remote.sendMediaCommand": {
|
|
75951
|
+
capName: "remote",
|
|
75952
|
+
capScope: "system",
|
|
75953
|
+
addonId: null,
|
|
75954
|
+
access: "create",
|
|
75955
|
+
role: "admin"
|
|
75956
|
+
},
|
|
75957
|
+
"remote.setConfig": {
|
|
75958
|
+
capName: "remote",
|
|
75959
|
+
capScope: "system",
|
|
75960
|
+
addonId: null,
|
|
75961
|
+
access: "create",
|
|
75962
|
+
role: "admin"
|
|
75963
|
+
},
|
|
74428
75964
|
"runningState.getStatus": {
|
|
74429
75965
|
capName: "running-state",
|
|
74430
75966
|
capScope: "device",
|
|
@@ -75615,6 +77151,41 @@ Object.freeze({
|
|
|
75615
77151
|
access: "view",
|
|
75616
77152
|
role: "viewer"
|
|
75617
77153
|
},
|
|
77154
|
+
"template.create": {
|
|
77155
|
+
capName: "template",
|
|
77156
|
+
capScope: "system",
|
|
77157
|
+
addonId: null,
|
|
77158
|
+
access: "create",
|
|
77159
|
+
role: "admin"
|
|
77160
|
+
},
|
|
77161
|
+
"template.delete": {
|
|
77162
|
+
capName: "template",
|
|
77163
|
+
capScope: "system",
|
|
77164
|
+
addonId: null,
|
|
77165
|
+
access: "delete",
|
|
77166
|
+
role: "admin"
|
|
77167
|
+
},
|
|
77168
|
+
"template.get": {
|
|
77169
|
+
capName: "template",
|
|
77170
|
+
capScope: "system",
|
|
77171
|
+
addonId: null,
|
|
77172
|
+
access: "view",
|
|
77173
|
+
role: "admin"
|
|
77174
|
+
},
|
|
77175
|
+
"template.list": {
|
|
77176
|
+
capName: "template",
|
|
77177
|
+
capScope: "system",
|
|
77178
|
+
addonId: null,
|
|
77179
|
+
access: "view",
|
|
77180
|
+
role: "admin"
|
|
77181
|
+
},
|
|
77182
|
+
"template.update": {
|
|
77183
|
+
capName: "template",
|
|
77184
|
+
capScope: "system",
|
|
77185
|
+
addonId: null,
|
|
77186
|
+
access: "create",
|
|
77187
|
+
role: "admin"
|
|
77188
|
+
},
|
|
75618
77189
|
"terminalSession.adoptLegacyMonitor": {
|
|
75619
77190
|
capName: "terminal-session",
|
|
75620
77191
|
capScope: "system",
|
|
@@ -76796,7 +78367,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76796
78367
|
label: t("Full brightness", "Luminosità massima"),
|
|
76797
78368
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
76798
78369
|
icon: "sun",
|
|
76799
|
-
args: {
|
|
78370
|
+
args: { level: 100 }
|
|
76800
78371
|
},
|
|
76801
78372
|
{
|
|
76802
78373
|
id: "brightness.half",
|
|
@@ -76804,7 +78375,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76804
78375
|
label: t("Half brightness", "Luminosità a metà"),
|
|
76805
78376
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
76806
78377
|
icon: "sun-dim",
|
|
76807
|
-
args: {
|
|
78378
|
+
args: { level: 50 }
|
|
76808
78379
|
},
|
|
76809
78380
|
{
|
|
76810
78381
|
id: "brightness.off",
|
|
@@ -76812,16 +78383,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76812
78383
|
label: t("Brightness off", "Luminosità a zero"),
|
|
76813
78384
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
76814
78385
|
icon: "lightbulb-off",
|
|
76815
|
-
args: {
|
|
78386
|
+
args: { level: 0 }
|
|
76816
78387
|
},
|
|
76817
78388
|
{
|
|
76818
78389
|
id: "brightness.set",
|
|
76819
78390
|
method: "setBrightness",
|
|
76820
78391
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
76821
|
-
phrase: t("Set the brightness of {device} to {
|
|
78392
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
76822
78393
|
icon: "sun-medium",
|
|
76823
78394
|
openArgs: [{
|
|
76824
|
-
key: "
|
|
78395
|
+
key: "level",
|
|
76825
78396
|
label: PERCENT,
|
|
76826
78397
|
offer: {
|
|
76827
78398
|
kind: "number",
|
|
@@ -76835,13 +78406,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76835
78406
|
],
|
|
76836
78407
|
state: [{
|
|
76837
78408
|
kind: "numeric",
|
|
76838
|
-
field: "
|
|
78409
|
+
field: "level",
|
|
76839
78410
|
quantity: t("the brightness", "la luminosità"),
|
|
76840
78411
|
label: t("Brightness", "Luminosità"),
|
|
76841
78412
|
unit: "%",
|
|
76842
78413
|
icon: "sun"
|
|
76843
78414
|
}],
|
|
76844
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
78415
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
76845
78416
|
},
|
|
76846
78417
|
color: {
|
|
76847
78418
|
scope: "device",
|
|
@@ -76855,7 +78426,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76855
78426
|
icon: "sun",
|
|
76856
78427
|
args: { color: {
|
|
76857
78428
|
mode: "mired",
|
|
76858
|
-
|
|
78429
|
+
colorTemperature: 370
|
|
76859
78430
|
} }
|
|
76860
78431
|
},
|
|
76861
78432
|
{
|
|
@@ -76866,7 +78437,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76866
78437
|
icon: "snowflake",
|
|
76867
78438
|
args: { color: {
|
|
76868
78439
|
mode: "mired",
|
|
76869
|
-
|
|
78440
|
+
colorTemperature: 200
|
|
76870
78441
|
} }
|
|
76871
78442
|
},
|
|
76872
78443
|
{
|
|
@@ -77480,7 +79051,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77480
79051
|
label: t("Fan off", "Ventilatore spento"),
|
|
77481
79052
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
77482
79053
|
icon: "power-off",
|
|
77483
|
-
args: {
|
|
79054
|
+
args: { speed: 0 }
|
|
77484
79055
|
},
|
|
77485
79056
|
{
|
|
77486
79057
|
id: "fan.full",
|
|
@@ -77488,16 +79059,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77488
79059
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
77489
79060
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
77490
79061
|
icon: "fan",
|
|
77491
|
-
args: {
|
|
79062
|
+
args: { speed: 100 }
|
|
77492
79063
|
},
|
|
77493
79064
|
{
|
|
77494
79065
|
id: "fan.speed",
|
|
77495
79066
|
method: "setPercentage",
|
|
77496
79067
|
label: t("Set speed", "Imposta la velocità"),
|
|
77497
|
-
phrase: t("Set the speed of {device} to {
|
|
79068
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
77498
79069
|
icon: "fan",
|
|
77499
79070
|
openArgs: [{
|
|
77500
|
-
key: "
|
|
79071
|
+
key: "speed",
|
|
77501
79072
|
label: t("Speed", "Velocità"),
|
|
77502
79073
|
offer: {
|
|
77503
79074
|
kind: "number",
|
|
@@ -77559,7 +79130,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77559
79130
|
],
|
|
77560
79131
|
state: [{
|
|
77561
79132
|
kind: "numeric",
|
|
77562
|
-
field: "
|
|
79133
|
+
field: "speed",
|
|
77563
79134
|
quantity: t("the speed", "la velocità"),
|
|
77564
79135
|
label: t("Speed", "Velocità"),
|
|
77565
79136
|
unit: "%",
|
|
@@ -77925,6 +79496,11 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77925
79496
|
icon: "circle-dot"
|
|
77926
79497
|
}]
|
|
77927
79498
|
},
|
|
79499
|
+
"ir-transmitter": {
|
|
79500
|
+
scope: "device",
|
|
79501
|
+
noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
|
|
79502
|
+
notOperatorFacing: { send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it" }
|
|
79503
|
+
},
|
|
77928
79504
|
control: {
|
|
77929
79505
|
scope: "device",
|
|
77930
79506
|
noun: t("Control", "Controllo"),
|
|
@@ -78357,7 +79933,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78357
79933
|
},
|
|
78358
79934
|
{
|
|
78359
79935
|
kind: "numeric",
|
|
78360
|
-
field: "
|
|
79936
|
+
field: "progress",
|
|
78361
79937
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
78362
79938
|
label: t("Progress", "Avanzamento"),
|
|
78363
79939
|
unit: "%",
|
|
@@ -78578,6 +80154,100 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78578
80154
|
}
|
|
78579
80155
|
]
|
|
78580
80156
|
},
|
|
80157
|
+
"pet-fountain": {
|
|
80158
|
+
scope: "device",
|
|
80159
|
+
noun: t("Pet fountain", "Fontana per animali"),
|
|
80160
|
+
actions: [
|
|
80161
|
+
{
|
|
80162
|
+
id: "petFountain.pumpOn",
|
|
80163
|
+
method: "setPump",
|
|
80164
|
+
label: t("Pump on", "Pompa accesa"),
|
|
80165
|
+
phrase: t("Start the pump of {device}", "Avvia la pompa di {device}"),
|
|
80166
|
+
icon: "play",
|
|
80167
|
+
args: { on: true }
|
|
80168
|
+
},
|
|
80169
|
+
{
|
|
80170
|
+
id: "petFountain.pumpOff",
|
|
80171
|
+
method: "setPump",
|
|
80172
|
+
label: t("Pump off", "Pompa spenta"),
|
|
80173
|
+
phrase: t("Stop the pump of {device}", "Ferma la pompa di {device}"),
|
|
80174
|
+
icon: "square",
|
|
80175
|
+
args: { on: false }
|
|
80176
|
+
},
|
|
80177
|
+
{
|
|
80178
|
+
id: "petFountain.intervalOn",
|
|
80179
|
+
method: "setPumpInterval",
|
|
80180
|
+
label: t("Pump cycle on", "Ciclo pompa attivo"),
|
|
80181
|
+
phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
|
|
80182
|
+
icon: "timer",
|
|
80183
|
+
args: { on: true }
|
|
80184
|
+
},
|
|
80185
|
+
{
|
|
80186
|
+
id: "petFountain.intervalOff",
|
|
80187
|
+
method: "setPumpInterval",
|
|
80188
|
+
label: t("Pump cycle off", "Ciclo pompa spento"),
|
|
80189
|
+
phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
|
|
80190
|
+
icon: "timer-off",
|
|
80191
|
+
args: { on: false }
|
|
80192
|
+
},
|
|
80193
|
+
{
|
|
80194
|
+
id: "petFountain.pumpOnMinutes",
|
|
80195
|
+
method: "setPumpOnMinutes",
|
|
80196
|
+
label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
|
|
80197
|
+
phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
|
|
80198
|
+
icon: "timer",
|
|
80199
|
+
openArgs: [{
|
|
80200
|
+
key: "minutes",
|
|
80201
|
+
label: t("Minutes", "Minuti"),
|
|
80202
|
+
offer: {
|
|
80203
|
+
kind: "number",
|
|
80204
|
+
min: 0,
|
|
80205
|
+
step: 1,
|
|
80206
|
+
unit: "min"
|
|
80207
|
+
}
|
|
80208
|
+
}]
|
|
80209
|
+
},
|
|
80210
|
+
{
|
|
80211
|
+
id: "petFountain.pumpOffMinutes",
|
|
80212
|
+
method: "setPumpOffMinutes",
|
|
80213
|
+
label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
|
|
80214
|
+
phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
|
|
80215
|
+
icon: "timer-off",
|
|
80216
|
+
openArgs: [{
|
|
80217
|
+
key: "minutes",
|
|
80218
|
+
label: t("Minutes", "Minuti"),
|
|
80219
|
+
offer: {
|
|
80220
|
+
kind: "number",
|
|
80221
|
+
min: 0,
|
|
80222
|
+
step: 1,
|
|
80223
|
+
unit: "min"
|
|
80224
|
+
}
|
|
80225
|
+
}]
|
|
80226
|
+
},
|
|
80227
|
+
{
|
|
80228
|
+
id: "petFountain.resetDailyConsumption",
|
|
80229
|
+
method: "resetDailyConsumption",
|
|
80230
|
+
label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
|
|
80231
|
+
phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
|
|
80232
|
+
icon: "rotate-ccw"
|
|
80233
|
+
}
|
|
80234
|
+
],
|
|
80235
|
+
state: [{
|
|
80236
|
+
kind: "boolean",
|
|
80237
|
+
field: "empty",
|
|
80238
|
+
label: t("Tank empty", "Serbatoio vuoto"),
|
|
80239
|
+
whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
|
|
80240
|
+
whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
|
|
80241
|
+
icon: "droplet"
|
|
80242
|
+
}, {
|
|
80243
|
+
kind: "numeric",
|
|
80244
|
+
field: "waterLevel",
|
|
80245
|
+
quantity: t("the water level", "il livello dell’acqua"),
|
|
80246
|
+
label: t("Water level", "Livello dell’acqua"),
|
|
80247
|
+
unit: "%",
|
|
80248
|
+
icon: "droplets"
|
|
80249
|
+
}]
|
|
80250
|
+
},
|
|
78581
80251
|
"media-player": {
|
|
78582
80252
|
scope: "device",
|
|
78583
80253
|
noun: t("Media player", "Lettore multimediale"),
|
|
@@ -78715,10 +80385,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78715
80385
|
id: "media.seek",
|
|
78716
80386
|
method: "seek",
|
|
78717
80387
|
label: t("Seek", "Vai al punto"),
|
|
78718
|
-
phrase: t("Move {device} to {
|
|
80388
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
78719
80389
|
icon: "fast-forward",
|
|
78720
80390
|
openArgs: [{
|
|
78721
|
-
key: "
|
|
80391
|
+
key: "position",
|
|
78722
80392
|
label: t("Position", "Posizione"),
|
|
78723
80393
|
offer: {
|
|
78724
80394
|
kind: "number",
|
|
@@ -79767,7 +81437,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79767
81437
|
state: [
|
|
79768
81438
|
{
|
|
79769
81439
|
kind: "numeric",
|
|
79770
|
-
field: "
|
|
81440
|
+
field: "co2",
|
|
79771
81441
|
quantity: t("the CO₂", "la CO₂"),
|
|
79772
81442
|
label: t("CO₂", "CO₂"),
|
|
79773
81443
|
unit: "ppm",
|
|
@@ -79775,7 +81445,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79775
81445
|
},
|
|
79776
81446
|
{
|
|
79777
81447
|
kind: "numeric",
|
|
79778
|
-
field: "
|
|
81448
|
+
field: "voc",
|
|
79779
81449
|
quantity: t("the VOC level", "il livello di COV"),
|
|
79780
81450
|
label: t("VOC", "COV"),
|
|
79781
81451
|
unit: "ppb",
|
|
@@ -79811,7 +81481,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79811
81481
|
noun: t("Light level", "Luminosità ambiente"),
|
|
79812
81482
|
state: [{
|
|
79813
81483
|
kind: "numeric",
|
|
79814
|
-
field: "
|
|
81484
|
+
field: "illuminance",
|
|
79815
81485
|
quantity: t("the light level", "la luminosità"),
|
|
79816
81486
|
label: t("Illuminance", "Illuminamento"),
|
|
79817
81487
|
unit: "lx",
|
|
@@ -80014,7 +81684,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80014
81684
|
noun: t("Humidity", "Umidità"),
|
|
80015
81685
|
state: [{
|
|
80016
81686
|
kind: "numeric",
|
|
80017
|
-
field: "
|
|
81687
|
+
field: "humidity",
|
|
80018
81688
|
quantity: t("the humidity", "l’umidità"),
|
|
80019
81689
|
label: t("Humidity", "Umidità"),
|
|
80020
81690
|
unit: "%",
|
|
@@ -80062,7 +81732,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80062
81732
|
state: [
|
|
80063
81733
|
{
|
|
80064
81734
|
kind: "numeric",
|
|
80065
|
-
field: "
|
|
81735
|
+
field: "power",
|
|
80066
81736
|
quantity: t("the power draw", "il consumo"),
|
|
80067
81737
|
label: t("Power", "Potenza"),
|
|
80068
81738
|
unit: "W",
|
|
@@ -80070,7 +81740,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80070
81740
|
},
|
|
80071
81741
|
{
|
|
80072
81742
|
kind: "numeric",
|
|
80073
|
-
field: "
|
|
81743
|
+
field: "energy",
|
|
80074
81744
|
quantity: t("the energy used", "l’energia consumata"),
|
|
80075
81745
|
label: t("Energy", "Energia"),
|
|
80076
81746
|
unit: "kWh",
|
|
@@ -80078,7 +81748,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80078
81748
|
},
|
|
80079
81749
|
{
|
|
80080
81750
|
kind: "numeric",
|
|
80081
|
-
field: "
|
|
81751
|
+
field: "voltage",
|
|
80082
81752
|
quantity: t("the voltage", "la tensione"),
|
|
80083
81753
|
label: t("Voltage", "Tensione"),
|
|
80084
81754
|
unit: "V",
|
|
@@ -80086,7 +81756,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80086
81756
|
},
|
|
80087
81757
|
{
|
|
80088
81758
|
kind: "numeric",
|
|
80089
|
-
field: "
|
|
81759
|
+
field: "current",
|
|
80090
81760
|
quantity: t("the current", "la corrente"),
|
|
80091
81761
|
label: t("Current", "Corrente"),
|
|
80092
81762
|
unit: "A",
|
|
@@ -80103,13 +81773,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80103
81773
|
label: t("Where", "Posizione"),
|
|
80104
81774
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
80105
81775
|
icon: "map-pin"
|
|
80106
|
-
}, {
|
|
80107
|
-
kind: "numeric",
|
|
80108
|
-
field: "batteryPercent",
|
|
80109
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
80110
|
-
label: t("Battery", "Batteria"),
|
|
80111
|
-
unit: "%",
|
|
80112
|
-
icon: "battery"
|
|
80113
81776
|
}]
|
|
80114
81777
|
},
|
|
80115
81778
|
"pressure-sensor": {
|
|
@@ -80117,7 +81780,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80117
81780
|
noun: t("Pressure", "Pressione"),
|
|
80118
81781
|
state: [{
|
|
80119
81782
|
kind: "numeric",
|
|
80120
|
-
field: "
|
|
81783
|
+
field: "pressure",
|
|
80121
81784
|
quantity: t("the pressure", "la pressione"),
|
|
80122
81785
|
label: t("Pressure", "Pressione"),
|
|
80123
81786
|
unit: "hPa",
|
|
@@ -80153,7 +81816,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80153
81816
|
noun: t("Temperature", "Temperatura"),
|
|
80154
81817
|
state: [{
|
|
80155
81818
|
kind: "numeric",
|
|
80156
|
-
field: "
|
|
81819
|
+
field: "temperature",
|
|
80157
81820
|
quantity: t("the temperature", "la temperatura"),
|
|
80158
81821
|
label: t("Temperature", "Temperatura"),
|
|
80159
81822
|
unit: "°C",
|
|
@@ -80224,7 +81887,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80224
81887
|
state: [
|
|
80225
81888
|
{
|
|
80226
81889
|
kind: "numeric",
|
|
80227
|
-
field: "
|
|
81890
|
+
field: "level",
|
|
80228
81891
|
quantity: t("the battery level", "il livello della batteria"),
|
|
80229
81892
|
label: t("Battery", "Batteria"),
|
|
80230
81893
|
unit: "%",
|
|
@@ -80266,7 +81929,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80266
81929
|
icon: "battery-charging"
|
|
80267
81930
|
}
|
|
80268
81931
|
],
|
|
80269
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
81932
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
80270
81933
|
extraEvents: [{
|
|
80271
81934
|
category: EventCategory.DeviceAwake,
|
|
80272
81935
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -80284,7 +81947,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80284
81947
|
noun: t("Network link", "Collegamento di rete"),
|
|
80285
81948
|
state: [{
|
|
80286
81949
|
kind: "numeric",
|
|
80287
|
-
field: "
|
|
81950
|
+
field: "signal",
|
|
80288
81951
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
80289
81952
|
label: t("Signal", "Segnale"),
|
|
80290
81953
|
unit: "%",
|
|
@@ -80377,6 +82040,8 @@ var ML = "model and training machinery — no device action";
|
|
|
80377
82040
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
80378
82041
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
80379
82042
|
var SYSTEM_CAP_VOCABULARY = {
|
|
82043
|
+
"action-source": system(INTERNAL),
|
|
82044
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
80380
82045
|
"addon-pages": system(UI_PLUMBING),
|
|
80381
82046
|
"addon-pages-source": system(UI_PLUMBING),
|
|
80382
82047
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -80407,6 +82072,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
80407
82072
|
"device-manager": system("the device registry itself — rename, move and remove are administration"),
|
|
80408
82073
|
"device-provider": system(INTERNAL),
|
|
80409
82074
|
"device-removal-hook": system(INTERNAL),
|
|
82075
|
+
"node-removal-hook": system(INTERNAL),
|
|
80410
82076
|
"device-state": system("the runtime-state mirror every trigger already reads through"),
|
|
80411
82077
|
"display-palette": system("the cluster display palette — one colour table for every client, not a device action"),
|
|
80412
82078
|
"embedding-encoder": system(ML),
|
|
@@ -80446,6 +82112,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
80446
82112
|
"recording-archive": system(STORAGE),
|
|
80447
82113
|
"recording-export": system("recording exports — requested from the timeline, not an automation step"),
|
|
80448
82114
|
records: system(INTERNAL),
|
|
82115
|
+
remote: system("the per-device remote setup — authored in the Customize remote editor, sent through the remote UI"),
|
|
80449
82116
|
"server-management": system(CLUSTER),
|
|
80450
82117
|
"settings-store": system(INTERNAL),
|
|
80451
82118
|
"smtp-provider": system(INTERNAL),
|
|
@@ -80458,6 +82125,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
80458
82125
|
"storage-provider": system(STORAGE),
|
|
80459
82126
|
"stream-broker": system(PIPELINE),
|
|
80460
82127
|
system: system(CLUSTER),
|
|
82128
|
+
template: system("operator-authored templates — edited in their own editor, never actuated"),
|
|
80461
82129
|
"terminal-session": system(CLUSTER),
|
|
80462
82130
|
toast: system(UI_PLUMBING),
|
|
80463
82131
|
training: system(ML),
|
|
@@ -80517,7 +82185,7 @@ function projectAction(cap, action) {
|
|
|
80517
82185
|
};
|
|
80518
82186
|
}
|
|
80519
82187
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
80520
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
82188
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
80521
82189
|
DeviceFeature.BatteryOperated;
|
|
80522
82190
|
/**
|
|
80523
82191
|
* How a washer, dryer or dishwasher leaves CamStack.
|
|
@@ -80598,6 +82266,31 @@ Object.freeze({
|
|
|
80598
82266
|
form: "single",
|
|
80599
82267
|
optional: false
|
|
80600
82268
|
}],
|
|
82269
|
+
"actions.get": [{
|
|
82270
|
+
name: "deviceId",
|
|
82271
|
+
form: "single",
|
|
82272
|
+
optional: true
|
|
82273
|
+
}],
|
|
82274
|
+
"actions.getLinks": [{
|
|
82275
|
+
name: "deviceId",
|
|
82276
|
+
form: "single",
|
|
82277
|
+
optional: false
|
|
82278
|
+
}],
|
|
82279
|
+
"actions.listForCamera": [{
|
|
82280
|
+
name: "deviceId",
|
|
82281
|
+
form: "single",
|
|
82282
|
+
optional: false
|
|
82283
|
+
}],
|
|
82284
|
+
"actions.run": [{
|
|
82285
|
+
name: "deviceId",
|
|
82286
|
+
form: "single",
|
|
82287
|
+
optional: true
|
|
82288
|
+
}],
|
|
82289
|
+
"actions.setLinks": [{
|
|
82290
|
+
name: "deviceId",
|
|
82291
|
+
form: "single",
|
|
82292
|
+
optional: false
|
|
82293
|
+
}],
|
|
80601
82294
|
"addonSettings.getDeviceSettings": [{
|
|
80602
82295
|
name: "deviceId",
|
|
80603
82296
|
form: "single",
|
|
@@ -81649,6 +83342,16 @@ Object.freeze({
|
|
|
81649
83342
|
form: "single",
|
|
81650
83343
|
optional: false
|
|
81651
83344
|
}],
|
|
83345
|
+
"irTransmitter.getInfo": [{
|
|
83346
|
+
name: "deviceId",
|
|
83347
|
+
form: "single",
|
|
83348
|
+
optional: false
|
|
83349
|
+
}],
|
|
83350
|
+
"irTransmitter.send": [{
|
|
83351
|
+
name: "deviceId",
|
|
83352
|
+
form: "single",
|
|
83353
|
+
optional: false
|
|
83354
|
+
}],
|
|
81652
83355
|
"keychain.deleteDeviceScope": [{
|
|
81653
83356
|
name: "deviceId",
|
|
81654
83357
|
form: "single",
|
|
@@ -82058,6 +83761,36 @@ Object.freeze({
|
|
|
82058
83761
|
form: "single",
|
|
82059
83762
|
optional: false
|
|
82060
83763
|
}],
|
|
83764
|
+
"petFountain.getStatus": [{
|
|
83765
|
+
name: "deviceId",
|
|
83766
|
+
form: "single",
|
|
83767
|
+
optional: false
|
|
83768
|
+
}],
|
|
83769
|
+
"petFountain.resetDailyConsumption": [{
|
|
83770
|
+
name: "deviceId",
|
|
83771
|
+
form: "single",
|
|
83772
|
+
optional: false
|
|
83773
|
+
}],
|
|
83774
|
+
"petFountain.setPump": [{
|
|
83775
|
+
name: "deviceId",
|
|
83776
|
+
form: "single",
|
|
83777
|
+
optional: false
|
|
83778
|
+
}],
|
|
83779
|
+
"petFountain.setPumpInterval": [{
|
|
83780
|
+
name: "deviceId",
|
|
83781
|
+
form: "single",
|
|
83782
|
+
optional: false
|
|
83783
|
+
}],
|
|
83784
|
+
"petFountain.setPumpOffMinutes": [{
|
|
83785
|
+
name: "deviceId",
|
|
83786
|
+
form: "single",
|
|
83787
|
+
optional: false
|
|
83788
|
+
}],
|
|
83789
|
+
"petFountain.setPumpOnMinutes": [{
|
|
83790
|
+
name: "deviceId",
|
|
83791
|
+
form: "single",
|
|
83792
|
+
optional: false
|
|
83793
|
+
}],
|
|
82061
83794
|
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
82062
83795
|
name: "deviceId",
|
|
82063
83796
|
form: "single",
|
|
@@ -82874,6 +84607,31 @@ Object.freeze({
|
|
|
82874
84607
|
form: "single",
|
|
82875
84608
|
optional: true
|
|
82876
84609
|
}],
|
|
84610
|
+
"remote.getConfig": [{
|
|
84611
|
+
name: "deviceId",
|
|
84612
|
+
form: "single",
|
|
84613
|
+
optional: false
|
|
84614
|
+
}],
|
|
84615
|
+
"remote.listCommands": [{
|
|
84616
|
+
name: "deviceId",
|
|
84617
|
+
form: "single",
|
|
84618
|
+
optional: false
|
|
84619
|
+
}],
|
|
84620
|
+
"remote.sendCommand": [{
|
|
84621
|
+
name: "deviceId",
|
|
84622
|
+
form: "single",
|
|
84623
|
+
optional: false
|
|
84624
|
+
}],
|
|
84625
|
+
"remote.sendMediaCommand": [{
|
|
84626
|
+
name: "deviceId",
|
|
84627
|
+
form: "single",
|
|
84628
|
+
optional: false
|
|
84629
|
+
}],
|
|
84630
|
+
"remote.setConfig": [{
|
|
84631
|
+
name: "deviceId",
|
|
84632
|
+
form: "single",
|
|
84633
|
+
optional: false
|
|
84634
|
+
}],
|
|
82877
84635
|
"runningState.getStatus": [{
|
|
82878
84636
|
name: "deviceId",
|
|
82879
84637
|
form: "single",
|
|
@@ -84679,8 +86437,17 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
|
84679
86437
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
84680
86438
|
DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
|
|
84681
86439
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
86440
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
84682
86441
|
var MB = 1024 * 1024;
|
|
84683
86442
|
1024 * MB, 3072 * MB;
|
|
86443
|
+
object({
|
|
86444
|
+
manufacturer: string().optional(),
|
|
86445
|
+
supportedModels: array(string()).optional(),
|
|
86446
|
+
supportedController: string().optional(),
|
|
86447
|
+
commandsEncoding: string(),
|
|
86448
|
+
delay: number().nonnegative().optional(),
|
|
86449
|
+
commands: record(string(), unknown())
|
|
86450
|
+
});
|
|
84684
86451
|
process.platform, process.env["SystemRoot"];
|
|
84685
86452
|
var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
|
|
84686
86453
|
/** Heartbeat cadence — ~2 minutes of 4 s fragments. */
|
|
@@ -84712,7 +86479,7 @@ var Fmp4FragmentChild = class {
|
|
|
84712
86479
|
meta: {
|
|
84713
86480
|
sourceId: this.args.sourceId,
|
|
84714
86481
|
decodeHwAccel: requested,
|
|
84715
|
-
error: errMsg$
|
|
86482
|
+
error: errMsg$17(err)
|
|
84716
86483
|
}
|
|
84717
86484
|
});
|
|
84718
86485
|
this.killChild();
|
|
@@ -84891,7 +86658,7 @@ var Fmp4FragmentChild = class {
|
|
|
84891
86658
|
tags: { deviceId: this.args.deviceId },
|
|
84892
86659
|
meta: {
|
|
84893
86660
|
sourceId: this.args.sourceId,
|
|
84894
|
-
error: errMsg$
|
|
86661
|
+
error: errMsg$17(err)
|
|
84895
86662
|
}
|
|
84896
86663
|
});
|
|
84897
86664
|
}
|
|
@@ -131580,6 +133347,176 @@ function clearPairingFiles(accessoryUuid, logger) {
|
|
|
131580
133347
|
} });
|
|
131581
133348
|
}
|
|
131582
133349
|
}
|
|
133350
|
+
/** Deterministic and distinct from every device accessory uuid. */
|
|
133351
|
+
function actionSwitchUuid(actionId) {
|
|
133352
|
+
return import_dist.uuid.generate(`camstack:hap:action:${actionId}`);
|
|
133353
|
+
}
|
|
133354
|
+
function buildActionSwitch(input) {
|
|
133355
|
+
const { actionId, displayName, run } = input;
|
|
133356
|
+
const autoOffMs = input.autoOffMs ?? 1e3;
|
|
133357
|
+
const accessory = new import_dist.Accessory(displayName, actionSwitchUuid(actionId));
|
|
133358
|
+
accessory.category = import_dist.Categories.SWITCH;
|
|
133359
|
+
const info = accessory.getService(import_dist.Service.AccessoryInformation);
|
|
133360
|
+
info?.setCharacteristic(import_dist.Characteristic.Manufacturer, "CamStack");
|
|
133361
|
+
info?.setCharacteristic(import_dist.Characteristic.Model, "Action");
|
|
133362
|
+
info?.setCharacteristic(import_dist.Characteristic.SerialNumber, `camstack-action-${actionId}`);
|
|
133363
|
+
const service = accessory.addService(import_dist.Service.Switch, displayName);
|
|
133364
|
+
const on = service.getCharacteristic(import_dist.Characteristic.On);
|
|
133365
|
+
let timer = null;
|
|
133366
|
+
const clearTimer = () => {
|
|
133367
|
+
if (timer !== null) clearTimeout(timer);
|
|
133368
|
+
timer = null;
|
|
133369
|
+
};
|
|
133370
|
+
on.onSet(async (value) => {
|
|
133371
|
+
if (value !== true) {
|
|
133372
|
+
clearTimer();
|
|
133373
|
+
return;
|
|
133374
|
+
}
|
|
133375
|
+
if (timer !== null) return;
|
|
133376
|
+
timer = setTimeout(() => {
|
|
133377
|
+
timer = null;
|
|
133378
|
+
service.updateCharacteristic(import_dist.Characteristic.On, false);
|
|
133379
|
+
}, autoOffMs);
|
|
133380
|
+
try {
|
|
133381
|
+
await run();
|
|
133382
|
+
} catch {}
|
|
133383
|
+
});
|
|
133384
|
+
on.onGet(() => false);
|
|
133385
|
+
return {
|
|
133386
|
+
accessory,
|
|
133387
|
+
accessories: [accessory],
|
|
133388
|
+
async dispose() {
|
|
133389
|
+
clearTimer();
|
|
133390
|
+
}
|
|
133391
|
+
};
|
|
133392
|
+
}
|
|
133393
|
+
//#endregion
|
|
133394
|
+
//#region src/action-exports.ts
|
|
133395
|
+
/**
|
|
133396
|
+
* The actions this bridge exposes (D968): the persisted selection and the
|
|
133397
|
+
* switch each entry is published as.
|
|
133398
|
+
*
|
|
133399
|
+
* Kept apart from the addon class so the lifecycle can be proved without a
|
|
133400
|
+
* HAP server: the addon supplies `publish` / `unpublish` (bridge first,
|
|
133401
|
+
* standalone as the fallback, exactly as for a device) and `persist` (its own
|
|
133402
|
+
* settings), and this class owns the rest — the lookup of the action's name,
|
|
133403
|
+
* the press that runs it, the refusal that is logged, the pruning of an action
|
|
133404
|
+
* the operator deleted.
|
|
133405
|
+
*
|
|
133406
|
+
* Actions are list entries, not devices (D954): nothing here touches the
|
|
133407
|
+
* device registry, and the log tag is `actionId`.
|
|
133408
|
+
*/
|
|
133409
|
+
var EXPORTER = "export-hap";
|
|
133410
|
+
function errMsg$16(err) {
|
|
133411
|
+
return err instanceof Error ? err.message : String(err);
|
|
133412
|
+
}
|
|
133413
|
+
var ActionExports = class {
|
|
133414
|
+
ports;
|
|
133415
|
+
entries;
|
|
133416
|
+
mappers = /* @__PURE__ */ new Map();
|
|
133417
|
+
constructor(ports, initial) {
|
|
133418
|
+
this.ports = ports;
|
|
133419
|
+
this.entries = initial;
|
|
133420
|
+
}
|
|
133421
|
+
/** The cap's `listExposedEntities` rows for actions. */
|
|
133422
|
+
list() {
|
|
133423
|
+
return this.entries.map((e) => ({
|
|
133424
|
+
entity: {
|
|
133425
|
+
kind: "action",
|
|
133426
|
+
actionId: e.actionId
|
|
133427
|
+
},
|
|
133428
|
+
exposedAs: e.displayName
|
|
133429
|
+
}));
|
|
133430
|
+
}
|
|
133431
|
+
/** Re-publish the persisted selection (boot). One failure does not stop the rest. */
|
|
133432
|
+
async attachAll() {
|
|
133433
|
+
for (const entry of this.entries) try {
|
|
133434
|
+
await this.attach(entry);
|
|
133435
|
+
} catch (err) {
|
|
133436
|
+
this.ports.logger.warn("export-hap: failed to re-attach exported action on boot", {
|
|
133437
|
+
tags: { actionId: entry.actionId },
|
|
133438
|
+
meta: { error: errMsg$16(err) }
|
|
133439
|
+
});
|
|
133440
|
+
}
|
|
133441
|
+
}
|
|
133442
|
+
async expose(actionId) {
|
|
133443
|
+
const action = (await this.ports.api.actions.list.query({})).find((a) => a.id === actionId);
|
|
133444
|
+
if (action === void 0) throw new Error(`export-hap: action '${actionId}' does not exist`);
|
|
133445
|
+
const previous = this.entries.find((e) => e.actionId === actionId);
|
|
133446
|
+
const entry = {
|
|
133447
|
+
actionId,
|
|
133448
|
+
displayName: action.name,
|
|
133449
|
+
addedAt: previous?.addedAt ?? Date.now()
|
|
133450
|
+
};
|
|
133451
|
+
await this.detach(actionId);
|
|
133452
|
+
await this.attach(entry);
|
|
133453
|
+
await this.save([...this.entries.filter((e) => e.actionId !== actionId), entry]);
|
|
133454
|
+
this.ports.logger.info("export-hap: exposed action", {
|
|
133455
|
+
tags: { actionId },
|
|
133456
|
+
meta: { displayName: action.name }
|
|
133457
|
+
});
|
|
133458
|
+
}
|
|
133459
|
+
async unexpose(actionId) {
|
|
133460
|
+
await this.detach(actionId);
|
|
133461
|
+
if (this.entries.some((e) => e.actionId === actionId)) await this.save(this.entries.filter((e) => e.actionId !== actionId));
|
|
133462
|
+
this.ports.logger.info("export-hap: unexposed action", { tags: { actionId } });
|
|
133463
|
+
}
|
|
133464
|
+
/**
|
|
133465
|
+
* Drop what the operator deleted. An action list that could not be read
|
|
133466
|
+
* changes nothing (D49): a failed read must never destroy the selection.
|
|
133467
|
+
*/
|
|
133468
|
+
async reconcile() {
|
|
133469
|
+
if (this.entries.length === 0) return;
|
|
133470
|
+
let live;
|
|
133471
|
+
try {
|
|
133472
|
+
const actions = await this.ports.api.actions.list.query({});
|
|
133473
|
+
live = new Set(actions.map((a) => a.id));
|
|
133474
|
+
} catch (err) {
|
|
133475
|
+
this.ports.logger.warn("export-hap: exported actions not reconciled — list unanswered", { meta: { error: errMsg$16(err) } });
|
|
133476
|
+
return;
|
|
133477
|
+
}
|
|
133478
|
+
const { dropped } = pruneDeletedEntities(this.entries.map((e) => ({
|
|
133479
|
+
kind: "action",
|
|
133480
|
+
actionId: e.actionId
|
|
133481
|
+
})), {
|
|
133482
|
+
actionIds: live,
|
|
133483
|
+
targetIds: /* @__PURE__ */ new Set()
|
|
133484
|
+
}, this.ports.logger, EXPORTER);
|
|
133485
|
+
if (dropped.length === 0) return;
|
|
133486
|
+
for (const ref of dropped) if (ref.kind === "action") await this.detach(ref.actionId);
|
|
133487
|
+
const gone = new Set(dropped.flatMap((r) => r.kind === "action" ? [r.actionId] : []));
|
|
133488
|
+
await this.save(this.entries.filter((e) => !gone.has(e.actionId)));
|
|
133489
|
+
}
|
|
133490
|
+
async dispose() {
|
|
133491
|
+
for (const mapper of this.mappers.values()) await mapper.dispose();
|
|
133492
|
+
this.mappers.clear();
|
|
133493
|
+
}
|
|
133494
|
+
async attach(entry) {
|
|
133495
|
+
const mapper = buildActionSwitch({
|
|
133496
|
+
actionId: entry.actionId,
|
|
133497
|
+
displayName: entry.displayName,
|
|
133498
|
+
run: async () => {
|
|
133499
|
+
await runExportedAction(this.ports.api, this.ports.logger, {
|
|
133500
|
+
exporter: EXPORTER,
|
|
133501
|
+
actionId: entry.actionId
|
|
133502
|
+
});
|
|
133503
|
+
}
|
|
133504
|
+
});
|
|
133505
|
+
for (const accessory of mapper.accessories) await this.ports.publish(accessory);
|
|
133506
|
+
this.mappers.set(entry.actionId, mapper);
|
|
133507
|
+
}
|
|
133508
|
+
async detach(actionId) {
|
|
133509
|
+
const mapper = this.mappers.get(actionId);
|
|
133510
|
+
if (mapper === void 0) return;
|
|
133511
|
+
this.mappers.delete(actionId);
|
|
133512
|
+
for (const accessory of mapper.accessories) await this.ports.unpublish(accessory);
|
|
133513
|
+
await mapper.dispose();
|
|
133514
|
+
}
|
|
133515
|
+
async save(next) {
|
|
133516
|
+
this.entries = next;
|
|
133517
|
+
await this.ports.persist(next);
|
|
133518
|
+
}
|
|
133519
|
+
};
|
|
131583
133520
|
/**
|
|
131584
133521
|
* Whether this device's accessory belongs on the bridge.
|
|
131585
133522
|
*
|
|
@@ -133978,7 +135915,7 @@ function applyServiceLabel(service, name) {
|
|
|
133978
135915
|
var LOW_BATTERY_THRESHOLD_PCT = 20;
|
|
133979
135916
|
/**
|
|
133980
135917
|
* Mapping:
|
|
133981
|
-
* - `BatteryStatus.
|
|
135918
|
+
* - `BatteryStatus.level` (0..100) → `Characteristic.BatteryLevel`
|
|
133982
135919
|
* - `BatteryStatus.charging`:
|
|
133983
135920
|
* `'none'` → `ChargingState.NOT_CHARGING`
|
|
133984
135921
|
* `'dc' | 'solar'` → `ChargingState.CHARGING`
|
|
@@ -133986,12 +135923,12 @@ var LOW_BATTERY_THRESHOLD_PCT = 20;
|
|
|
133986
135923
|
* either value would be a claim
|
|
133987
135924
|
* - `percentage <= LOW_BATTERY_THRESHOLD_PCT` → `StatusLowBattery.LOW`
|
|
133988
135925
|
*/
|
|
133989
|
-
var batteryCharacteristicUpdates = reader(BatteryStatusSchema.pick({
|
|
133990
|
-
if (status.
|
|
135926
|
+
var batteryCharacteristicUpdates = reader(BatteryStatusSchema.pick({ level: true }).extend({ charging: BatteryStatusSchema.shape.charging.optional() }), (status) => {
|
|
135927
|
+
if (status.level === null) return status.charging === void 0 || status.charging === "unknown" ? [] : [{
|
|
133991
135928
|
characteristic: import_dist.Characteristic.ChargingState,
|
|
133992
135929
|
value: status.charging === "none" ? import_dist.Characteristic.ChargingState.NOT_CHARGING : import_dist.Characteristic.ChargingState.CHARGING
|
|
133993
135930
|
}];
|
|
133994
|
-
const pct = Math.max(0, Math.min(100, Math.round(status.
|
|
135931
|
+
const pct = Math.max(0, Math.min(100, Math.round(status.level)));
|
|
133995
135932
|
return [
|
|
133996
135933
|
{
|
|
133997
135934
|
characteristic: import_dist.Characteristic.BatteryLevel,
|
|
@@ -134093,7 +136030,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134093
136030
|
}
|
|
134094
136031
|
if (useLightbulb) try {
|
|
134095
136032
|
const status = await proxy.brightness?.getStatus({});
|
|
134096
|
-
if (status && typeof status.
|
|
136033
|
+
if (status && typeof status.level === "number") service.updateCharacteristic(import_dist.Characteristic.Brightness, status.level);
|
|
134097
136034
|
} catch (err) {
|
|
134098
136035
|
log.debug("export-hap: child brightness.getStatus failed (non-fatal)", { meta: { error: errMsg$13(err) } });
|
|
134099
136036
|
}
|
|
@@ -134112,7 +136049,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134112
136049
|
const percentage = typeof value === "number" ? value : Number(value);
|
|
134113
136050
|
if (!Number.isFinite(percentage)) return;
|
|
134114
136051
|
try {
|
|
134115
|
-
await proxy.brightness?.setBrightness({ percentage });
|
|
136052
|
+
await proxy.brightness?.setBrightness({ level: percentage });
|
|
134116
136053
|
} catch (err) {
|
|
134117
136054
|
log.warn("export-hap: child brightness.setBrightness failed", { meta: {
|
|
134118
136055
|
percentage,
|
|
@@ -134129,7 +136066,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134129
136066
|
}
|
|
134130
136067
|
if (useLightbulb && proxy.state.brightness) {
|
|
134131
136068
|
const unsubBrightness = proxy.state.brightness.subscribe((value) => {
|
|
134132
|
-
if (value && typeof value.
|
|
136069
|
+
if (value && typeof value.level === "number") service.updateCharacteristic(import_dist.Characteristic.Brightness, value.level);
|
|
134133
136070
|
});
|
|
134134
136071
|
unsubscribes.push(unsubBrightness);
|
|
134135
136072
|
}
|
|
@@ -134675,9 +136612,9 @@ var SENSOR_SPECS = {
|
|
|
134675
136612
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.TemperatureSensor, name, subtype),
|
|
134676
136613
|
getStatus: (proxy) => proxy.temperatureSensor?.getStatus({}),
|
|
134677
136614
|
subscribe: (proxy, onValue) => proxy.state.temperatureSensor?.subscribe(onValue) ?? null,
|
|
134678
|
-
read: reader(TemperatureSensorStatusSchema.pick({
|
|
136615
|
+
read: reader(TemperatureSensorStatusSchema.pick({ temperature: true }), (status) => status.temperature === null ? [] : [{
|
|
134679
136616
|
characteristic: import_dist.Characteristic.CurrentTemperature,
|
|
134680
|
-
value: status.
|
|
136617
|
+
value: status.temperature
|
|
134681
136618
|
}])
|
|
134682
136619
|
},
|
|
134683
136620
|
"humidity-sensor": {
|
|
@@ -134685,9 +136622,9 @@ var SENSOR_SPECS = {
|
|
|
134685
136622
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.HumiditySensor, name, subtype),
|
|
134686
136623
|
getStatus: (proxy) => proxy.humiditySensor?.getStatus({}),
|
|
134687
136624
|
subscribe: (proxy, onValue) => proxy.state.humiditySensor?.subscribe(onValue) ?? null,
|
|
134688
|
-
read: reader(HumiditySensorStatusSchema.pick({
|
|
136625
|
+
read: reader(HumiditySensorStatusSchema.pick({ humidity: true }), (status) => status.humidity === null ? [] : [{
|
|
134689
136626
|
characteristic: import_dist.Characteristic.CurrentRelativeHumidity,
|
|
134690
|
-
value: status.
|
|
136627
|
+
value: status.humidity
|
|
134691
136628
|
}])
|
|
134692
136629
|
},
|
|
134693
136630
|
"ambient-light-sensor": {
|
|
@@ -134695,9 +136632,9 @@ var SENSOR_SPECS = {
|
|
|
134695
136632
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.LightSensor, name, subtype),
|
|
134696
136633
|
getStatus: (proxy) => proxy.ambientLightSensor?.getStatus({}),
|
|
134697
136634
|
subscribe: (proxy, onValue) => proxy.state.ambientLightSensor?.subscribe(onValue) ?? null,
|
|
134698
|
-
read: reader(AmbientLightSensorStatusSchema.pick({
|
|
136635
|
+
read: reader(AmbientLightSensorStatusSchema.pick({ illuminance: true }), (status) => status.illuminance === null ? [] : [{
|
|
134699
136636
|
characteristic: import_dist.Characteristic.CurrentAmbientLightLevel,
|
|
134700
|
-
value: Math.max(MIN_LUX, status.
|
|
136637
|
+
value: Math.max(MIN_LUX, status.illuminance)
|
|
134701
136638
|
}])
|
|
134702
136639
|
}
|
|
134703
136640
|
};
|
|
@@ -151080,6 +153017,7 @@ var DEFAULT_CONFIG = {
|
|
|
151080
153017
|
uuid: ""
|
|
151081
153018
|
},
|
|
151082
153019
|
exposed: [],
|
|
153020
|
+
exposedActions: [],
|
|
151083
153021
|
exportSyncState: {}
|
|
151084
153022
|
};
|
|
151085
153023
|
var BANNED_PINCODES = new Set([
|
|
@@ -151121,6 +153059,8 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151121
153059
|
/** The bridge setup code pairs a controller: a credential, kept in the keychain (D787). */
|
|
151122
153060
|
secretStatePaths = ["identity.pincode"];
|
|
151123
153061
|
exposed = /* @__PURE__ */ new Map();
|
|
153062
|
+
/** The exported actions — switches beside the devices (D968). */
|
|
153063
|
+
actionExports = null;
|
|
151124
153064
|
lastError;
|
|
151125
153065
|
/** Shared HAP setup code applied to every published accessory. */
|
|
151126
153066
|
pincode = "";
|
|
@@ -151233,7 +153173,31 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151233
153173
|
log.warn("export-hap: failed to re-attach mapper on boot", { meta: { error: errMsg(err) } });
|
|
151234
153174
|
}
|
|
151235
153175
|
}
|
|
153176
|
+
this.actionExports = new ActionExports({
|
|
153177
|
+
api: this.ctx.api,
|
|
153178
|
+
logger: this.ctx.logger,
|
|
153179
|
+
publish: async (accessory) => {
|
|
153180
|
+
if (this.bridgeHost !== null && await this.bridgeHost.add(accessory)) return;
|
|
153181
|
+
await publishStandalone(accessory, {
|
|
153182
|
+
pincode: this.pincode,
|
|
153183
|
+
port: 0,
|
|
153184
|
+
bind: this.bind,
|
|
153185
|
+
logger: this.ctx.logger
|
|
153186
|
+
});
|
|
153187
|
+
},
|
|
153188
|
+
unpublish: async (accessory) => {
|
|
153189
|
+
if (this.bridgeHost?.holds(accessory) === true) {
|
|
153190
|
+
this.bridgeHost.remove(accessory);
|
|
153191
|
+
return;
|
|
153192
|
+
}
|
|
153193
|
+
await unpublishAccessory(accessory, this.ctx.logger);
|
|
153194
|
+
},
|
|
153195
|
+
persist: (entries) => this.updateGlobalSettings({ exposedActions: [...entries] })
|
|
153196
|
+
}, this.config.exposedActions ?? []);
|
|
153197
|
+
await this.actionExports.attachAll();
|
|
153198
|
+
await this.actionExports.reconcile();
|
|
151236
153199
|
this.ctx.addDisposer(async () => {
|
|
153200
|
+
await this.actionExports?.dispose();
|
|
151237
153201
|
await this.detachAll();
|
|
151238
153202
|
await this.bridgeHost?.dispose();
|
|
151239
153203
|
});
|
|
@@ -151264,6 +153228,27 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151264
153228
|
}),
|
|
151265
153229
|
exposeDevice: async ({ deviceId, capabilities }) => this.exposeDevice(deviceId, capabilities),
|
|
151266
153230
|
unexposeDevice: async ({ deviceId }) => this.unexposeDevice(deviceId),
|
|
153231
|
+
listSupportedEntityKinds: async () => ["device", "action"],
|
|
153232
|
+
listExposedEntities: async () => {
|
|
153233
|
+
await this.actionExports?.reconcile();
|
|
153234
|
+
return [...Array.from(this.exposed.entries()).map(([deviceId, m]) => ({
|
|
153235
|
+
entity: {
|
|
153236
|
+
kind: "device",
|
|
153237
|
+
deviceId
|
|
153238
|
+
},
|
|
153239
|
+
exposedAs: m.accessory.displayName
|
|
153240
|
+
})), ...this.actionExports?.list() ?? []];
|
|
153241
|
+
},
|
|
153242
|
+
exposeEntity: async ({ entity }) => {
|
|
153243
|
+
if (entity.kind === "device") return this.exposeDevice(entity.deviceId);
|
|
153244
|
+
if (entity.kind === "action") return this.requireActionExports().expose(entity.actionId);
|
|
153245
|
+
throw new Error("export-hap: a notification target cannot be exported to HomeKit");
|
|
153246
|
+
},
|
|
153247
|
+
unexposeEntity: async ({ entity }) => {
|
|
153248
|
+
if (entity.kind === "device") return this.unexposeDevice(entity.deviceId);
|
|
153249
|
+
if (entity.kind === "action") return this.requireActionExports().unexpose(entity.actionId);
|
|
153250
|
+
throw new Error("export-hap: a notification target cannot be exported to HomeKit");
|
|
153251
|
+
},
|
|
151267
153252
|
getDeviceSettingsContribution: (input) => this.buildDeviceSettingsContribution(input.deviceId),
|
|
151268
153253
|
getDeviceLiveContribution: async () => null,
|
|
151269
153254
|
applyDeviceSettingsPatch: (input) => this.applyDeviceSettingsPatch(input.deviceId, input.patch)
|
|
@@ -151469,6 +153454,10 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151469
153454
|
this.ctx.logger.withTags({ deviceId: Number.parseInt(deviceId, 10) }).warn("export-hap: mapper dispose failed", { meta: { error: errMsg(err) } });
|
|
151470
153455
|
});
|
|
151471
153456
|
}
|
|
153457
|
+
requireActionExports() {
|
|
153458
|
+
if (this.actionExports === null) throw new Error("export-hap: addon is not initialised");
|
|
153459
|
+
return this.actionExports;
|
|
153460
|
+
}
|
|
151472
153461
|
async detachAll() {
|
|
151473
153462
|
const ids = Array.from(this.exposed.keys());
|
|
151474
153463
|
for (const id of ids) await this.detachMapper(id);
|