@camstack/addon-export-hap 1.2.185 → 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 +6 -0
- package/dist/hap-export.addon.js +1928 -547
- package/dist/hap-export.addon.mjs +1928 -547
- package/package.json +1 -1
|
@@ -1381,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-
|
|
|
1381
1381
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
1382
1382
|
*
|
|
1383
1383
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
1384
|
-
var uuid$
|
|
1384
|
+
var uuid$4 = (version) => {
|
|
1385
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)$/;
|
|
1386
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})$`);
|
|
1387
1387
|
};
|
|
@@ -1951,8 +1951,8 @@ var $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1951
1951
|
v8: 8
|
|
1952
1952
|
}[def.version];
|
|
1953
1953
|
if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1954
|
-
def.pattern ?? (def.pattern = uuid$
|
|
1955
|
-
} else def.pattern ?? (def.pattern = uuid$
|
|
1954
|
+
def.pattern ?? (def.pattern = uuid$4(v));
|
|
1955
|
+
} else def.pattern ?? (def.pattern = uuid$4());
|
|
1956
1956
|
$ZodStringFormat.init(inst, def);
|
|
1957
1957
|
});
|
|
1958
1958
|
var $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
@@ -5108,6 +5108,14 @@ function object(shape, params) {
|
|
|
5108
5108
|
...normalizeParams(params)
|
|
5109
5109
|
});
|
|
5110
5110
|
}
|
|
5111
|
+
function strictObject(shape, params) {
|
|
5112
|
+
return new ZodObject({
|
|
5113
|
+
type: "object",
|
|
5114
|
+
shape,
|
|
5115
|
+
catchall: never(),
|
|
5116
|
+
...normalizeParams(params)
|
|
5117
|
+
});
|
|
5118
|
+
}
|
|
5111
5119
|
function looseObject(shape, params) {
|
|
5112
5120
|
return new ZodObject({
|
|
5113
5121
|
type: "object",
|
|
@@ -5487,7 +5495,7 @@ var ZodIssueCode = {
|
|
|
5487
5495
|
var ZodFirstPartyTypeKind;
|
|
5488
5496
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5489
5497
|
//#endregion
|
|
5490
|
-
//#region ../types/dist/sleep-
|
|
5498
|
+
//#region ../types/dist/sleep-6eG9C8Xl.mjs
|
|
5491
5499
|
/**
|
|
5492
5500
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5493
5501
|
* window to float samples (D455).
|
|
@@ -8375,65 +8383,6 @@ var MODEL_FORMATS = [
|
|
|
8375
8383
|
"pt",
|
|
8376
8384
|
"gguf"
|
|
8377
8385
|
];
|
|
8378
|
-
/**
|
|
8379
|
-
* Per-call node pinning for `ctx.api` capability calls.
|
|
8380
|
-
*
|
|
8381
|
-
* A capability call normally resolves to its DEFAULT provider — a `singleton`
|
|
8382
|
-
* cap resolves to the hub, a device-scoped cap to the device's owning node. To
|
|
8383
|
-
* query a SPECIFIC node's provider instead (e.g. a remote agent's own
|
|
8384
|
-
* in-process `platform-probe` hardware, which the hub cannot probe), pin the
|
|
8385
|
-
* call to that node.
|
|
8386
|
-
*
|
|
8387
|
-
* The nodeId rides OUT-OF-BAND in the tRPC call context (NOT in the validated
|
|
8388
|
-
* method args), so capability method signatures stay `nodeId`-free — node
|
|
8389
|
-
* targeting is a property of the CALL, not of the method. The transport lifts
|
|
8390
|
-
* it from `op.context` onto the `CapCallInput.nodeId` field (`ipcParentLink`),
|
|
8391
|
-
* and the hub parent's `onUnownedCall` passes it to the `CapRouteResolver`,
|
|
8392
|
-
* which classifies a pinned agent node as `agent-child-forward`
|
|
8393
|
-
* (`$agent-cap-fwd.forward` → the agent's in-process provider).
|
|
8394
|
-
*
|
|
8395
|
-
* Usage at a call site:
|
|
8396
|
-
*
|
|
8397
|
-
* await api.platformProbe.getCapabilities.query(undefined, nodePin(nodeId))
|
|
8398
|
-
*/
|
|
8399
|
-
/** tRPC `op.context` key carrying a per-call node pin. */
|
|
8400
|
-
var CAP_NODE_PIN_CONTEXT_KEY = "__camstackNodePin";
|
|
8401
|
-
/**
|
|
8402
|
-
* Build the tRPC request options that pin a single capability call to `nodeId`.
|
|
8403
|
-
* Pass as the second argument to `.query(input, …)` / `.mutate(input, …)`.
|
|
8404
|
-
*
|
|
8405
|
-
* ## The id is normalised here, and it has to be
|
|
8406
|
-
*
|
|
8407
|
-
* A forked addon reads its own node from `ctx.kernel.localNodeId`, and inside a
|
|
8408
|
-
* worker that value is a RUNNER id — `hub/export-hap`, not `hub`. Routing
|
|
8409
|
-
* compares a pin against real node ids, so such a pin matches nothing and the
|
|
8410
|
-
* call fails with `no provider registered for cap "…"`. The local-first
|
|
8411
|
-
* resolver already guarded against this (`localNodeId.split('/')[0]`), which
|
|
8412
|
-
* made the hazard invisible: unpinned calls worked, and only an explicit pin —
|
|
8413
|
-
* the thing you reach for when you specifically need THIS node — silently
|
|
8414
|
-
* addressed a node that does not exist.
|
|
8415
|
-
*
|
|
8416
|
-
* Cost of it being missing: `addon-export-hap` pinned `decoder.getInfo` to its
|
|
8417
|
-
* own node to read the host's hardware-decode backend. It never once answered,
|
|
8418
|
-
* so every HomeKit egress transcode decoded in SOFTWARE — including 4K H.265 —
|
|
8419
|
-
* while D67's whole premise was that the decoder addon is the authority on
|
|
8420
|
-
* hardware. The warn said `decoding in SOFTWARE` and read as "this node has no
|
|
8421
|
-
* hardware", which was false.
|
|
8422
|
-
*
|
|
8423
|
-
* Normalising in the ONE constructor fixes every caller at once, which is why
|
|
8424
|
-
* it is here and not at the call sites.
|
|
8425
|
-
*/
|
|
8426
|
-
function nodePin(nodeId) {
|
|
8427
|
-
return { context: { [CAP_NODE_PIN_CONTEXT_KEY]: toNodeId(nodeId) } };
|
|
8428
|
-
}
|
|
8429
|
-
/**
|
|
8430
|
-
* A runner id is `<nodeId>/<addonId>`; a node id has no slash. Taking the head
|
|
8431
|
-
* is idempotent, so passing an already-clean id costs nothing.
|
|
8432
|
-
*/
|
|
8433
|
-
function toNodeId(idOrRunnerId) {
|
|
8434
|
-
const head = idOrRunnerId.split("/")[0];
|
|
8435
|
-
return head === void 0 || head.length === 0 ? idOrRunnerId : head;
|
|
8436
|
-
}
|
|
8437
8386
|
object({
|
|
8438
8387
|
field: string().min(1),
|
|
8439
8388
|
on: literal("advance")
|
|
@@ -8522,9 +8471,135 @@ function optionalMethod(input, output, options) {
|
|
|
8522
8471
|
providerOptional: true
|
|
8523
8472
|
};
|
|
8524
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" });
|
|
8525
8579
|
var StaticDirOutputSchema$1 = object({ staticDir: string() });
|
|
8526
8580
|
var VersionOutputSchema$1 = object({ version: string() });
|
|
8527
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();
|
|
8528
8603
|
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
8529
8604
|
var VersionOutputSchema = object({ version: string() });
|
|
8530
8605
|
method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
|
|
@@ -8680,6 +8755,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8680
8755
|
"image-settings",
|
|
8681
8756
|
"integrations",
|
|
8682
8757
|
"intercom",
|
|
8758
|
+
"ir-transmitter",
|
|
8683
8759
|
"keychain",
|
|
8684
8760
|
"keychain-admin",
|
|
8685
8761
|
"lawn-mower-control",
|
|
@@ -8708,6 +8784,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8708
8784
|
"network-link",
|
|
8709
8785
|
"network-quality",
|
|
8710
8786
|
"node-certificates",
|
|
8787
|
+
"node-removal-hook",
|
|
8711
8788
|
"nodes",
|
|
8712
8789
|
"notification-output",
|
|
8713
8790
|
"notification-rules",
|
|
@@ -8718,6 +8795,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8718
8795
|
"osd",
|
|
8719
8796
|
"osd-manager",
|
|
8720
8797
|
"pet-feeder",
|
|
8798
|
+
"pet-fountain",
|
|
8721
8799
|
"pipeline-analytics",
|
|
8722
8800
|
"pipeline-executor",
|
|
8723
8801
|
"pipeline-orchestrator",
|
|
@@ -8738,6 +8816,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8738
8816
|
"recording-onboard",
|
|
8739
8817
|
"recording-signal",
|
|
8740
8818
|
"records",
|
|
8819
|
+
"remote",
|
|
8741
8820
|
"running-state",
|
|
8742
8821
|
"scene-monitor",
|
|
8743
8822
|
"script-runner",
|
|
@@ -8761,6 +8840,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8761
8840
|
"system",
|
|
8762
8841
|
"tamper",
|
|
8763
8842
|
"temperature-sensor",
|
|
8843
|
+
"template",
|
|
8764
8844
|
"terminal-session",
|
|
8765
8845
|
"toast",
|
|
8766
8846
|
"training",
|
|
@@ -9701,6 +9781,11 @@ Object.freeze({
|
|
|
9701
9781
|
"standby"
|
|
9702
9782
|
]
|
|
9703
9783
|
},
|
|
9784
|
+
{
|
|
9785
|
+
"path": "stateSource",
|
|
9786
|
+
"valueType": "enum",
|
|
9787
|
+
"enumValues": ["reported", "assumed"]
|
|
9788
|
+
},
|
|
9704
9789
|
{
|
|
9705
9790
|
"path": "volumeLevel",
|
|
9706
9791
|
"valueType": "number"
|
|
@@ -9927,6 +10012,11 @@ Object.freeze({
|
|
|
9927
10012
|
"path": "batteryPower",
|
|
9928
10013
|
"valueType": "number"
|
|
9929
10014
|
},
|
|
10015
|
+
{
|
|
10016
|
+
"path": "powerSource",
|
|
10017
|
+
"valueType": "enum",
|
|
10018
|
+
"enumValues": ["mains", "battery"]
|
|
10019
|
+
},
|
|
9930
10020
|
{
|
|
9931
10021
|
"path": "desiccantLeftDays",
|
|
9932
10022
|
"valueType": "number"
|
|
@@ -9971,6 +10061,68 @@ Object.freeze({
|
|
|
9971
10061
|
{
|
|
9972
10062
|
"path": "volume",
|
|
9973
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"
|
|
9974
10126
|
}
|
|
9975
10127
|
],
|
|
9976
10128
|
"power-meter": [
|
|
@@ -10510,7 +10662,7 @@ object({
|
|
|
10510
10662
|
params: record(string(), union([string(), number()])).optional()
|
|
10511
10663
|
});
|
|
10512
10664
|
//#endregion
|
|
10513
|
-
//#region ../types/dist/err-msg-
|
|
10665
|
+
//#region ../types/dist/err-msg-DWXWc0Di.mjs
|
|
10514
10666
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10515
10667
|
DeviceType["Camera"] = "camera";
|
|
10516
10668
|
DeviceType["Hub"] = "hub";
|
|
@@ -10602,6 +10754,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10602
10754
|
* native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
|
|
10603
10755
|
* integrations sharing the same food/desiccant/hopper surface. */
|
|
10604
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";
|
|
10605
10761
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10606
10762
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10607
10763
|
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
@@ -10856,6 +11012,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
10856
11012
|
/** Fallback when the notifier service name doesn't match a known
|
|
10857
11013
|
* pattern. */
|
|
10858
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";
|
|
10859
11018
|
return DeviceRole;
|
|
10860
11019
|
}({});
|
|
10861
11020
|
/**
|
|
@@ -10863,13 +11022,13 @@ import { errMsg } from '@camstack/types'
|
|
|
10863
11022
|
* Extract a human-readable message from an unknown error value.
|
|
10864
11023
|
* Replaces the ubiquitous `errMsg(err)` pattern.
|
|
10865
11024
|
*/
|
|
10866
|
-
function errMsg$
|
|
11025
|
+
function errMsg$17(err) {
|
|
10867
11026
|
if (err instanceof Error) return err.message;
|
|
10868
11027
|
if (typeof err === "string") return err;
|
|
10869
11028
|
return String(err);
|
|
10870
11029
|
}
|
|
10871
11030
|
//#endregion
|
|
10872
|
-
//#region ../types/dist/composition-
|
|
11031
|
+
//#region ../types/dist/composition-kSuOifuG.mjs
|
|
10873
11032
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
10874
11033
|
opus: "libopus",
|
|
10875
11034
|
aac: "aac",
|
|
@@ -12549,12 +12708,28 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
12549
12708
|
])
|
|
12550
12709
|
})
|
|
12551
12710
|
]);
|
|
12552
|
-
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({
|
|
12553
12726
|
kind: literal("forward"),
|
|
12554
12727
|
source: CompositionSourceRefSchema,
|
|
12555
12728
|
cap: string().min(1),
|
|
12556
|
-
method: string().min(1)
|
|
12557
|
-
|
|
12729
|
+
method: string().min(1),
|
|
12730
|
+
args: record(string().min(1), CompositionForwardArgSchema).optional()
|
|
12731
|
+
});
|
|
12732
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
|
|
12558
12733
|
/** An item key inside an item-array cap (`consumables.items[<key>]`). */
|
|
12559
12734
|
var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
12560
12735
|
/**
|
|
@@ -12564,7 +12739,13 @@ var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
|
12564
12739
|
*/
|
|
12565
12740
|
var CompositionItemEntrySchema = object({
|
|
12566
12741
|
label: string().min(1).max(80),
|
|
12567
|
-
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()
|
|
12568
12749
|
});
|
|
12569
12750
|
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
12570
12751
|
kind: literal("fields"),
|
|
@@ -12576,7 +12757,7 @@ var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
|
12576
12757
|
* owns the WHOLE array field: the composed value holds exactly these items.
|
|
12577
12758
|
*/
|
|
12578
12759
|
items: record(string().regex(COMPOSITION_ITEM_KEY_RE), CompositionItemEntrySchema).refine((items) => Object.keys(items).length <= 16, { message: `at most 16 items` }).optional(),
|
|
12579
|
-
/**
|
|
12760
|
+
/** Method name → what serves it. Only a BUILT capability takes commands (D967). */
|
|
12580
12761
|
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
12581
12762
|
}), object({
|
|
12582
12763
|
kind: literal("passthrough"),
|
|
@@ -16740,6 +16921,510 @@ object({
|
|
|
16740
16921
|
lastError: string().nullable()
|
|
16741
16922
|
});
|
|
16742
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
|
+
}
|
|
17427
|
+
/**
|
|
16743
17428
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
16744
17429
|
* surface that admin-ui consumes through `useAddonPagesListPages()`.
|
|
16745
17430
|
*
|
|
@@ -16771,52 +17456,6 @@ var AddonPageInfoSchema = object({
|
|
|
16771
17456
|
bundleUrl: string()
|
|
16772
17457
|
});
|
|
16773
17458
|
method(_void(), array(AddonPageInfoSchema).readonly());
|
|
16774
|
-
/**
|
|
16775
|
-
* `addon-pages-source` — collection cap exposing per-provider raw page
|
|
16776
|
-
* declarations. Every addon that contributes a UI page registers a
|
|
16777
|
-
* provider here. The hub-side singleton aggregator (`addon-pages` cap,
|
|
16778
|
-
* see `addon-pages.cap.ts`) walks this collection, stamps versioned
|
|
16779
|
-
* `bundleUrl` values, and returns the enriched `AddonPageInfo[]` list
|
|
16780
|
-
* that admin-ui consumes.
|
|
16781
|
-
*
|
|
16782
|
-
* The split exists because the public listing has a different output
|
|
16783
|
-
* shape than the per-provider raw declarations, and we want both ends
|
|
16784
|
-
* to flow through codegen instead of relying on a hand-written wrapper.
|
|
16785
|
-
*/
|
|
16786
|
-
var AddonPageDeclarationSchema = object({
|
|
16787
|
-
id: string(),
|
|
16788
|
-
label: string(),
|
|
16789
|
-
icon: string(),
|
|
16790
|
-
path: string(),
|
|
16791
|
-
/**
|
|
16792
|
-
* Module Federation remote name — must match the `name` field on the
|
|
16793
|
-
* page addon's `federation()` plugin config. Used by admin-ui's
|
|
16794
|
-
* `<AddonPageLoader>` to call `loadRemote('<remoteName>/page')`.
|
|
16795
|
-
* Conventionally `addon_<id>_page` (snake_case; MF names cannot
|
|
16796
|
-
* contain hyphens).
|
|
16797
|
-
*/
|
|
16798
|
-
remoteName: string(),
|
|
16799
|
-
/**
|
|
16800
|
-
* Bundle filename inside the addon's `dist/` dir served at
|
|
16801
|
-
* `/api/addon-pages/<addonId>/<bundle>`. With Module Federation this
|
|
16802
|
-
* is always `'remoteEntry.js'`; the value is kept on the metadata so
|
|
16803
|
-
* the static-file route can compute an mtime-based cache-buster URL
|
|
16804
|
-
* without a separate filesystem stat.
|
|
16805
|
-
*/
|
|
16806
|
-
bundle: string(),
|
|
16807
|
-
/**
|
|
16808
|
-
* Sidebar section this page docks into. Well-known ids: `'detection'`,
|
|
16809
|
-
* `'cluster'`, `'administration'` — the page renders inside that group.
|
|
16810
|
-
* Any OTHER string creates (or joins) a custom section rendered after
|
|
16811
|
-
* the built-in groups; its label comes from `sectionLabel` (first
|
|
16812
|
-
* declaration wins), falling back to the id. Absent → the legacy
|
|
16813
|
-
* "Addon Pages" group.
|
|
16814
|
-
*/
|
|
16815
|
-
section: string().optional(),
|
|
16816
|
-
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
16817
|
-
sectionLabel: string().optional()
|
|
16818
|
-
});
|
|
16819
|
-
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
16820
17459
|
var AddonHttpRouteSchema = object({
|
|
16821
17460
|
method: _enum([
|
|
16822
17461
|
"GET",
|
|
@@ -17098,9 +17737,21 @@ var AlertSeveritySchema = _enum([
|
|
|
17098
17737
|
"error",
|
|
17099
17738
|
"critical"
|
|
17100
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). */
|
|
17101
17751
|
var AlertActionSchema = object({
|
|
17102
17752
|
label: string(),
|
|
17103
17753
|
href: string().optional(),
|
|
17754
|
+
invoke: AlertActionInvokeSchema.optional(),
|
|
17104
17755
|
/**
|
|
17105
17756
|
* How `href` is followed. Absent / `app`: an admin-ui route (client-side).
|
|
17106
17757
|
* `server`: a route the HUB serves (an addon HTTP route such as an OAuth
|
|
@@ -19347,7 +19998,11 @@ var CompositionProblemSchema = object({
|
|
|
19347
19998
|
"mixed-quantity",
|
|
19348
19999
|
"helper-mismatch",
|
|
19349
20000
|
"member-constraint",
|
|
19350
|
-
"retention"
|
|
20001
|
+
"retention",
|
|
20002
|
+
"command-method-unknown",
|
|
20003
|
+
"command-source-unknown",
|
|
20004
|
+
"command-input-unknown",
|
|
20005
|
+
"command-input-missing"
|
|
19351
20006
|
]),
|
|
19352
20007
|
path: string(),
|
|
19353
20008
|
message: string()
|
|
@@ -19386,7 +20041,9 @@ var CompositionFieldRoleSchema = _enum([
|
|
|
19386
20041
|
var CompositionFieldItemSchema = object({
|
|
19387
20042
|
arrayPath: string(),
|
|
19388
20043
|
key: string(),
|
|
19389
|
-
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()
|
|
19390
20047
|
});
|
|
19391
20048
|
var CompositionFieldPlanSchema = object({
|
|
19392
20049
|
cap: string(),
|
|
@@ -19591,7 +20248,7 @@ Object.freeze({
|
|
|
19591
20248
|
* One catalog row per base reading a group helper can build (D944 §3).
|
|
19592
20249
|
* Data, not a form default written into the block.
|
|
19593
20250
|
*/
|
|
19594
|
-
var NOW$
|
|
20251
|
+
var NOW$3 = {
|
|
19595
20252
|
fieldPath: "lastFetchedAt",
|
|
19596
20253
|
expr: "now"
|
|
19597
20254
|
};
|
|
@@ -19600,12 +20257,13 @@ var CHANGED = {
|
|
|
19600
20257
|
expr: "now"
|
|
19601
20258
|
};
|
|
19602
20259
|
function numeric(input) {
|
|
20260
|
+
const { alsoFrom, ...base } = input;
|
|
19603
20261
|
return {
|
|
19604
|
-
...
|
|
20262
|
+
...base,
|
|
19605
20263
|
family: "numeric",
|
|
19606
20264
|
deviceType: DeviceType.Sensor,
|
|
19607
20265
|
memberDeviceType: DeviceType.Sensor,
|
|
19608
|
-
memberDeviceTypes: [DeviceType.Sensor],
|
|
20266
|
+
memberDeviceTypes: [DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
|
|
19609
20267
|
activeWhen: void 0,
|
|
19610
20268
|
commandCaps: [],
|
|
19611
20269
|
baseUnit: baseUnitOf(input.quantity),
|
|
@@ -19613,9 +20271,10 @@ function numeric(input) {
|
|
|
19613
20271
|
accept: [{
|
|
19614
20272
|
cap: input.outputCap,
|
|
19615
20273
|
fieldPath: input.outputField
|
|
19616
|
-
}]
|
|
20274
|
+
}, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
|
|
19617
20275
|
};
|
|
19618
20276
|
}
|
|
20277
|
+
var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
|
|
19619
20278
|
function binary(input) {
|
|
19620
20279
|
return {
|
|
19621
20280
|
...input,
|
|
@@ -19641,7 +20300,14 @@ var GROUP_TEMPLATES = [
|
|
|
19641
20300
|
quantity: "temperature",
|
|
19642
20301
|
defaultAggregate: "mean",
|
|
19643
20302
|
empty: "null",
|
|
19644
|
-
companions: [NOW$
|
|
20303
|
+
companions: [NOW$3],
|
|
20304
|
+
alsoFrom: {
|
|
20305
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
20306
|
+
accept: {
|
|
20307
|
+
cap: "climate-control",
|
|
20308
|
+
fieldPath: "currentTemp"
|
|
20309
|
+
}
|
|
20310
|
+
}
|
|
19645
20311
|
}),
|
|
19646
20312
|
numeric({
|
|
19647
20313
|
id: "humidity",
|
|
@@ -19652,7 +20318,14 @@ var GROUP_TEMPLATES = [
|
|
|
19652
20318
|
quantity: "humidity",
|
|
19653
20319
|
defaultAggregate: "mean",
|
|
19654
20320
|
empty: "null",
|
|
19655
|
-
companions: [NOW$
|
|
20321
|
+
companions: [NOW$3],
|
|
20322
|
+
alsoFrom: {
|
|
20323
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
20324
|
+
accept: {
|
|
20325
|
+
cap: "climate-control",
|
|
20326
|
+
fieldPath: "currentHumidity"
|
|
20327
|
+
}
|
|
20328
|
+
}
|
|
19656
20329
|
}),
|
|
19657
20330
|
numeric({
|
|
19658
20331
|
id: "pressure",
|
|
@@ -19663,7 +20336,7 @@ var GROUP_TEMPLATES = [
|
|
|
19663
20336
|
quantity: "pressure",
|
|
19664
20337
|
defaultAggregate: "mean",
|
|
19665
20338
|
empty: "null",
|
|
19666
|
-
companions: [NOW$
|
|
20339
|
+
companions: [NOW$3]
|
|
19667
20340
|
}),
|
|
19668
20341
|
numeric({
|
|
19669
20342
|
id: "illuminance",
|
|
@@ -19674,7 +20347,7 @@ var GROUP_TEMPLATES = [
|
|
|
19674
20347
|
quantity: "illuminance",
|
|
19675
20348
|
defaultAggregate: "mean",
|
|
19676
20349
|
empty: "null",
|
|
19677
|
-
companions: [NOW$
|
|
20350
|
+
companions: [NOW$3]
|
|
19678
20351
|
}),
|
|
19679
20352
|
numeric({
|
|
19680
20353
|
id: "power",
|
|
@@ -19685,7 +20358,7 @@ var GROUP_TEMPLATES = [
|
|
|
19685
20358
|
quantity: "power",
|
|
19686
20359
|
defaultAggregate: "sum",
|
|
19687
20360
|
empty: "omit",
|
|
19688
|
-
companions: [NOW$
|
|
20361
|
+
companions: [NOW$3]
|
|
19689
20362
|
}),
|
|
19690
20363
|
numeric({
|
|
19691
20364
|
id: "energy",
|
|
@@ -19696,7 +20369,7 @@ var GROUP_TEMPLATES = [
|
|
|
19696
20369
|
quantity: "energy",
|
|
19697
20370
|
defaultAggregate: "sum",
|
|
19698
20371
|
empty: "omit",
|
|
19699
|
-
companions: [NOW$
|
|
20372
|
+
companions: [NOW$3]
|
|
19700
20373
|
}),
|
|
19701
20374
|
numeric({
|
|
19702
20375
|
id: "battery",
|
|
@@ -19731,7 +20404,7 @@ var GROUP_TEMPLATES = [
|
|
|
19731
20404
|
quantity: "device",
|
|
19732
20405
|
defaultAggregate: "mean",
|
|
19733
20406
|
empty: "null",
|
|
19734
|
-
companions: [NOW$
|
|
20407
|
+
companions: [NOW$3]
|
|
19735
20408
|
}),
|
|
19736
20409
|
binary({
|
|
19737
20410
|
id: "motion",
|
|
@@ -22133,6 +22806,36 @@ var ExposeInputSchema = object({
|
|
|
22133
22806
|
capabilities: array(string()).optional()
|
|
22134
22807
|
});
|
|
22135
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 });
|
|
22136
22839
|
var deviceExportCapability = {
|
|
22137
22840
|
name: "device-export",
|
|
22138
22841
|
scope: "system",
|
|
@@ -22162,6 +22865,16 @@ var deviceExportCapability = {
|
|
|
22162
22865
|
unexposeDevice: method(UnexposeInputSchema, _void(), {
|
|
22163
22866
|
kind: "mutation",
|
|
22164
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"
|
|
22165
22878
|
})
|
|
22166
22879
|
}
|
|
22167
22880
|
};
|
|
@@ -43304,6 +44017,14 @@ method(object({
|
|
|
43304
44017
|
kind: "mutation",
|
|
43305
44018
|
auth: "admin"
|
|
43306
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
|
+
});
|
|
43307
44028
|
/**
|
|
43308
44029
|
* `device-removal-hook` — the reliable way an addon learns a device was DELETED,
|
|
43309
44030
|
* so it can delete what it keeps for that device (D865).
|
|
@@ -43951,6 +44672,17 @@ var LlmProfileSchema = object({
|
|
|
43951
44672
|
* field in its editor only when its descriptor lists it in `profileFields`. */
|
|
43952
44673
|
topK: number().int().positive().optional(),
|
|
43953
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(),
|
|
43954
44686
|
/** Prompt context window. Advisory for cloud kinds (they enforce their own). */
|
|
43955
44687
|
contextLength: number().int().positive().optional(),
|
|
43956
44688
|
/** Default system prompt. A caller's `system` REPLACES it (never appends —
|
|
@@ -43989,6 +44721,7 @@ var LlmProfileFieldSchema = _enum([
|
|
|
43989
44721
|
"topP",
|
|
43990
44722
|
"topK",
|
|
43991
44723
|
"maxTokens",
|
|
44724
|
+
"reasoningEffort",
|
|
43992
44725
|
"contextLength",
|
|
43993
44726
|
"systemPrompt",
|
|
43994
44727
|
"timeoutMs",
|
|
@@ -44012,7 +44745,7 @@ var LlmProviderWidgetSchema = object({
|
|
|
44012
44745
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
44013
44746
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
44014
44747
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
44015
|
-
var ConfigSchemaPassthrough$
|
|
44748
|
+
var ConfigSchemaPassthrough$2 = unknown();
|
|
44016
44749
|
var LlmProfileKindDescriptorSchema = object({
|
|
44017
44750
|
kind: LlmProfileKindSchema,
|
|
44018
44751
|
label: string(),
|
|
@@ -44021,9 +44754,9 @@ var LlmProfileKindDescriptorSchema = object({
|
|
|
44021
44754
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
44022
44755
|
addonId: string(),
|
|
44023
44756
|
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
44024
|
-
connectionSchema: ConfigSchemaPassthrough$
|
|
44757
|
+
connectionSchema: ConfigSchemaPassthrough$2,
|
|
44025
44758
|
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
44026
|
-
advancedSchema: ConfigSchemaPassthrough$
|
|
44759
|
+
advancedSchema: ConfigSchemaPassthrough$2.optional(),
|
|
44027
44760
|
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
44028
44761
|
features: LlmModelFeaturesSchema,
|
|
44029
44762
|
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
@@ -44549,10 +45282,10 @@ var CpuBreakdownSchema = object({
|
|
|
44549
45282
|
cores: number()
|
|
44550
45283
|
});
|
|
44551
45284
|
var MemoryInfoSchema = object({
|
|
44552
|
-
percent: number(),
|
|
45285
|
+
percent: number().nullable(),
|
|
44553
45286
|
totalBytes: number(),
|
|
44554
|
-
usedBytes: number(),
|
|
44555
|
-
availableBytes: number(),
|
|
45287
|
+
usedBytes: number().nullable(),
|
|
45288
|
+
availableBytes: number().nullable(),
|
|
44556
45289
|
swapUsedBytes: number(),
|
|
44557
45290
|
swapTotalBytes: number()
|
|
44558
45291
|
});
|
|
@@ -44856,8 +45589,9 @@ var GetLoadSeriesInputSchema = object({
|
|
|
44856
45589
|
});
|
|
44857
45590
|
var SystemMetricsSchema = object({
|
|
44858
45591
|
cpuPercent: number(),
|
|
44859
|
-
|
|
44860
|
-
|
|
45592
|
+
/** `null` when the memory sample failed or was not taken yet (D393). */
|
|
45593
|
+
memoryPercent: number().nullable(),
|
|
45594
|
+
memoryUsedMB: number().nullable(),
|
|
44861
45595
|
memoryTotalMB: number(),
|
|
44862
45596
|
diskPercent: number().optional(),
|
|
44863
45597
|
temperature: number().optional(),
|
|
@@ -45093,379 +45827,6 @@ var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
|
|
|
45093
45827
|
sourcePort: number().optional()
|
|
45094
45828
|
});
|
|
45095
45829
|
method(_void(), NetworkEndpointSchema, { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), method(_void(), NetworkEndpointSchema.nullable()), method(_void(), NetworkAccessStatusSchema), method(_void(), array(NetworkEndpointEntrySchema).readonly());
|
|
45096
|
-
/**
|
|
45097
|
-
* notification-output — canonical, capability-gated notification delivery.
|
|
45098
|
-
*
|
|
45099
|
-
* Apprise-derived model (see
|
|
45100
|
-
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
45101
|
-
* callers emit ONE canonical `Notification`; each provider declares a
|
|
45102
|
-
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
45103
|
-
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
45104
|
-
* message to what the kind supports — callers never special-case a service.
|
|
45105
|
-
*
|
|
45106
|
-
* DESIGN DECISIONS (locked):
|
|
45107
|
-
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
45108
|
-
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
45109
|
-
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
45110
|
-
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
45111
|
-
* alternative would fork the UI per addon and cannot host the
|
|
45112
|
-
* discovery→adopt flow.
|
|
45113
|
-
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
45114
|
-
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
45115
|
-
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
45116
|
-
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
45117
|
-
* `addonId` the generated collection router extracts from the call input.
|
|
45118
|
-
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
45119
|
-
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
45120
|
-
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
45121
|
-
* base64 fallback needed.
|
|
45122
|
-
*
|
|
45123
|
-
* TODO (deferred, closed-set change — separate decision): add
|
|
45124
|
-
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
45125
|
-
* admin "Integrations" page.
|
|
45126
|
-
*/
|
|
45127
|
-
/**
|
|
45128
|
-
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
45129
|
-
* adapter picks what it supports and the degrade engine filters the rest.
|
|
45130
|
-
*/
|
|
45131
|
-
var AttachmentMediaTypeSchema = _enum([
|
|
45132
|
-
"image",
|
|
45133
|
-
"video",
|
|
45134
|
-
"gif",
|
|
45135
|
-
"audio",
|
|
45136
|
-
"icon"
|
|
45137
|
-
]);
|
|
45138
|
-
/**
|
|
45139
|
-
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
45140
|
-
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
45141
|
-
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
45142
|
-
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
45143
|
-
*/
|
|
45144
|
-
var AttachmentSchema = object({
|
|
45145
|
-
mediaType: AttachmentMediaTypeSchema,
|
|
45146
|
-
url: string().optional(),
|
|
45147
|
-
bytes: _instanceof(Uint8Array).optional(),
|
|
45148
|
-
mime: string().optional(),
|
|
45149
|
-
name: string().optional()
|
|
45150
|
-
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
45151
|
-
var NotificationFormatSchema = _enum([
|
|
45152
|
-
"text",
|
|
45153
|
-
"markdown",
|
|
45154
|
-
"html"
|
|
45155
|
-
]);
|
|
45156
|
-
/**
|
|
45157
|
-
* The CLOSED icon vocabulary an action button may use.
|
|
45158
|
-
*
|
|
45159
|
-
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
45160
|
-
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
45161
|
-
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
45162
|
-
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
45163
|
-
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
45164
|
-
*
|
|
45165
|
-
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
45166
|
-
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
45167
|
-
* differently.
|
|
45168
|
-
*
|
|
45169
|
-
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
45170
|
-
*
|
|
45171
|
-
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
45172
|
-
* the whole set onto its own renderer's vocabulary through a
|
|
45173
|
-
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
45174
|
-
* fallback, so adding a member here fails every adapter's build until someone
|
|
45175
|
-
* decides its glyph, which is the only place that decision can be made
|
|
45176
|
-
* honestly.
|
|
45177
|
-
*
|
|
45178
|
-
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
45179
|
-
* `disarm` straight through; iOS feeds that string to
|
|
45180
|
-
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
45181
|
-
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
45182
|
-
* mapping, and "the field is documented" is not "the value renders".
|
|
45183
|
-
*
|
|
45184
|
-
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
45185
|
-
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
45186
|
-
* so an addon that emits a token the running hub does not know does not lose an
|
|
45187
|
-
* icon — its whole `send` fails Zod validation and the notification never
|
|
45188
|
-
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
45189
|
-
*/
|
|
45190
|
-
var NotificationActionIconSchema = _enum([
|
|
45191
|
-
"acknowledge",
|
|
45192
|
-
"dismiss",
|
|
45193
|
-
"silence",
|
|
45194
|
-
"snooze",
|
|
45195
|
-
"view",
|
|
45196
|
-
"play",
|
|
45197
|
-
"open",
|
|
45198
|
-
"close",
|
|
45199
|
-
"lock",
|
|
45200
|
-
"unlock",
|
|
45201
|
-
"arm",
|
|
45202
|
-
"arm-home",
|
|
45203
|
-
"arm-away",
|
|
45204
|
-
"arm-night",
|
|
45205
|
-
"disarm",
|
|
45206
|
-
"light",
|
|
45207
|
-
"alert",
|
|
45208
|
-
"camera"
|
|
45209
|
-
]);
|
|
45210
|
-
/** A single tap-through action button. */
|
|
45211
|
-
var NotificationActionSchema = object({
|
|
45212
|
-
id: string(),
|
|
45213
|
-
label: string(),
|
|
45214
|
-
url: string().optional(),
|
|
45215
|
-
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
45216
|
-
icon: NotificationActionIconSchema.optional(),
|
|
45217
|
-
/**
|
|
45218
|
-
* Renders in a warning style where the notifier supports it.
|
|
45219
|
-
*
|
|
45220
|
-
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
45221
|
-
* else — see `notification-center/action-token.ts` for what that does and
|
|
45222
|
-
* does not buy.
|
|
45223
|
-
*/
|
|
45224
|
-
destructive: boolean().optional(),
|
|
45225
|
-
/**
|
|
45226
|
-
* How the tap should REACH the url.
|
|
45227
|
-
*
|
|
45228
|
-
* `navigate` (absent, and every button authored before this field) opens it:
|
|
45229
|
-
* the phone leaves the notification and shows whatever the callback returns.
|
|
45230
|
-
* That is right for a button whose answer the operator wants to read.
|
|
45231
|
-
*
|
|
45232
|
-
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
45233
|
-
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
45234
|
-
* an answer to the notification, and being thrown into a browser tab to
|
|
45235
|
-
* confirm it costs more attention than the notification did. A backend that
|
|
45236
|
-
* cannot do a background call renders it as an ordinary link (the adapters
|
|
45237
|
-
* fall back rather than dropping the button), so this is a preference, never
|
|
45238
|
-
* a requirement.
|
|
45239
|
-
*/
|
|
45240
|
-
mode: _enum(["navigate", "background"]).optional()
|
|
45241
|
-
});
|
|
45242
|
-
/**
|
|
45243
|
-
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
45244
|
-
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
45245
|
-
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
45246
|
-
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
45247
|
-
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
45248
|
-
* `priority` for that one target.
|
|
45249
|
-
*/
|
|
45250
|
-
var NotificationSchema = object({
|
|
45251
|
-
body: string(),
|
|
45252
|
-
title: string().optional(),
|
|
45253
|
-
format: NotificationFormatSchema.default("text"),
|
|
45254
|
-
priority: number().int().min(1).max(5).default(3),
|
|
45255
|
-
level: string().optional(),
|
|
45256
|
-
attachments: array(AttachmentSchema).optional(),
|
|
45257
|
-
clickUrl: string().optional(),
|
|
45258
|
-
actions: array(NotificationActionSchema).optional(),
|
|
45259
|
-
sound: string().optional(),
|
|
45260
|
-
ttl: number().optional(),
|
|
45261
|
-
tag: string().optional(),
|
|
45262
|
-
deviceId: number().optional(),
|
|
45263
|
-
eventId: string().optional(),
|
|
45264
|
-
metadata: record(string(), unknown()).optional()
|
|
45265
|
-
});
|
|
45266
|
-
/** One declared native severity/priority level for a kind. */
|
|
45267
|
-
var TargetKindLevelSchema = object({
|
|
45268
|
-
id: string(),
|
|
45269
|
-
label: string(),
|
|
45270
|
-
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
45271
|
-
ordinal: number().int().min(1).max(5).nullable(),
|
|
45272
|
-
flags: object({
|
|
45273
|
-
critical: boolean().optional(),
|
|
45274
|
-
silent: boolean().optional(),
|
|
45275
|
-
noPush: boolean().optional()
|
|
45276
|
-
}).optional(),
|
|
45277
|
-
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
45278
|
-
requires: array(string()).optional(),
|
|
45279
|
-
description: string().optional()
|
|
45280
|
-
});
|
|
45281
|
-
/** The full capability block consulted before dispatch. */
|
|
45282
|
-
var TargetKindCapsSchema = object({
|
|
45283
|
-
attachments: object({
|
|
45284
|
-
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
45285
|
-
mode: _enum([
|
|
45286
|
-
"url",
|
|
45287
|
-
"bytes",
|
|
45288
|
-
"both"
|
|
45289
|
-
]),
|
|
45290
|
-
max: number().int().nonnegative(),
|
|
45291
|
-
maxBytes: number().int().positive().optional()
|
|
45292
|
-
}),
|
|
45293
|
-
/** Max action buttons (0 = none). */
|
|
45294
|
-
actions: number().int().nonnegative(),
|
|
45295
|
-
/**
|
|
45296
|
-
* Whether this kind renders a per-action ICON.
|
|
45297
|
-
*
|
|
45298
|
-
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
45299
|
-
* run on the addon cap path — three production failures in one day taught
|
|
45300
|
-
* this repo that once. Absent is read as false by the degrade engine, which
|
|
45301
|
-
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
45302
|
-
* assumed and dropped costs the operator's trust in the field.
|
|
45303
|
-
*/
|
|
45304
|
-
actionIcons: boolean().optional(),
|
|
45305
|
-
levels: array(TargetKindLevelSchema),
|
|
45306
|
-
format: array(NotificationFormatSchema),
|
|
45307
|
-
clickUrl: boolean(),
|
|
45308
|
-
sound: boolean(),
|
|
45309
|
-
ttl: boolean(),
|
|
45310
|
-
bodyMaxLen: number().int().positive()
|
|
45311
|
-
});
|
|
45312
|
-
/**
|
|
45313
|
-
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
45314
|
-
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
45315
|
-
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
45316
|
-
* the union is large and not meant for runtime validation here; the exported
|
|
45317
|
-
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
45318
|
-
*/
|
|
45319
|
-
var ConfigSchemaPassthrough$2 = unknown();
|
|
45320
|
-
var TargetKindSchema = object({
|
|
45321
|
-
kind: string(),
|
|
45322
|
-
label: string(),
|
|
45323
|
-
icon: string(),
|
|
45324
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
45325
|
-
addonId: string(),
|
|
45326
|
-
/**
|
|
45327
|
-
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
45328
|
-
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
45329
|
-
* when the addon bundles no icon for that kind — the client then falls back
|
|
45330
|
-
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
45331
|
-
*
|
|
45332
|
-
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
45333
|
-
* client, and a native client joins it onto its own hub base.
|
|
45334
|
-
*
|
|
45335
|
-
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
45336
|
-
* field that survived only because the runtime cap-router forwards provider
|
|
45337
|
-
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
45338
|
-
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
45339
|
-
* broken silently the moment output validation was tightened anywhere.
|
|
45340
|
-
*/
|
|
45341
|
-
iconUrl: string().optional(),
|
|
45342
|
-
/**
|
|
45343
|
-
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
45344
|
-
*
|
|
45345
|
-
* The server knows this and therefore says it, because the client cannot
|
|
45346
|
-
* safely guess: a React-Native client renders SVG and raster through two
|
|
45347
|
-
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
45348
|
-
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
45349
|
-
* placeholder glyph for every vector icon while the web build looked fine.
|
|
45350
|
-
*
|
|
45351
|
-
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
45352
|
-
* not been updated — a client that cannot determine the type should prefer
|
|
45353
|
-
* its raster path, which is the safe default for an unknown image.
|
|
45354
|
-
*/
|
|
45355
|
-
iconMediaType: string().optional(),
|
|
45356
|
-
configSchema: ConfigSchemaPassthrough$2,
|
|
45357
|
-
/**
|
|
45358
|
-
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
45359
|
-
* base URL, instance, chat, recipient). A save that changes any of them
|
|
45360
|
-
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
45361
|
-
* editor uses this to ask for the secret on exactly those edits instead of
|
|
45362
|
-
* on every edit.
|
|
45363
|
-
*
|
|
45364
|
-
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
45365
|
-
* kinds) and from a provider older than this field — an editor that finds
|
|
45366
|
-
* it absent must assume ANY edit may need the secret.
|
|
45367
|
-
*/
|
|
45368
|
-
destinationKeys: array(string()).optional(),
|
|
45369
|
-
supportsDiscovery: boolean(),
|
|
45370
|
-
caps: TargetKindCapsSchema
|
|
45371
|
-
});
|
|
45372
|
-
/**
|
|
45373
|
-
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
45374
|
-
* (return a presence marker only) when serving `listTargets` — never
|
|
45375
|
-
* round-trip a stored secret to the UI.
|
|
45376
|
-
*/
|
|
45377
|
-
var TargetSchema = object({
|
|
45378
|
-
id: string(),
|
|
45379
|
-
name: string(),
|
|
45380
|
-
kind: string(),
|
|
45381
|
-
addonId: string(),
|
|
45382
|
-
enabled: boolean(),
|
|
45383
|
-
config: record(string(), unknown())
|
|
45384
|
-
});
|
|
45385
|
-
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
45386
|
-
var DiscoveredTargetSchema = object({
|
|
45387
|
-
kind: string(),
|
|
45388
|
-
suggestedName: string(),
|
|
45389
|
-
config: record(string(), unknown())
|
|
45390
|
-
});
|
|
45391
|
-
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
45392
|
-
var RenderedAsSchema = object({
|
|
45393
|
-
level: string(),
|
|
45394
|
-
format: NotificationFormatSchema,
|
|
45395
|
-
attachmentsSent: number().int().nonnegative(),
|
|
45396
|
-
actionsSent: number().int().nonnegative(),
|
|
45397
|
-
truncated: boolean(),
|
|
45398
|
-
dropped: array(string())
|
|
45399
|
-
});
|
|
45400
|
-
var SendResultSchema = object({
|
|
45401
|
-
success: boolean(),
|
|
45402
|
-
error: string().optional(),
|
|
45403
|
-
renderedAs: RenderedAsSchema.optional()
|
|
45404
|
-
});
|
|
45405
|
-
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
45406
|
-
var TestResultSchema = SendResultSchema;
|
|
45407
|
-
/**
|
|
45408
|
-
* Pre-save credential probe against a partial (unsaved) target config.
|
|
45409
|
-
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
45410
|
-
*/
|
|
45411
|
-
var ProbeTargetConfigResultSchema = object({
|
|
45412
|
-
ok: boolean(),
|
|
45413
|
-
resolvedUrl: string(),
|
|
45414
|
-
httpStatus: number().int().optional(),
|
|
45415
|
-
stateInstance: string().optional(),
|
|
45416
|
-
error: string().optional()
|
|
45417
|
-
});
|
|
45418
|
-
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
|
|
45419
|
-
kind: string(),
|
|
45420
|
-
config: record(string(), unknown()).optional(),
|
|
45421
|
-
/**
|
|
45422
|
-
* When editing / duplicating, the blank password field never round-trips
|
|
45423
|
-
* the stored token. Pass the source target id so the provider can restore
|
|
45424
|
-
* secrets server-side before dialling (same merge as upsert).
|
|
45425
|
-
*/
|
|
45426
|
-
targetId: string().optional()
|
|
45427
|
-
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
45428
|
-
kind: string(),
|
|
45429
|
-
config: record(string(), unknown()),
|
|
45430
|
-
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
45431
|
-
targetId: string().optional()
|
|
45432
|
-
}), ProbeTargetConfigResultSchema, {
|
|
45433
|
-
kind: "mutation",
|
|
45434
|
-
auth: "admin"
|
|
45435
|
-
}), method(object({
|
|
45436
|
-
targetId: string(),
|
|
45437
|
-
notification: NotificationSchema
|
|
45438
|
-
}), SendResultSchema, {
|
|
45439
|
-
kind: "mutation",
|
|
45440
|
-
auth: "admin"
|
|
45441
|
-
}), method(object({
|
|
45442
|
-
targetId: string(),
|
|
45443
|
-
sample: NotificationSchema.optional()
|
|
45444
|
-
}), TestResultSchema, {
|
|
45445
|
-
kind: "mutation",
|
|
45446
|
-
auth: "admin"
|
|
45447
|
-
}), method(object({
|
|
45448
|
-
target: TargetSchema,
|
|
45449
|
-
/**
|
|
45450
|
-
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
45451
|
-
* existing row. The UI never holds the stored token; blank / redacted
|
|
45452
|
-
* password fields are restored from this source (D634 still applies if
|
|
45453
|
-
* destinations diverge without a re-typed secret).
|
|
45454
|
-
*/
|
|
45455
|
-
cloneSecretsFrom: string().optional()
|
|
45456
|
-
}), TargetSchema, {
|
|
45457
|
-
kind: "mutation",
|
|
45458
|
-
auth: "admin"
|
|
45459
|
-
}), method(object({ targetId: string() }), _void(), {
|
|
45460
|
-
kind: "mutation",
|
|
45461
|
-
auth: "admin"
|
|
45462
|
-
}), method(object({
|
|
45463
|
-
targetId: string(),
|
|
45464
|
-
enabled: boolean()
|
|
45465
|
-
}), _void(), {
|
|
45466
|
-
kind: "mutation",
|
|
45467
|
-
auth: "admin"
|
|
45468
|
-
});
|
|
45469
45830
|
var AUDIO_MACRO_LABELS = [
|
|
45470
45831
|
{
|
|
45471
45832
|
id: "speech",
|
|
@@ -51866,14 +52227,6 @@ var EngineProvisioningSchema = object({
|
|
|
51866
52227
|
*/
|
|
51867
52228
|
configIssues: array(string()).optional()
|
|
51868
52229
|
});
|
|
51869
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
51870
|
-
addonId: string(),
|
|
51871
|
-
modelId: string().optional(),
|
|
51872
|
-
enabled: boolean().default(true),
|
|
51873
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
51874
|
-
settings: record(string(), unknown()).optional(),
|
|
51875
|
-
jumpDeviceKey: string().optional()
|
|
51876
|
-
}));
|
|
51877
52230
|
var ModelSubstitutionSchema = object({
|
|
51878
52231
|
addonId: string(),
|
|
51879
52232
|
chosen: string(),
|
|
@@ -51952,7 +52305,6 @@ var ConfigUISchemaBridge = custom();
|
|
|
51952
52305
|
var ConfigUISchemaNullableBridge = custom();
|
|
51953
52306
|
var InferenceCapabilitiesBridge = custom();
|
|
51954
52307
|
var ModelAvailabilityListBridge = custom();
|
|
51955
|
-
var PipelineRunResultBridge = custom();
|
|
51956
52308
|
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
51957
52309
|
modelId: string(),
|
|
51958
52310
|
settings: record(string(), unknown()).readonly()
|
|
@@ -57730,7 +58082,9 @@ var ManifestShapeSchema = object({
|
|
|
57730
58082
|
icon: string().optional()
|
|
57731
58083
|
}).optional(),
|
|
57732
58084
|
protected: boolean().optional(),
|
|
57733
|
-
removable: boolean().optional()
|
|
58085
|
+
removable: boolean().optional(),
|
|
58086
|
+
/** Declared Integrations-page block (mirror of `AddonDeclaration.integrationSection`). */
|
|
58087
|
+
integrationSection: _enum(["system", "providers"]).optional()
|
|
57734
58088
|
});
|
|
57735
58089
|
var AddonProcessSchema = object({
|
|
57736
58090
|
pid: number().optional(),
|
|
@@ -58451,11 +58805,373 @@ DeviceType.Light, method(object({
|
|
|
58451
58805
|
level: number().min(0).max(100),
|
|
58452
58806
|
lastChangedAt: number()
|
|
58453
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
|
+
});
|
|
58454
59120
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58455
59121
|
kind: "mutation",
|
|
58456
59122
|
auth: "protected"
|
|
58457
59123
|
});
|
|
58458
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
|
+
/**
|
|
58459
59175
|
* `calendar-source` — collection cap exposing per-provider calendars and
|
|
58460
59176
|
* their events. Every addon that contributes calendars (Home Assistant,
|
|
58461
59177
|
* a future Google Calendar addon, …) registers a provider here. The hub
|
|
@@ -59475,7 +60191,7 @@ object({
|
|
|
59475
60191
|
/** Ms epoch of the last value received from the appliance; 0 = never. */
|
|
59476
60192
|
lastFetchedAt: number()
|
|
59477
60193
|
});
|
|
59478
|
-
var DeviceIdSchema = number().int().nonnegative();
|
|
60194
|
+
var DeviceIdSchema$1 = number().int().nonnegative();
|
|
59479
60195
|
/** A value a program option or setting can take. */
|
|
59480
60196
|
var DishwasherValueSchema = union([
|
|
59481
60197
|
boolean(),
|
|
@@ -59539,77 +60255,77 @@ var DishwasherOptionsSchema = object({
|
|
|
59539
60255
|
options: array(DishwasherOptionDescriptorSchema)
|
|
59540
60256
|
});
|
|
59541
60257
|
DeviceType.Dishwasher, method(object({
|
|
59542
|
-
deviceId: DeviceIdSchema,
|
|
60258
|
+
deviceId: DeviceIdSchema$1,
|
|
59543
60259
|
program: string().min(1).optional(),
|
|
59544
60260
|
options: record(string(), DishwasherValueSchema).optional()
|
|
59545
60261
|
}), _void(), {
|
|
59546
60262
|
kind: "mutation",
|
|
59547
60263
|
auth: "protected"
|
|
59548
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60264
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59549
60265
|
kind: "mutation",
|
|
59550
60266
|
auth: "protected"
|
|
59551
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60267
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59552
60268
|
kind: "mutation",
|
|
59553
60269
|
auth: "protected"
|
|
59554
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60270
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59555
60271
|
kind: "mutation",
|
|
59556
60272
|
auth: "protected"
|
|
59557
60273
|
}), method(object({
|
|
59558
|
-
deviceId: DeviceIdSchema,
|
|
60274
|
+
deviceId: DeviceIdSchema$1,
|
|
59559
60275
|
program: string().min(1)
|
|
59560
60276
|
}), _void(), {
|
|
59561
60277
|
kind: "mutation",
|
|
59562
60278
|
auth: "protected"
|
|
59563
60279
|
}), method(object({
|
|
59564
|
-
deviceId: DeviceIdSchema,
|
|
60280
|
+
deviceId: DeviceIdSchema$1,
|
|
59565
60281
|
on: boolean()
|
|
59566
60282
|
}), _void(), {
|
|
59567
60283
|
kind: "mutation",
|
|
59568
60284
|
auth: "protected"
|
|
59569
60285
|
}), method(object({
|
|
59570
|
-
deviceId: DeviceIdSchema,
|
|
60286
|
+
deviceId: DeviceIdSchema$1,
|
|
59571
60287
|
on: boolean()
|
|
59572
60288
|
}), _void(), {
|
|
59573
60289
|
kind: "mutation",
|
|
59574
60290
|
auth: "protected"
|
|
59575
60291
|
}), method(object({
|
|
59576
|
-
deviceId: DeviceIdSchema,
|
|
60292
|
+
deviceId: DeviceIdSchema$1,
|
|
59577
60293
|
on: boolean()
|
|
59578
60294
|
}), _void(), {
|
|
59579
60295
|
kind: "mutation",
|
|
59580
60296
|
auth: "protected"
|
|
59581
60297
|
}), method(object({
|
|
59582
|
-
deviceId: DeviceIdSchema,
|
|
60298
|
+
deviceId: DeviceIdSchema$1,
|
|
59583
60299
|
on: boolean()
|
|
59584
60300
|
}), _void(), {
|
|
59585
60301
|
kind: "mutation",
|
|
59586
60302
|
auth: "protected"
|
|
59587
60303
|
}), method(object({
|
|
59588
|
-
deviceId: DeviceIdSchema,
|
|
60304
|
+
deviceId: DeviceIdSchema$1,
|
|
59589
60305
|
on: boolean()
|
|
59590
60306
|
}), _void(), {
|
|
59591
60307
|
kind: "mutation",
|
|
59592
60308
|
auth: "protected"
|
|
59593
60309
|
}), method(object({
|
|
59594
|
-
deviceId: DeviceIdSchema,
|
|
60310
|
+
deviceId: DeviceIdSchema$1,
|
|
59595
60311
|
on: boolean()
|
|
59596
60312
|
}), _void(), {
|
|
59597
60313
|
kind: "mutation",
|
|
59598
60314
|
auth: "protected"
|
|
59599
60315
|
}), method(object({
|
|
59600
|
-
deviceId: DeviceIdSchema,
|
|
60316
|
+
deviceId: DeviceIdSchema$1,
|
|
59601
60317
|
on: boolean()
|
|
59602
60318
|
}), _void(), {
|
|
59603
60319
|
kind: "mutation",
|
|
59604
60320
|
auth: "protected"
|
|
59605
60321
|
}), method(object({
|
|
59606
|
-
deviceId: DeviceIdSchema,
|
|
60322
|
+
deviceId: DeviceIdSchema$1,
|
|
59607
60323
|
key: string().min(1),
|
|
59608
60324
|
value: DishwasherValueSchema
|
|
59609
60325
|
}), _void(), {
|
|
59610
60326
|
kind: "mutation",
|
|
59611
60327
|
auth: "protected"
|
|
59612
|
-
}), method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" });
|
|
60328
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
|
|
59613
60329
|
DeviceType.Camera;
|
|
59614
60330
|
object({
|
|
59615
60331
|
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
@@ -61182,9 +61898,35 @@ var MediaInfoSchema = object({
|
|
|
61182
61898
|
/** Optional cover-art / thumbnail URL. */
|
|
61183
61899
|
imageUrl: string().optional()
|
|
61184
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
|
+
]);
|
|
61185
61916
|
object({
|
|
61186
61917
|
/** Playback lifecycle state. */
|
|
61187
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([]),
|
|
61188
61930
|
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
61189
61931
|
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
61190
61932
|
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -62037,7 +62779,8 @@ var TopologyNodeSchema = object({
|
|
|
62037
62779
|
isHub: boolean(),
|
|
62038
62780
|
isOnline: boolean(),
|
|
62039
62781
|
cpuPercent: number(),
|
|
62040
|
-
|
|
62782
|
+
/** `null` when the node's memory read failed or it has not reported one (D393). */
|
|
62783
|
+
memoryPercent: number().nullable(),
|
|
62041
62784
|
uptime: number(),
|
|
62042
62785
|
lastSeen: string(),
|
|
62043
62786
|
localIps: array(string()).readonly(),
|
|
@@ -62572,9 +63315,10 @@ object({
|
|
|
62572
63315
|
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
62573
63316
|
* the device has not reported yet. */
|
|
62574
63317
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
62575
|
-
/** Food in the BOWL
|
|
62576
|
-
* feeder
|
|
62577
|
-
|
|
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")),
|
|
62578
63322
|
/** True while the pet is eating (`state.eating`). */
|
|
62579
63323
|
eating: boolean(),
|
|
62580
63324
|
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
@@ -62590,9 +63334,14 @@ object({
|
|
|
62590
63334
|
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
62591
63335
|
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
62592
63336
|
lowFood: boolean(),
|
|
62593
|
-
/** Battery charge 0..100 (%).
|
|
62594
|
-
*
|
|
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. */
|
|
62595
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(),
|
|
62596
63345
|
/**
|
|
62597
63346
|
* Desiccant life remaining, stored in seconds (duration base, D944).
|
|
62598
63347
|
* Providers convert from the days the feeder reports. Null when the
|
|
@@ -62620,6 +63369,14 @@ object({
|
|
|
62620
63369
|
feedSound: boolean(),
|
|
62621
63370
|
/** Speaker / prompt volume level (device-scaled integer). */
|
|
62622
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(),
|
|
62623
63380
|
/** Ms epoch when the slice was last refreshed from the cloud. */
|
|
62624
63381
|
lastFetchedAt: number()
|
|
62625
63382
|
});
|
|
@@ -62674,6 +63431,64 @@ DeviceType.PetFeeder, method(object({
|
|
|
62674
63431
|
kind: "mutation",
|
|
62675
63432
|
auth: "protected"
|
|
62676
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
|
+
});
|
|
62677
63492
|
var VehicleSchema = object({
|
|
62678
63493
|
id: string(),
|
|
62679
63494
|
name: string(),
|
|
@@ -67282,9 +68097,17 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
67282
68097
|
kind: "mutation",
|
|
67283
68098
|
auth: "admin"
|
|
67284
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
|
+
})]);
|
|
67285
68108
|
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
67286
68109
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
67287
|
-
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;
|
|
67288
68111
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
67289
68112
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
67290
68113
|
new Set(CAP_NAMES);
|
|
@@ -67337,7 +68160,7 @@ var AccessoryKind = {
|
|
|
67337
68160
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
67338
68161
|
};
|
|
67339
68162
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
67340
|
-
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;
|
|
67341
68164
|
new Set(Object.values(DeviceType));
|
|
67342
68165
|
Object.freeze({
|
|
67343
68166
|
"accessories.getStatus": {
|
|
@@ -69272,6 +70095,13 @@ Object.freeze({
|
|
|
69272
70095
|
access: "create",
|
|
69273
70096
|
role: "admin"
|
|
69274
70097
|
},
|
|
70098
|
+
"deviceExport.exposeEntity": {
|
|
70099
|
+
capName: "device-export",
|
|
70100
|
+
capScope: "system",
|
|
70101
|
+
addonId: null,
|
|
70102
|
+
access: "create",
|
|
70103
|
+
role: "admin"
|
|
70104
|
+
},
|
|
69275
70105
|
"deviceExport.getDeviceLiveContribution": {
|
|
69276
70106
|
capName: "device-export",
|
|
69277
70107
|
capScope: "system",
|
|
@@ -69300,6 +70130,13 @@ Object.freeze({
|
|
|
69300
70130
|
access: "view",
|
|
69301
70131
|
role: "admin"
|
|
69302
70132
|
},
|
|
70133
|
+
"deviceExport.listExposedEntities": {
|
|
70134
|
+
capName: "device-export",
|
|
70135
|
+
capScope: "system",
|
|
70136
|
+
addonId: null,
|
|
70137
|
+
access: "view",
|
|
70138
|
+
role: "admin"
|
|
70139
|
+
},
|
|
69303
70140
|
"deviceExport.listSupportedDeviceKinds": {
|
|
69304
70141
|
capName: "device-export",
|
|
69305
70142
|
capScope: "system",
|
|
@@ -69307,6 +70144,13 @@ Object.freeze({
|
|
|
69307
70144
|
access: "view",
|
|
69308
70145
|
role: "admin"
|
|
69309
70146
|
},
|
|
70147
|
+
"deviceExport.listSupportedEntityKinds": {
|
|
70148
|
+
capName: "device-export",
|
|
70149
|
+
capScope: "system",
|
|
70150
|
+
addonId: null,
|
|
70151
|
+
access: "view",
|
|
70152
|
+
role: "admin"
|
|
70153
|
+
},
|
|
69310
70154
|
"deviceExport.unexposeDevice": {
|
|
69311
70155
|
capName: "device-export",
|
|
69312
70156
|
capScope: "system",
|
|
@@ -69314,6 +70158,13 @@ Object.freeze({
|
|
|
69314
70158
|
access: "create",
|
|
69315
70159
|
role: "admin"
|
|
69316
70160
|
},
|
|
70161
|
+
"deviceExport.unexposeEntity": {
|
|
70162
|
+
capName: "device-export",
|
|
70163
|
+
capScope: "system",
|
|
70164
|
+
addonId: null,
|
|
70165
|
+
access: "create",
|
|
70166
|
+
role: "admin"
|
|
70167
|
+
},
|
|
69317
70168
|
"deviceExtension.listCandidates": {
|
|
69318
70169
|
capName: "device-extension",
|
|
69319
70170
|
capScope: "device",
|
|
@@ -70889,6 +71740,20 @@ Object.freeze({
|
|
|
70889
71740
|
access: "create",
|
|
70890
71741
|
role: "viewer"
|
|
70891
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
|
+
},
|
|
70892
71757
|
"keychain.delete": {
|
|
70893
71758
|
capName: "keychain",
|
|
70894
71759
|
capScope: "system",
|
|
@@ -72121,6 +72986,13 @@ Object.freeze({
|
|
|
72121
72986
|
access: "create",
|
|
72122
72987
|
role: "admin"
|
|
72123
72988
|
},
|
|
72989
|
+
"nodeRemovalHook.onNodeRemoved": {
|
|
72990
|
+
capName: "node-removal-hook",
|
|
72991
|
+
capScope: "system",
|
|
72992
|
+
addonId: null,
|
|
72993
|
+
access: "create",
|
|
72994
|
+
role: "admin"
|
|
72995
|
+
},
|
|
72124
72996
|
"nodes.clusterAddonStatus": {
|
|
72125
72997
|
capName: "nodes",
|
|
72126
72998
|
capScope: "system",
|
|
@@ -72758,6 +73630,48 @@ Object.freeze({
|
|
|
72758
73630
|
access: "create",
|
|
72759
73631
|
role: "viewer"
|
|
72760
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
|
+
},
|
|
72761
73675
|
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
72762
73676
|
capName: "pipeline-analytics",
|
|
72763
73677
|
capScope: "device",
|
|
@@ -75012,6 +75926,41 @@ Object.freeze({
|
|
|
75012
75926
|
access: "create",
|
|
75013
75927
|
role: "admin"
|
|
75014
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
|
+
},
|
|
75015
75964
|
"runningState.getStatus": {
|
|
75016
75965
|
capName: "running-state",
|
|
75017
75966
|
capScope: "device",
|
|
@@ -76202,6 +77151,41 @@ Object.freeze({
|
|
|
76202
77151
|
access: "view",
|
|
76203
77152
|
role: "viewer"
|
|
76204
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
|
+
},
|
|
76205
77189
|
"terminalSession.adoptLegacyMonitor": {
|
|
76206
77190
|
capName: "terminal-session",
|
|
76207
77191
|
capScope: "system",
|
|
@@ -78512,6 +79496,11 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
78512
79496
|
icon: "circle-dot"
|
|
78513
79497
|
}]
|
|
78514
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
|
+
},
|
|
78515
79504
|
control: {
|
|
78516
79505
|
scope: "device",
|
|
78517
79506
|
noun: t("Control", "Controllo"),
|
|
@@ -79165,6 +80154,100 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
79165
80154
|
}
|
|
79166
80155
|
]
|
|
79167
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
|
+
},
|
|
79168
80251
|
"media-player": {
|
|
79169
80252
|
scope: "device",
|
|
79170
80253
|
noun: t("Media player", "Lettore multimediale"),
|
|
@@ -80989,6 +82072,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
80989
82072
|
"device-manager": system("the device registry itself — rename, move and remove are administration"),
|
|
80990
82073
|
"device-provider": system(INTERNAL),
|
|
80991
82074
|
"device-removal-hook": system(INTERNAL),
|
|
82075
|
+
"node-removal-hook": system(INTERNAL),
|
|
80992
82076
|
"device-state": system("the runtime-state mirror every trigger already reads through"),
|
|
80993
82077
|
"display-palette": system("the cluster display palette — one colour table for every client, not a device action"),
|
|
80994
82078
|
"embedding-encoder": system(ML),
|
|
@@ -81028,6 +82112,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
81028
82112
|
"recording-archive": system(STORAGE),
|
|
81029
82113
|
"recording-export": system("recording exports — requested from the timeline, not an automation step"),
|
|
81030
82114
|
records: system(INTERNAL),
|
|
82115
|
+
remote: system("the per-device remote setup — authored in the Customize remote editor, sent through the remote UI"),
|
|
81031
82116
|
"server-management": system(CLUSTER),
|
|
81032
82117
|
"settings-store": system(INTERNAL),
|
|
81033
82118
|
"smtp-provider": system(INTERNAL),
|
|
@@ -81040,6 +82125,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
81040
82125
|
"storage-provider": system(STORAGE),
|
|
81041
82126
|
"stream-broker": system(PIPELINE),
|
|
81042
82127
|
system: system(CLUSTER),
|
|
82128
|
+
template: system("operator-authored templates — edited in their own editor, never actuated"),
|
|
81043
82129
|
"terminal-session": system(CLUSTER),
|
|
81044
82130
|
toast: system(UI_PLUMBING),
|
|
81045
82131
|
training: system(ML),
|
|
@@ -81099,7 +82185,7 @@ function projectAction(cap, action) {
|
|
|
81099
82185
|
};
|
|
81100
82186
|
}
|
|
81101
82187
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
81102
|
-
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;
|
|
81103
82189
|
DeviceFeature.BatteryOperated;
|
|
81104
82190
|
/**
|
|
81105
82191
|
* How a washer, dryer or dishwasher leaves CamStack.
|
|
@@ -82256,6 +83342,16 @@ Object.freeze({
|
|
|
82256
83342
|
form: "single",
|
|
82257
83343
|
optional: false
|
|
82258
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
|
+
}],
|
|
82259
83355
|
"keychain.deleteDeviceScope": [{
|
|
82260
83356
|
name: "deviceId",
|
|
82261
83357
|
form: "single",
|
|
@@ -82665,6 +83761,36 @@ Object.freeze({
|
|
|
82665
83761
|
form: "single",
|
|
82666
83762
|
optional: false
|
|
82667
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
|
+
}],
|
|
82668
83794
|
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
82669
83795
|
name: "deviceId",
|
|
82670
83796
|
form: "single",
|
|
@@ -83481,6 +84607,31 @@ Object.freeze({
|
|
|
83481
84607
|
form: "single",
|
|
83482
84608
|
optional: true
|
|
83483
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
|
+
}],
|
|
83484
84635
|
"runningState.getStatus": [{
|
|
83485
84636
|
name: "deviceId",
|
|
83486
84637
|
form: "single",
|
|
@@ -85289,6 +86440,14 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
|
85289
86440
|
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
85290
86441
|
var MB = 1024 * 1024;
|
|
85291
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
|
+
});
|
|
85292
86451
|
process.platform, process.env["SystemRoot"];
|
|
85293
86452
|
var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
|
|
85294
86453
|
/** Heartbeat cadence — ~2 minutes of 4 s fragments. */
|
|
@@ -85320,7 +86479,7 @@ var Fmp4FragmentChild = class {
|
|
|
85320
86479
|
meta: {
|
|
85321
86480
|
sourceId: this.args.sourceId,
|
|
85322
86481
|
decodeHwAccel: requested,
|
|
85323
|
-
error: errMsg$
|
|
86482
|
+
error: errMsg$17(err)
|
|
85324
86483
|
}
|
|
85325
86484
|
});
|
|
85326
86485
|
this.killChild();
|
|
@@ -85499,7 +86658,7 @@ var Fmp4FragmentChild = class {
|
|
|
85499
86658
|
tags: { deviceId: this.args.deviceId },
|
|
85500
86659
|
meta: {
|
|
85501
86660
|
sourceId: this.args.sourceId,
|
|
85502
|
-
error: errMsg$
|
|
86661
|
+
error: errMsg$17(err)
|
|
85503
86662
|
}
|
|
85504
86663
|
});
|
|
85505
86664
|
}
|
|
@@ -132188,6 +133347,176 @@ function clearPairingFiles(accessoryUuid, logger) {
|
|
|
132188
133347
|
} });
|
|
132189
133348
|
}
|
|
132190
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
|
+
};
|
|
132191
133520
|
/**
|
|
132192
133521
|
* Whether this device's accessory belongs on the bridge.
|
|
132193
133522
|
*
|
|
@@ -151688,6 +153017,7 @@ var DEFAULT_CONFIG = {
|
|
|
151688
153017
|
uuid: ""
|
|
151689
153018
|
},
|
|
151690
153019
|
exposed: [],
|
|
153020
|
+
exposedActions: [],
|
|
151691
153021
|
exportSyncState: {}
|
|
151692
153022
|
};
|
|
151693
153023
|
var BANNED_PINCODES = new Set([
|
|
@@ -151729,6 +153059,8 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151729
153059
|
/** The bridge setup code pairs a controller: a credential, kept in the keychain (D787). */
|
|
151730
153060
|
secretStatePaths = ["identity.pincode"];
|
|
151731
153061
|
exposed = /* @__PURE__ */ new Map();
|
|
153062
|
+
/** The exported actions — switches beside the devices (D968). */
|
|
153063
|
+
actionExports = null;
|
|
151732
153064
|
lastError;
|
|
151733
153065
|
/** Shared HAP setup code applied to every published accessory. */
|
|
151734
153066
|
pincode = "";
|
|
@@ -151841,7 +153173,31 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151841
153173
|
log.warn("export-hap: failed to re-attach mapper on boot", { meta: { error: errMsg(err) } });
|
|
151842
153174
|
}
|
|
151843
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();
|
|
151844
153199
|
this.ctx.addDisposer(async () => {
|
|
153200
|
+
await this.actionExports?.dispose();
|
|
151845
153201
|
await this.detachAll();
|
|
151846
153202
|
await this.bridgeHost?.dispose();
|
|
151847
153203
|
});
|
|
@@ -151872,6 +153228,27 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151872
153228
|
}),
|
|
151873
153229
|
exposeDevice: async ({ deviceId, capabilities }) => this.exposeDevice(deviceId, capabilities),
|
|
151874
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
|
+
},
|
|
151875
153252
|
getDeviceSettingsContribution: (input) => this.buildDeviceSettingsContribution(input.deviceId),
|
|
151876
153253
|
getDeviceLiveContribution: async () => null,
|
|
151877
153254
|
applyDeviceSettingsPatch: (input) => this.applyDeviceSettingsPatch(input.deviceId, input.patch)
|
|
@@ -152077,6 +153454,10 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
152077
153454
|
this.ctx.logger.withTags({ deviceId: Number.parseInt(deviceId, 10) }).warn("export-hap: mapper dispose failed", { meta: { error: errMsg(err) } });
|
|
152078
153455
|
});
|
|
152079
153456
|
}
|
|
153457
|
+
requireActionExports() {
|
|
153458
|
+
if (this.actionExports === null) throw new Error("export-hap: addon is not initialised");
|
|
153459
|
+
return this.actionExports;
|
|
153460
|
+
}
|
|
152080
153461
|
async detachAll() {
|
|
152081
153462
|
const ids = Array.from(this.exposed.keys());
|
|
152082
153463
|
for (const id of ids) await this.detachMapper(id);
|