@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
package/dist/hap-export.addon.js
CHANGED
|
@@ -1391,7 +1391,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-
|
|
|
1391
1391
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
1392
1392
|
*
|
|
1393
1393
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
1394
|
-
var uuid$
|
|
1394
|
+
var uuid$4 = (version) => {
|
|
1395
1395
|
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)$/;
|
|
1396
1396
|
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})$`);
|
|
1397
1397
|
};
|
|
@@ -1961,8 +1961,8 @@ var $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1961
1961
|
v8: 8
|
|
1962
1962
|
}[def.version];
|
|
1963
1963
|
if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1964
|
-
def.pattern ?? (def.pattern = uuid$
|
|
1965
|
-
} else def.pattern ?? (def.pattern = uuid$
|
|
1964
|
+
def.pattern ?? (def.pattern = uuid$4(v));
|
|
1965
|
+
} else def.pattern ?? (def.pattern = uuid$4());
|
|
1966
1966
|
$ZodStringFormat.init(inst, def);
|
|
1967
1967
|
});
|
|
1968
1968
|
var $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
@@ -5118,6 +5118,14 @@ function object(shape, params) {
|
|
|
5118
5118
|
...normalizeParams(params)
|
|
5119
5119
|
});
|
|
5120
5120
|
}
|
|
5121
|
+
function strictObject(shape, params) {
|
|
5122
|
+
return new ZodObject({
|
|
5123
|
+
type: "object",
|
|
5124
|
+
shape,
|
|
5125
|
+
catchall: never(),
|
|
5126
|
+
...normalizeParams(params)
|
|
5127
|
+
});
|
|
5128
|
+
}
|
|
5121
5129
|
function looseObject(shape, params) {
|
|
5122
5130
|
return new ZodObject({
|
|
5123
5131
|
type: "object",
|
|
@@ -5497,7 +5505,7 @@ var ZodIssueCode = {
|
|
|
5497
5505
|
var ZodFirstPartyTypeKind;
|
|
5498
5506
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5499
5507
|
//#endregion
|
|
5500
|
-
//#region ../types/dist/sleep-
|
|
5508
|
+
//#region ../types/dist/sleep-6eG9C8Xl.mjs
|
|
5501
5509
|
/**
|
|
5502
5510
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5503
5511
|
* window to float samples (D455).
|
|
@@ -8385,65 +8393,6 @@ var MODEL_FORMATS = [
|
|
|
8385
8393
|
"pt",
|
|
8386
8394
|
"gguf"
|
|
8387
8395
|
];
|
|
8388
|
-
/**
|
|
8389
|
-
* Per-call node pinning for `ctx.api` capability calls.
|
|
8390
|
-
*
|
|
8391
|
-
* A capability call normally resolves to its DEFAULT provider — a `singleton`
|
|
8392
|
-
* cap resolves to the hub, a device-scoped cap to the device's owning node. To
|
|
8393
|
-
* query a SPECIFIC node's provider instead (e.g. a remote agent's own
|
|
8394
|
-
* in-process `platform-probe` hardware, which the hub cannot probe), pin the
|
|
8395
|
-
* call to that node.
|
|
8396
|
-
*
|
|
8397
|
-
* The nodeId rides OUT-OF-BAND in the tRPC call context (NOT in the validated
|
|
8398
|
-
* method args), so capability method signatures stay `nodeId`-free — node
|
|
8399
|
-
* targeting is a property of the CALL, not of the method. The transport lifts
|
|
8400
|
-
* it from `op.context` onto the `CapCallInput.nodeId` field (`ipcParentLink`),
|
|
8401
|
-
* and the hub parent's `onUnownedCall` passes it to the `CapRouteResolver`,
|
|
8402
|
-
* which classifies a pinned agent node as `agent-child-forward`
|
|
8403
|
-
* (`$agent-cap-fwd.forward` → the agent's in-process provider).
|
|
8404
|
-
*
|
|
8405
|
-
* Usage at a call site:
|
|
8406
|
-
*
|
|
8407
|
-
* await api.platformProbe.getCapabilities.query(undefined, nodePin(nodeId))
|
|
8408
|
-
*/
|
|
8409
|
-
/** tRPC `op.context` key carrying a per-call node pin. */
|
|
8410
|
-
var CAP_NODE_PIN_CONTEXT_KEY = "__camstackNodePin";
|
|
8411
|
-
/**
|
|
8412
|
-
* Build the tRPC request options that pin a single capability call to `nodeId`.
|
|
8413
|
-
* Pass as the second argument to `.query(input, …)` / `.mutate(input, …)`.
|
|
8414
|
-
*
|
|
8415
|
-
* ## The id is normalised here, and it has to be
|
|
8416
|
-
*
|
|
8417
|
-
* A forked addon reads its own node from `ctx.kernel.localNodeId`, and inside a
|
|
8418
|
-
* worker that value is a RUNNER id — `hub/export-hap`, not `hub`. Routing
|
|
8419
|
-
* compares a pin against real node ids, so such a pin matches nothing and the
|
|
8420
|
-
* call fails with `no provider registered for cap "…"`. The local-first
|
|
8421
|
-
* resolver already guarded against this (`localNodeId.split('/')[0]`), which
|
|
8422
|
-
* made the hazard invisible: unpinned calls worked, and only an explicit pin —
|
|
8423
|
-
* the thing you reach for when you specifically need THIS node — silently
|
|
8424
|
-
* addressed a node that does not exist.
|
|
8425
|
-
*
|
|
8426
|
-
* Cost of it being missing: `addon-export-hap` pinned `decoder.getInfo` to its
|
|
8427
|
-
* own node to read the host's hardware-decode backend. It never once answered,
|
|
8428
|
-
* so every HomeKit egress transcode decoded in SOFTWARE — including 4K H.265 —
|
|
8429
|
-
* while D67's whole premise was that the decoder addon is the authority on
|
|
8430
|
-
* hardware. The warn said `decoding in SOFTWARE` and read as "this node has no
|
|
8431
|
-
* hardware", which was false.
|
|
8432
|
-
*
|
|
8433
|
-
* Normalising in the ONE constructor fixes every caller at once, which is why
|
|
8434
|
-
* it is here and not at the call sites.
|
|
8435
|
-
*/
|
|
8436
|
-
function nodePin(nodeId) {
|
|
8437
|
-
return { context: { [CAP_NODE_PIN_CONTEXT_KEY]: toNodeId(nodeId) } };
|
|
8438
|
-
}
|
|
8439
|
-
/**
|
|
8440
|
-
* A runner id is `<nodeId>/<addonId>`; a node id has no slash. Taking the head
|
|
8441
|
-
* is idempotent, so passing an already-clean id costs nothing.
|
|
8442
|
-
*/
|
|
8443
|
-
function toNodeId(idOrRunnerId) {
|
|
8444
|
-
const head = idOrRunnerId.split("/")[0];
|
|
8445
|
-
return head === void 0 || head.length === 0 ? idOrRunnerId : head;
|
|
8446
|
-
}
|
|
8447
8396
|
object({
|
|
8448
8397
|
field: string().min(1),
|
|
8449
8398
|
on: literal("advance")
|
|
@@ -8532,9 +8481,135 @@ function optionalMethod(input, output, options) {
|
|
|
8532
8481
|
providerOptional: true
|
|
8533
8482
|
};
|
|
8534
8483
|
}
|
|
8484
|
+
/**
|
|
8485
|
+
* Per-call node pinning for `ctx.api` capability calls.
|
|
8486
|
+
*
|
|
8487
|
+
* A capability call normally resolves to its DEFAULT provider — a `singleton`
|
|
8488
|
+
* cap resolves to the hub, a device-scoped cap to the device's owning node. To
|
|
8489
|
+
* query a SPECIFIC node's provider instead (e.g. a remote agent's own
|
|
8490
|
+
* in-process `platform-probe` hardware, which the hub cannot probe), pin the
|
|
8491
|
+
* call to that node.
|
|
8492
|
+
*
|
|
8493
|
+
* The nodeId rides OUT-OF-BAND in the tRPC call context (NOT in the validated
|
|
8494
|
+
* method args), so capability method signatures stay `nodeId`-free — node
|
|
8495
|
+
* targeting is a property of the CALL, not of the method. The transport lifts
|
|
8496
|
+
* it from `op.context` onto the `CapCallInput.nodeId` field (`ipcParentLink`),
|
|
8497
|
+
* and the hub parent's `onUnownedCall` passes it to the `CapRouteResolver`,
|
|
8498
|
+
* which classifies a pinned agent node as `agent-child-forward`
|
|
8499
|
+
* (`$agent-cap-fwd.forward` → the agent's in-process provider).
|
|
8500
|
+
*
|
|
8501
|
+
* Usage at a call site:
|
|
8502
|
+
*
|
|
8503
|
+
* await api.platformProbe.getCapabilities.query(undefined, nodePin(nodeId))
|
|
8504
|
+
*/
|
|
8505
|
+
/** tRPC `op.context` key carrying a per-call node pin. */
|
|
8506
|
+
var CAP_NODE_PIN_CONTEXT_KEY = "__camstackNodePin";
|
|
8507
|
+
/**
|
|
8508
|
+
* Build the tRPC request options that pin a single capability call to `nodeId`.
|
|
8509
|
+
* Pass as the second argument to `.query(input, …)` / `.mutate(input, …)`.
|
|
8510
|
+
*
|
|
8511
|
+
* ## The id is normalised here, and it has to be
|
|
8512
|
+
*
|
|
8513
|
+
* A forked addon reads its own node from `ctx.kernel.localNodeId`, and inside a
|
|
8514
|
+
* worker that value is a RUNNER id — `hub/export-hap`, not `hub`. Routing
|
|
8515
|
+
* compares a pin against real node ids, so such a pin matches nothing and the
|
|
8516
|
+
* call fails with `no provider registered for cap "…"`. The local-first
|
|
8517
|
+
* resolver already guarded against this (`localNodeId.split('/')[0]`), which
|
|
8518
|
+
* made the hazard invisible: unpinned calls worked, and only an explicit pin —
|
|
8519
|
+
* the thing you reach for when you specifically need THIS node — silently
|
|
8520
|
+
* addressed a node that does not exist.
|
|
8521
|
+
*
|
|
8522
|
+
* Cost of it being missing: `addon-export-hap` pinned `decoder.getInfo` to its
|
|
8523
|
+
* own node to read the host's hardware-decode backend. It never once answered,
|
|
8524
|
+
* so every HomeKit egress transcode decoded in SOFTWARE — including 4K H.265 —
|
|
8525
|
+
* while D67's whole premise was that the decoder addon is the authority on
|
|
8526
|
+
* hardware. The warn said `decoding in SOFTWARE` and read as "this node has no
|
|
8527
|
+
* hardware", which was false.
|
|
8528
|
+
*
|
|
8529
|
+
* Normalising in the ONE constructor fixes every caller at once, which is why
|
|
8530
|
+
* it is here and not at the call sites.
|
|
8531
|
+
*/
|
|
8532
|
+
function nodePin(nodeId) {
|
|
8533
|
+
return { context: { [CAP_NODE_PIN_CONTEXT_KEY]: toNodeId(nodeId) } };
|
|
8534
|
+
}
|
|
8535
|
+
/**
|
|
8536
|
+
* A runner id is `<nodeId>/<addonId>`; a node id has no slash. Taking the head
|
|
8537
|
+
* is idempotent, so passing an already-clean id costs nothing.
|
|
8538
|
+
*/
|
|
8539
|
+
function toNodeId(idOrRunnerId) {
|
|
8540
|
+
const head = idOrRunnerId.split("/")[0];
|
|
8541
|
+
return head === void 0 || head.length === 0 ? idOrRunnerId : head;
|
|
8542
|
+
}
|
|
8543
|
+
/**
|
|
8544
|
+
* `addon-pages-source` — collection cap exposing per-provider raw page
|
|
8545
|
+
* declarations. Every addon that contributes a UI page registers a
|
|
8546
|
+
* provider here. The hub-side singleton aggregator (`addon-pages` cap,
|
|
8547
|
+
* see `addon-pages.cap.ts`) walks this collection, stamps versioned
|
|
8548
|
+
* `bundleUrl` values, and returns the enriched `AddonPageInfo[]` list
|
|
8549
|
+
* that admin-ui consumes.
|
|
8550
|
+
*
|
|
8551
|
+
* The split exists because the public listing has a different output
|
|
8552
|
+
* shape than the per-provider raw declarations, and we want both ends
|
|
8553
|
+
* to flow through codegen instead of relying on a hand-written wrapper.
|
|
8554
|
+
*/
|
|
8555
|
+
var AddonPageDeclarationSchema = object({
|
|
8556
|
+
id: string(),
|
|
8557
|
+
label: string(),
|
|
8558
|
+
icon: string(),
|
|
8559
|
+
path: string(),
|
|
8560
|
+
/**
|
|
8561
|
+
* Module Federation remote name — must match the `name` field on the
|
|
8562
|
+
* page addon's `federation()` plugin config. Used by admin-ui's
|
|
8563
|
+
* `<AddonPageLoader>` to call `loadRemote('<remoteName>/page')`.
|
|
8564
|
+
* Conventionally `addon_<id>_page` (snake_case; MF names cannot
|
|
8565
|
+
* contain hyphens).
|
|
8566
|
+
*/
|
|
8567
|
+
remoteName: string(),
|
|
8568
|
+
/**
|
|
8569
|
+
* Bundle filename inside the addon's `dist/` dir served at
|
|
8570
|
+
* `/api/addon-pages/<addonId>/<bundle>`. With Module Federation this
|
|
8571
|
+
* is always `'remoteEntry.js'`; the value is kept on the metadata so
|
|
8572
|
+
* the static-file route can compute an mtime-based cache-buster URL
|
|
8573
|
+
* without a separate filesystem stat.
|
|
8574
|
+
*/
|
|
8575
|
+
bundle: string(),
|
|
8576
|
+
/**
|
|
8577
|
+
* Sidebar section this page docks into. Well-known ids: `'detection'`,
|
|
8578
|
+
* `'cluster'`, `'administration'` — the page renders inside that group.
|
|
8579
|
+
* Any OTHER string creates (or joins) a custom section rendered after
|
|
8580
|
+
* the built-in groups; its label comes from `sectionLabel` (first
|
|
8581
|
+
* declaration wins), falling back to the id. Absent → the legacy
|
|
8582
|
+
* "Addon Pages" group.
|
|
8583
|
+
*/
|
|
8584
|
+
section: string().optional(),
|
|
8585
|
+
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
8586
|
+
sectionLabel: string().optional()
|
|
8587
|
+
});
|
|
8588
|
+
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
8535
8589
|
var StaticDirOutputSchema$1 = object({ staticDir: string() });
|
|
8536
8590
|
var VersionOutputSchema$1 = object({ version: string() });
|
|
8537
8591
|
method(_void(), StaticDirOutputSchema$1, { auth: "admin" }), method(_void(), VersionOutputSchema$1, { auth: "admin" });
|
|
8592
|
+
/**
|
|
8593
|
+
* The pipeline step-input shape and the run-result bridge, in a module that
|
|
8594
|
+
* imports nothing but zod and types.
|
|
8595
|
+
*
|
|
8596
|
+
* WHY A SEPARATE FILE (addon footprint, D28): both were declared in
|
|
8597
|
+
* `pipeline-executor.cap.ts`, whose import evaluates the whole executor schema
|
|
8598
|
+
* graph. An addon that only needs these two (the benchmark's `runPipelineTest`
|
|
8599
|
+
* action) paid ~130 MB of heap at load. `pipeline-executor.cap.ts` re-exports
|
|
8600
|
+
* them, so every existing import keeps working; addon server code takes them
|
|
8601
|
+
* from `@camstack/types/addon`.
|
|
8602
|
+
*/
|
|
8603
|
+
var PipelineStepInputSchema = lazy(() => object({
|
|
8604
|
+
addonId: string(),
|
|
8605
|
+
modelId: string().optional(),
|
|
8606
|
+
enabled: boolean().default(true),
|
|
8607
|
+
children: array(PipelineStepInputSchema).optional(),
|
|
8608
|
+
settings: record(string(), unknown()).optional(),
|
|
8609
|
+
jumpDeviceKey: string().optional()
|
|
8610
|
+
}));
|
|
8611
|
+
/** Typed bridge to the recursive `FrameResult` graph; validation is structural. */
|
|
8612
|
+
var PipelineRunResultBridge = custom();
|
|
8538
8613
|
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
8539
8614
|
var VersionOutputSchema = object({ version: string() });
|
|
8540
8615
|
method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" });
|
|
@@ -8690,6 +8765,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8690
8765
|
"image-settings",
|
|
8691
8766
|
"integrations",
|
|
8692
8767
|
"intercom",
|
|
8768
|
+
"ir-transmitter",
|
|
8693
8769
|
"keychain",
|
|
8694
8770
|
"keychain-admin",
|
|
8695
8771
|
"lawn-mower-control",
|
|
@@ -8718,6 +8794,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8718
8794
|
"network-link",
|
|
8719
8795
|
"network-quality",
|
|
8720
8796
|
"node-certificates",
|
|
8797
|
+
"node-removal-hook",
|
|
8721
8798
|
"nodes",
|
|
8722
8799
|
"notification-output",
|
|
8723
8800
|
"notification-rules",
|
|
@@ -8728,6 +8805,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8728
8805
|
"osd",
|
|
8729
8806
|
"osd-manager",
|
|
8730
8807
|
"pet-feeder",
|
|
8808
|
+
"pet-fountain",
|
|
8731
8809
|
"pipeline-analytics",
|
|
8732
8810
|
"pipeline-executor",
|
|
8733
8811
|
"pipeline-orchestrator",
|
|
@@ -8748,6 +8826,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8748
8826
|
"recording-onboard",
|
|
8749
8827
|
"recording-signal",
|
|
8750
8828
|
"records",
|
|
8829
|
+
"remote",
|
|
8751
8830
|
"running-state",
|
|
8752
8831
|
"scene-monitor",
|
|
8753
8832
|
"script-runner",
|
|
@@ -8771,6 +8850,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8771
8850
|
"system",
|
|
8772
8851
|
"tamper",
|
|
8773
8852
|
"temperature-sensor",
|
|
8853
|
+
"template",
|
|
8774
8854
|
"terminal-session",
|
|
8775
8855
|
"toast",
|
|
8776
8856
|
"training",
|
|
@@ -9711,6 +9791,11 @@ Object.freeze({
|
|
|
9711
9791
|
"standby"
|
|
9712
9792
|
]
|
|
9713
9793
|
},
|
|
9794
|
+
{
|
|
9795
|
+
"path": "stateSource",
|
|
9796
|
+
"valueType": "enum",
|
|
9797
|
+
"enumValues": ["reported", "assumed"]
|
|
9798
|
+
},
|
|
9714
9799
|
{
|
|
9715
9800
|
"path": "volumeLevel",
|
|
9716
9801
|
"valueType": "number"
|
|
@@ -9937,6 +10022,11 @@ Object.freeze({
|
|
|
9937
10022
|
"path": "batteryPower",
|
|
9938
10023
|
"valueType": "number"
|
|
9939
10024
|
},
|
|
10025
|
+
{
|
|
10026
|
+
"path": "powerSource",
|
|
10027
|
+
"valueType": "enum",
|
|
10028
|
+
"enumValues": ["mains", "battery"]
|
|
10029
|
+
},
|
|
9940
10030
|
{
|
|
9941
10031
|
"path": "desiccantLeftDays",
|
|
9942
10032
|
"valueType": "number"
|
|
@@ -9981,6 +10071,68 @@ Object.freeze({
|
|
|
9981
10071
|
{
|
|
9982
10072
|
"path": "volume",
|
|
9983
10073
|
"valueType": "number"
|
|
10074
|
+
},
|
|
10075
|
+
{
|
|
10076
|
+
"path": "lastFeedGrams",
|
|
10077
|
+
"valueType": "number"
|
|
10078
|
+
},
|
|
10079
|
+
{
|
|
10080
|
+
"path": "lastFeedHopper1",
|
|
10081
|
+
"valueType": "number"
|
|
10082
|
+
},
|
|
10083
|
+
{
|
|
10084
|
+
"path": "lastFeedHopper2",
|
|
10085
|
+
"valueType": "number"
|
|
10086
|
+
}
|
|
10087
|
+
],
|
|
10088
|
+
"pet-fountain": [
|
|
10089
|
+
{
|
|
10090
|
+
"path": "waterLevel",
|
|
10091
|
+
"valueType": "number"
|
|
10092
|
+
},
|
|
10093
|
+
{
|
|
10094
|
+
"path": "waterVolume",
|
|
10095
|
+
"valueType": "number"
|
|
10096
|
+
},
|
|
10097
|
+
{
|
|
10098
|
+
"path": "empty",
|
|
10099
|
+
"valueType": "boolean"
|
|
10100
|
+
},
|
|
10101
|
+
{
|
|
10102
|
+
"path": "pumpRunning",
|
|
10103
|
+
"valueType": "boolean"
|
|
10104
|
+
},
|
|
10105
|
+
{
|
|
10106
|
+
"path": "pumpIntervalEnabled",
|
|
10107
|
+
"valueType": "boolean"
|
|
10108
|
+
},
|
|
10109
|
+
{
|
|
10110
|
+
"path": "pumpOnTime",
|
|
10111
|
+
"valueType": "number"
|
|
10112
|
+
},
|
|
10113
|
+
{
|
|
10114
|
+
"path": "pumpOffTime",
|
|
10115
|
+
"valueType": "number"
|
|
10116
|
+
},
|
|
10117
|
+
{
|
|
10118
|
+
"path": "lastDrink",
|
|
10119
|
+
"valueType": "number"
|
|
10120
|
+
},
|
|
10121
|
+
{
|
|
10122
|
+
"path": "currentHourDrink",
|
|
10123
|
+
"valueType": "number"
|
|
10124
|
+
},
|
|
10125
|
+
{
|
|
10126
|
+
"path": "last24hDrink",
|
|
10127
|
+
"valueType": "number"
|
|
10128
|
+
},
|
|
10129
|
+
{
|
|
10130
|
+
"path": "todayDrink",
|
|
10131
|
+
"valueType": "number"
|
|
10132
|
+
},
|
|
10133
|
+
{
|
|
10134
|
+
"path": "error",
|
|
10135
|
+
"valueType": "string"
|
|
9984
10136
|
}
|
|
9985
10137
|
],
|
|
9986
10138
|
"power-meter": [
|
|
@@ -10520,7 +10672,7 @@ object({
|
|
|
10520
10672
|
params: record(string(), union([string(), number()])).optional()
|
|
10521
10673
|
});
|
|
10522
10674
|
//#endregion
|
|
10523
|
-
//#region ../types/dist/err-msg-
|
|
10675
|
+
//#region ../types/dist/err-msg-DWXWc0Di.mjs
|
|
10524
10676
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10525
10677
|
DeviceType["Camera"] = "camera";
|
|
10526
10678
|
DeviceType["Hub"] = "hub";
|
|
@@ -10612,6 +10764,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10612
10764
|
* native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
|
|
10613
10765
|
* integrations sharing the same food/desiccant/hopper surface. */
|
|
10614
10766
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
10767
|
+
/** Pet water fountain — tank level, water drunk, pump and its duty cycle.
|
|
10768
|
+
* Installed with the `pet-fountain` cap. Reaches CamStack as loose entities
|
|
10769
|
+
* of a container and is BUILT as a composed device (D967). */
|
|
10770
|
+
DeviceType["PetFountain"] = "pet-fountain";
|
|
10615
10771
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10616
10772
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10617
10773
|
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
@@ -10866,6 +11022,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
10866
11022
|
/** Fallback when the notifier service name doesn't match a known
|
|
10867
11023
|
* pattern. */
|
|
10868
11024
|
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
11025
|
+
/** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
|
|
11026
|
+
* cap. A `DeviceType.Generic` device. */
|
|
11027
|
+
DeviceRole["IrTransmitter"] = "ir-transmitter";
|
|
10869
11028
|
return DeviceRole;
|
|
10870
11029
|
}({});
|
|
10871
11030
|
/**
|
|
@@ -10873,13 +11032,13 @@ import { errMsg } from '@camstack/types'
|
|
|
10873
11032
|
* Extract a human-readable message from an unknown error value.
|
|
10874
11033
|
* Replaces the ubiquitous `errMsg(err)` pattern.
|
|
10875
11034
|
*/
|
|
10876
|
-
function errMsg$
|
|
11035
|
+
function errMsg$17(err) {
|
|
10877
11036
|
if (err instanceof Error) return err.message;
|
|
10878
11037
|
if (typeof err === "string") return err;
|
|
10879
11038
|
return String(err);
|
|
10880
11039
|
}
|
|
10881
11040
|
//#endregion
|
|
10882
|
-
//#region ../types/dist/composition-
|
|
11041
|
+
//#region ../types/dist/composition-kSuOifuG.mjs
|
|
10883
11042
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
10884
11043
|
opus: "libopus",
|
|
10885
11044
|
aac: "aac",
|
|
@@ -12559,12 +12718,28 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
12559
12718
|
])
|
|
12560
12719
|
})
|
|
12561
12720
|
]);
|
|
12562
|
-
var
|
|
12721
|
+
var forwardArgUnion = union([
|
|
12722
|
+
string(),
|
|
12723
|
+
number(),
|
|
12724
|
+
boolean(),
|
|
12725
|
+
strictObject({ ["$input"]: string().min(1) }),
|
|
12726
|
+
record(string().min(1), lazy(() => forwardArgUnion))
|
|
12727
|
+
]);
|
|
12728
|
+
var CompositionForwardArgSchema = forwardArgUnion;
|
|
12729
|
+
/**
|
|
12730
|
+
* `forward` (D659, amended by D967): one method of a BUILT capability is one
|
|
12731
|
+
* call of `cap.method` on `source`. Without `args` the built method's input
|
|
12732
|
+
* passes through minus `deviceId`; with `args` the template IS the source's
|
|
12733
|
+
* whole input. `deviceId` is always the source's own, never an argument.
|
|
12734
|
+
*/
|
|
12735
|
+
var CompositionForwardCommandSchema = object({
|
|
12563
12736
|
kind: literal("forward"),
|
|
12564
12737
|
source: CompositionSourceRefSchema,
|
|
12565
12738
|
cap: string().min(1),
|
|
12566
|
-
method: string().min(1)
|
|
12567
|
-
|
|
12739
|
+
method: string().min(1),
|
|
12740
|
+
args: record(string().min(1), CompositionForwardArgSchema).optional()
|
|
12741
|
+
});
|
|
12742
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
|
|
12568
12743
|
/** An item key inside an item-array cap (`consumables.items[<key>]`). */
|
|
12569
12744
|
var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
12570
12745
|
/**
|
|
@@ -12574,7 +12749,13 @@ var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
|
12574
12749
|
*/
|
|
12575
12750
|
var CompositionItemEntrySchema = object({
|
|
12576
12751
|
label: string().min(1).max(80),
|
|
12577
|
-
fields: record(string().min(1), CompositionFieldSourceSchema)
|
|
12752
|
+
fields: record(string().min(1), CompositionFieldSourceSchema),
|
|
12753
|
+
/**
|
|
12754
|
+
* What the cap's `reset` does for THIS item (consumables). Present = the item
|
|
12755
|
+
* is resettable and a `reset` call naming its key forwards here. The item key
|
|
12756
|
+
* selects the command, so it is never an argument: there is no pass-through.
|
|
12757
|
+
*/
|
|
12758
|
+
reset: CompositionForwardCommandSchema.optional()
|
|
12578
12759
|
});
|
|
12579
12760
|
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
12580
12761
|
kind: literal("fields"),
|
|
@@ -12586,7 +12767,7 @@ var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
|
12586
12767
|
* owns the WHOLE array field: the composed value holds exactly these items.
|
|
12587
12768
|
*/
|
|
12588
12769
|
items: record(string().regex(COMPOSITION_ITEM_KEY_RE), CompositionItemEntrySchema).refine((items) => Object.keys(items).length <= 16, { message: `at most 16 items` }).optional(),
|
|
12589
|
-
/**
|
|
12770
|
+
/** Method name → what serves it. Only a BUILT capability takes commands (D967). */
|
|
12590
12771
|
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
12591
12772
|
}), object({
|
|
12592
12773
|
kind: literal("passthrough"),
|
|
@@ -16750,6 +16931,510 @@ object({
|
|
|
16750
16931
|
lastError: string().nullable()
|
|
16751
16932
|
});
|
|
16752
16933
|
/**
|
|
16934
|
+
* notification-output — canonical, capability-gated notification delivery.
|
|
16935
|
+
*
|
|
16936
|
+
* Apprise-derived model (see
|
|
16937
|
+
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
16938
|
+
* callers emit ONE canonical `Notification`; each provider declares a
|
|
16939
|
+
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
16940
|
+
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
16941
|
+
* message to what the kind supports — callers never special-case a service.
|
|
16942
|
+
*
|
|
16943
|
+
* DESIGN DECISIONS (locked):
|
|
16944
|
+
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
16945
|
+
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
16946
|
+
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
16947
|
+
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
16948
|
+
* alternative would fork the UI per addon and cannot host the
|
|
16949
|
+
* discovery→adopt flow.
|
|
16950
|
+
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
16951
|
+
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
16952
|
+
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
16953
|
+
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
16954
|
+
* `addonId` the generated collection router extracts from the call input.
|
|
16955
|
+
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
16956
|
+
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
16957
|
+
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
16958
|
+
* base64 fallback needed.
|
|
16959
|
+
*
|
|
16960
|
+
* TODO (deferred, closed-set change — separate decision): add
|
|
16961
|
+
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
16962
|
+
* admin "Integrations" page.
|
|
16963
|
+
*/
|
|
16964
|
+
/**
|
|
16965
|
+
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
16966
|
+
* adapter picks what it supports and the degrade engine filters the rest.
|
|
16967
|
+
*/
|
|
16968
|
+
var AttachmentMediaTypeSchema = _enum([
|
|
16969
|
+
"image",
|
|
16970
|
+
"video",
|
|
16971
|
+
"gif",
|
|
16972
|
+
"audio",
|
|
16973
|
+
"icon"
|
|
16974
|
+
]);
|
|
16975
|
+
/**
|
|
16976
|
+
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
16977
|
+
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
16978
|
+
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
16979
|
+
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
16980
|
+
*/
|
|
16981
|
+
var AttachmentSchema = object({
|
|
16982
|
+
mediaType: AttachmentMediaTypeSchema,
|
|
16983
|
+
url: string().optional(),
|
|
16984
|
+
bytes: _instanceof(Uint8Array).optional(),
|
|
16985
|
+
mime: string().optional(),
|
|
16986
|
+
name: string().optional()
|
|
16987
|
+
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
16988
|
+
var NotificationFormatSchema = _enum([
|
|
16989
|
+
"text",
|
|
16990
|
+
"markdown",
|
|
16991
|
+
"html"
|
|
16992
|
+
]);
|
|
16993
|
+
/**
|
|
16994
|
+
* The CLOSED icon vocabulary an action button may use.
|
|
16995
|
+
*
|
|
16996
|
+
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
16997
|
+
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
16998
|
+
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
16999
|
+
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
17000
|
+
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
17001
|
+
*
|
|
17002
|
+
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
17003
|
+
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
17004
|
+
* differently.
|
|
17005
|
+
*
|
|
17006
|
+
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
17007
|
+
*
|
|
17008
|
+
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
17009
|
+
* the whole set onto its own renderer's vocabulary through a
|
|
17010
|
+
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
17011
|
+
* fallback, so adding a member here fails every adapter's build until someone
|
|
17012
|
+
* decides its glyph, which is the only place that decision can be made
|
|
17013
|
+
* honestly.
|
|
17014
|
+
*
|
|
17015
|
+
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
17016
|
+
* `disarm` straight through; iOS feeds that string to
|
|
17017
|
+
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
17018
|
+
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
17019
|
+
* mapping, and "the field is documented" is not "the value renders".
|
|
17020
|
+
*
|
|
17021
|
+
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
17022
|
+
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
17023
|
+
* so an addon that emits a token the running hub does not know does not lose an
|
|
17024
|
+
* icon — its whole `send` fails Zod validation and the notification never
|
|
17025
|
+
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
17026
|
+
*/
|
|
17027
|
+
var NotificationActionIconSchema = _enum([
|
|
17028
|
+
"acknowledge",
|
|
17029
|
+
"dismiss",
|
|
17030
|
+
"silence",
|
|
17031
|
+
"snooze",
|
|
17032
|
+
"view",
|
|
17033
|
+
"play",
|
|
17034
|
+
"open",
|
|
17035
|
+
"close",
|
|
17036
|
+
"lock",
|
|
17037
|
+
"unlock",
|
|
17038
|
+
"arm",
|
|
17039
|
+
"arm-home",
|
|
17040
|
+
"arm-away",
|
|
17041
|
+
"arm-night",
|
|
17042
|
+
"disarm",
|
|
17043
|
+
"light",
|
|
17044
|
+
"alert",
|
|
17045
|
+
"camera"
|
|
17046
|
+
]);
|
|
17047
|
+
/** A single tap-through action button. */
|
|
17048
|
+
var NotificationActionSchema = object({
|
|
17049
|
+
id: string(),
|
|
17050
|
+
label: string(),
|
|
17051
|
+
url: string().optional(),
|
|
17052
|
+
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
17053
|
+
icon: NotificationActionIconSchema.optional(),
|
|
17054
|
+
/**
|
|
17055
|
+
* Renders in a warning style where the notifier supports it.
|
|
17056
|
+
*
|
|
17057
|
+
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
17058
|
+
* else — see `notification-center/action-token.ts` for what that does and
|
|
17059
|
+
* does not buy.
|
|
17060
|
+
*/
|
|
17061
|
+
destructive: boolean().optional(),
|
|
17062
|
+
/**
|
|
17063
|
+
* How the tap should REACH the url.
|
|
17064
|
+
*
|
|
17065
|
+
* `navigate` (absent, and every button authored before this field) opens it:
|
|
17066
|
+
* the phone leaves the notification and shows whatever the callback returns.
|
|
17067
|
+
* That is right for a button whose answer the operator wants to read.
|
|
17068
|
+
*
|
|
17069
|
+
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
17070
|
+
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
17071
|
+
* an answer to the notification, and being thrown into a browser tab to
|
|
17072
|
+
* confirm it costs more attention than the notification did. A backend that
|
|
17073
|
+
* cannot do a background call renders it as an ordinary link (the adapters
|
|
17074
|
+
* fall back rather than dropping the button), so this is a preference, never
|
|
17075
|
+
* a requirement.
|
|
17076
|
+
*/
|
|
17077
|
+
mode: _enum(["navigate", "background"]).optional()
|
|
17078
|
+
});
|
|
17079
|
+
/** A delivery parameter value: what a notifier declared it takes. */
|
|
17080
|
+
var DeliveryParamValueSchema = union([
|
|
17081
|
+
string(),
|
|
17082
|
+
number(),
|
|
17083
|
+
boolean()
|
|
17084
|
+
]);
|
|
17085
|
+
/**
|
|
17086
|
+
* One extra delivery parameter a notifier KIND declares (D938). A rule that
|
|
17087
|
+
* addresses a target of that kind may set it; a kind that declares nothing is
|
|
17088
|
+
* never handed one. The admin UI derives its control from this descriptor —
|
|
17089
|
+
* no editor knows a service by name.
|
|
17090
|
+
*
|
|
17091
|
+
* Optional fields are `.optional()`, never `.default()` (a Zod default does not
|
|
17092
|
+
* run on the addon cap path).
|
|
17093
|
+
*/
|
|
17094
|
+
var DeliveryParamSchema = object({
|
|
17095
|
+
key: string().min(1),
|
|
17096
|
+
label: string(),
|
|
17097
|
+
/** i18n key of the label, resolved by the declaring addon's namespace. */
|
|
17098
|
+
labelKey: string().optional(),
|
|
17099
|
+
type: _enum([
|
|
17100
|
+
"enum",
|
|
17101
|
+
"number",
|
|
17102
|
+
"boolean",
|
|
17103
|
+
"string"
|
|
17104
|
+
]),
|
|
17105
|
+
/** `enum` only: the closed set of accepted values. */
|
|
17106
|
+
options: array(object({
|
|
17107
|
+
value: string(),
|
|
17108
|
+
label: string()
|
|
17109
|
+
})).optional(),
|
|
17110
|
+
/** `number` only. */
|
|
17111
|
+
min: number().optional(),
|
|
17112
|
+
max: number().optional(),
|
|
17113
|
+
/** What the notifier does when the rule sets nothing; shown as the placeholder. */
|
|
17114
|
+
default: DeliveryParamValueSchema.optional()
|
|
17115
|
+
});
|
|
17116
|
+
/**
|
|
17117
|
+
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
17118
|
+
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
17119
|
+
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
17120
|
+
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
17121
|
+
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
17122
|
+
* `priority` for that one target.
|
|
17123
|
+
*/
|
|
17124
|
+
var NotificationSchema = object({
|
|
17125
|
+
body: string(),
|
|
17126
|
+
title: string().optional(),
|
|
17127
|
+
format: NotificationFormatSchema.default("text"),
|
|
17128
|
+
priority: number().int().min(1).max(5).default(3),
|
|
17129
|
+
level: string().optional(),
|
|
17130
|
+
attachments: array(AttachmentSchema).optional(),
|
|
17131
|
+
clickUrl: string().optional(),
|
|
17132
|
+
actions: array(NotificationActionSchema).optional(),
|
|
17133
|
+
sound: string().optional(),
|
|
17134
|
+
ttl: number().optional(),
|
|
17135
|
+
tag: string().optional(),
|
|
17136
|
+
deviceId: number().optional(),
|
|
17137
|
+
eventId: string().optional(),
|
|
17138
|
+
metadata: record(string(), unknown()).optional(),
|
|
17139
|
+
/**
|
|
17140
|
+
* Values for the parameters the target's kind DECLARES in
|
|
17141
|
+
* {@link TargetKindSchema} `deliveryParams`. Already validated against the
|
|
17142
|
+
* declaration by the sender; a notifier reads only the keys it declared.
|
|
17143
|
+
*/
|
|
17144
|
+
delivery: record(string(), DeliveryParamValueSchema).optional()
|
|
17145
|
+
});
|
|
17146
|
+
/** One declared native severity/priority level for a kind. */
|
|
17147
|
+
var TargetKindLevelSchema = object({
|
|
17148
|
+
id: string(),
|
|
17149
|
+
label: string(),
|
|
17150
|
+
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
17151
|
+
ordinal: number().int().min(1).max(5).nullable(),
|
|
17152
|
+
flags: object({
|
|
17153
|
+
critical: boolean().optional(),
|
|
17154
|
+
silent: boolean().optional(),
|
|
17155
|
+
noPush: boolean().optional()
|
|
17156
|
+
}).optional(),
|
|
17157
|
+
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
17158
|
+
requires: array(string()).optional(),
|
|
17159
|
+
description: string().optional()
|
|
17160
|
+
});
|
|
17161
|
+
/** The full capability block consulted before dispatch. */
|
|
17162
|
+
var TargetKindCapsSchema = object({
|
|
17163
|
+
attachments: object({
|
|
17164
|
+
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
17165
|
+
mode: _enum([
|
|
17166
|
+
"url",
|
|
17167
|
+
"bytes",
|
|
17168
|
+
"both"
|
|
17169
|
+
]),
|
|
17170
|
+
max: number().int().nonnegative(),
|
|
17171
|
+
maxBytes: number().int().positive().optional()
|
|
17172
|
+
}),
|
|
17173
|
+
/** Max action buttons (0 = none). */
|
|
17174
|
+
actions: number().int().nonnegative(),
|
|
17175
|
+
/**
|
|
17176
|
+
* Whether this kind renders a per-action ICON.
|
|
17177
|
+
*
|
|
17178
|
+
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
17179
|
+
* run on the addon cap path — three production failures in one day taught
|
|
17180
|
+
* this repo that once. Absent is read as false by the degrade engine, which
|
|
17181
|
+
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
17182
|
+
* assumed and dropped costs the operator's trust in the field.
|
|
17183
|
+
*/
|
|
17184
|
+
actionIcons: boolean().optional(),
|
|
17185
|
+
levels: array(TargetKindLevelSchema),
|
|
17186
|
+
format: array(NotificationFormatSchema),
|
|
17187
|
+
clickUrl: boolean(),
|
|
17188
|
+
sound: boolean(),
|
|
17189
|
+
ttl: boolean(),
|
|
17190
|
+
bodyMaxLen: number().int().positive()
|
|
17191
|
+
});
|
|
17192
|
+
/**
|
|
17193
|
+
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
17194
|
+
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
17195
|
+
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
17196
|
+
* the union is large and not meant for runtime validation here; the exported
|
|
17197
|
+
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
17198
|
+
*/
|
|
17199
|
+
var ConfigSchemaPassthrough$3 = unknown();
|
|
17200
|
+
var TargetKindSchema = object({
|
|
17201
|
+
kind: string(),
|
|
17202
|
+
label: string(),
|
|
17203
|
+
icon: string(),
|
|
17204
|
+
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
17205
|
+
addonId: string(),
|
|
17206
|
+
/**
|
|
17207
|
+
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
17208
|
+
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
17209
|
+
* when the addon bundles no icon for that kind — the client then falls back
|
|
17210
|
+
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
17211
|
+
*
|
|
17212
|
+
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
17213
|
+
* client, and a native client joins it onto its own hub base.
|
|
17214
|
+
*
|
|
17215
|
+
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
17216
|
+
* field that survived only because the runtime cap-router forwards provider
|
|
17217
|
+
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
17218
|
+
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
17219
|
+
* broken silently the moment output validation was tightened anywhere.
|
|
17220
|
+
*/
|
|
17221
|
+
iconUrl: string().optional(),
|
|
17222
|
+
/**
|
|
17223
|
+
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
17224
|
+
*
|
|
17225
|
+
* The server knows this and therefore says it, because the client cannot
|
|
17226
|
+
* safely guess: a React-Native client renders SVG and raster through two
|
|
17227
|
+
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
17228
|
+
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
17229
|
+
* placeholder glyph for every vector icon while the web build looked fine.
|
|
17230
|
+
*
|
|
17231
|
+
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
17232
|
+
* not been updated — a client that cannot determine the type should prefer
|
|
17233
|
+
* its raster path, which is the safe default for an unknown image.
|
|
17234
|
+
*/
|
|
17235
|
+
iconMediaType: string().optional(),
|
|
17236
|
+
configSchema: ConfigSchemaPassthrough$3,
|
|
17237
|
+
/**
|
|
17238
|
+
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
17239
|
+
* base URL, instance, chat, recipient). A save that changes any of them
|
|
17240
|
+
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
17241
|
+
* editor uses this to ask for the secret on exactly those edits instead of
|
|
17242
|
+
* on every edit.
|
|
17243
|
+
*
|
|
17244
|
+
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
17245
|
+
* kinds) and from a provider older than this field — an editor that finds
|
|
17246
|
+
* it absent must assume ANY edit may need the secret.
|
|
17247
|
+
*/
|
|
17248
|
+
destinationKeys: array(string()).optional(),
|
|
17249
|
+
supportsDiscovery: boolean(),
|
|
17250
|
+
/**
|
|
17251
|
+
* Extra delivery parameters a rule may set for a target of this kind (D938).
|
|
17252
|
+
* Absent = none; the rule editor then offers nothing.
|
|
17253
|
+
*/
|
|
17254
|
+
deliveryParams: array(DeliveryParamSchema).optional(),
|
|
17255
|
+
caps: TargetKindCapsSchema
|
|
17256
|
+
});
|
|
17257
|
+
/**
|
|
17258
|
+
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
17259
|
+
* (return a presence marker only) when serving `listTargets` — never
|
|
17260
|
+
* round-trip a stored secret to the UI.
|
|
17261
|
+
*/
|
|
17262
|
+
var TargetSchema = object({
|
|
17263
|
+
id: string(),
|
|
17264
|
+
name: string(),
|
|
17265
|
+
kind: string(),
|
|
17266
|
+
addonId: string(),
|
|
17267
|
+
enabled: boolean(),
|
|
17268
|
+
config: record(string(), unknown())
|
|
17269
|
+
});
|
|
17270
|
+
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
17271
|
+
var DiscoveredTargetSchema = object({
|
|
17272
|
+
kind: string(),
|
|
17273
|
+
suggestedName: string(),
|
|
17274
|
+
config: record(string(), unknown())
|
|
17275
|
+
});
|
|
17276
|
+
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
17277
|
+
var RenderedAsSchema = object({
|
|
17278
|
+
level: string(),
|
|
17279
|
+
format: NotificationFormatSchema,
|
|
17280
|
+
attachmentsSent: number().int().nonnegative(),
|
|
17281
|
+
actionsSent: number().int().nonnegative(),
|
|
17282
|
+
truncated: boolean(),
|
|
17283
|
+
dropped: array(string())
|
|
17284
|
+
});
|
|
17285
|
+
var SendResultSchema = object({
|
|
17286
|
+
success: boolean(),
|
|
17287
|
+
error: string().optional(),
|
|
17288
|
+
renderedAs: RenderedAsSchema.optional()
|
|
17289
|
+
});
|
|
17290
|
+
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
17291
|
+
var TestResultSchema = SendResultSchema;
|
|
17292
|
+
/**
|
|
17293
|
+
* Pre-save credential probe against a partial (unsaved) target config.
|
|
17294
|
+
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
17295
|
+
*/
|
|
17296
|
+
var ProbeTargetConfigResultSchema = object({
|
|
17297
|
+
ok: boolean(),
|
|
17298
|
+
resolvedUrl: string(),
|
|
17299
|
+
httpStatus: number().int().optional(),
|
|
17300
|
+
stateInstance: string().optional(),
|
|
17301
|
+
error: string().optional()
|
|
17302
|
+
});
|
|
17303
|
+
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
|
|
17304
|
+
kind: string(),
|
|
17305
|
+
config: record(string(), unknown()).optional(),
|
|
17306
|
+
/**
|
|
17307
|
+
* When editing / duplicating, the blank password field never round-trips
|
|
17308
|
+
* the stored token. Pass the source target id so the provider can restore
|
|
17309
|
+
* secrets server-side before dialling (same merge as upsert).
|
|
17310
|
+
*/
|
|
17311
|
+
targetId: string().optional()
|
|
17312
|
+
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
17313
|
+
kind: string(),
|
|
17314
|
+
config: record(string(), unknown()),
|
|
17315
|
+
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
17316
|
+
targetId: string().optional()
|
|
17317
|
+
}), ProbeTargetConfigResultSchema, {
|
|
17318
|
+
kind: "mutation",
|
|
17319
|
+
auth: "admin"
|
|
17320
|
+
}), method(object({
|
|
17321
|
+
targetId: string(),
|
|
17322
|
+
notification: NotificationSchema
|
|
17323
|
+
}), SendResultSchema, {
|
|
17324
|
+
kind: "mutation",
|
|
17325
|
+
auth: "admin"
|
|
17326
|
+
}), method(object({
|
|
17327
|
+
targetId: string(),
|
|
17328
|
+
sample: NotificationSchema.optional()
|
|
17329
|
+
}), TestResultSchema, {
|
|
17330
|
+
kind: "mutation",
|
|
17331
|
+
auth: "admin"
|
|
17332
|
+
}), method(object({
|
|
17333
|
+
target: TargetSchema,
|
|
17334
|
+
/**
|
|
17335
|
+
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
17336
|
+
* existing row. The UI never holds the stored token; blank / redacted
|
|
17337
|
+
* password fields are restored from this source (D634 still applies if
|
|
17338
|
+
* destinations diverge without a re-typed secret).
|
|
17339
|
+
*/
|
|
17340
|
+
cloneSecretsFrom: string().optional()
|
|
17341
|
+
}), TargetSchema, {
|
|
17342
|
+
kind: "mutation",
|
|
17343
|
+
auth: "admin"
|
|
17344
|
+
}), method(object({ targetId: string() }), _void(), {
|
|
17345
|
+
kind: "mutation",
|
|
17346
|
+
auth: "admin"
|
|
17347
|
+
}), method(object({
|
|
17348
|
+
targetId: string(),
|
|
17349
|
+
enabled: boolean()
|
|
17350
|
+
}), _void(), {
|
|
17351
|
+
kind: "mutation",
|
|
17352
|
+
auth: "admin"
|
|
17353
|
+
});
|
|
17354
|
+
function errorText$1(err) {
|
|
17355
|
+
return err instanceof Error ? err.message : String(err);
|
|
17356
|
+
}
|
|
17357
|
+
/** `actions.run` flattens a refusal to `[code] text`; the code leads. */
|
|
17358
|
+
function refusalFromThrown(message) {
|
|
17359
|
+
if (message.startsWith("[busy]")) return "already-running";
|
|
17360
|
+
if (message.startsWith("[not-found]")) return "not-found";
|
|
17361
|
+
return null;
|
|
17362
|
+
}
|
|
17363
|
+
async function runExportedAction(api, log, input) {
|
|
17364
|
+
const { exporter, actionId } = input;
|
|
17365
|
+
const tags = { actionId };
|
|
17366
|
+
const refuse = (reason, detail) => {
|
|
17367
|
+
log.warn(`${exporter}: exported action not run — ${reason}`, {
|
|
17368
|
+
tags,
|
|
17369
|
+
meta: {
|
|
17370
|
+
reason,
|
|
17371
|
+
...detail ? { detail } : {}
|
|
17372
|
+
}
|
|
17373
|
+
});
|
|
17374
|
+
return {
|
|
17375
|
+
status: "refused",
|
|
17376
|
+
reason
|
|
17377
|
+
};
|
|
17378
|
+
};
|
|
17379
|
+
try {
|
|
17380
|
+
const result = await api.actions.run.mutate({ actionId });
|
|
17381
|
+
if (result.outcome === "skipped-overlap") return refuse("already-running", result.message);
|
|
17382
|
+
if (result.outcome === "skipped-cooldown") return refuse("cooldown", result.message);
|
|
17383
|
+
if (result.outcome === "failed" || result.outcome === "aborted") {
|
|
17384
|
+
const message = result.message ?? result.outcome;
|
|
17385
|
+
log.warn(`${exporter}: exported action failed`, {
|
|
17386
|
+
tags,
|
|
17387
|
+
meta: {
|
|
17388
|
+
outcome: result.outcome,
|
|
17389
|
+
message
|
|
17390
|
+
}
|
|
17391
|
+
});
|
|
17392
|
+
return {
|
|
17393
|
+
status: "failed",
|
|
17394
|
+
message
|
|
17395
|
+
};
|
|
17396
|
+
}
|
|
17397
|
+
log.info(`${exporter}: exported action ran`, {
|
|
17398
|
+
tags,
|
|
17399
|
+
meta: { outcome: result.outcome }
|
|
17400
|
+
});
|
|
17401
|
+
return { status: "started" };
|
|
17402
|
+
} catch (err) {
|
|
17403
|
+
const message = errorText$1(err);
|
|
17404
|
+
const reason = refusalFromThrown(message);
|
|
17405
|
+
if (reason !== null) return refuse(reason, message);
|
|
17406
|
+
log.warn(`${exporter}: exported action failed`, {
|
|
17407
|
+
tags,
|
|
17408
|
+
meta: { message }
|
|
17409
|
+
});
|
|
17410
|
+
return {
|
|
17411
|
+
status: "failed",
|
|
17412
|
+
message
|
|
17413
|
+
};
|
|
17414
|
+
}
|
|
17415
|
+
}
|
|
17416
|
+
/**
|
|
17417
|
+
* Split an exporter's selection into what still exists and what was deleted.
|
|
17418
|
+
* Devices are never judged here (their lifecycle is the tombstone, D865).
|
|
17419
|
+
* Callers pass ids from a query that ANSWERED — an unanswered list must not
|
|
17420
|
+
* reach this function (D49: a failed read changes nothing).
|
|
17421
|
+
*/
|
|
17422
|
+
function pruneDeletedEntities(selection, live, log, exporter) {
|
|
17423
|
+
const kept = [];
|
|
17424
|
+
const dropped = [];
|
|
17425
|
+
for (const ref of selection) if (ref.kind === "action" && !live.actionIds.has(ref.actionId)) {
|
|
17426
|
+
dropped.push(ref);
|
|
17427
|
+
log.warn(`${exporter}: exported action was deleted — dropped from the export`, { tags: { actionId: ref.actionId } });
|
|
17428
|
+
} else if (ref.kind === "notifier" && !live.targetIds.has(ref.targetId)) {
|
|
17429
|
+
dropped.push(ref);
|
|
17430
|
+
log.warn(`${exporter}: exported notifier target was deleted — dropped from the export`, { tags: { targetId: ref.targetId } });
|
|
17431
|
+
} else kept.push(ref);
|
|
17432
|
+
return {
|
|
17433
|
+
kept,
|
|
17434
|
+
dropped
|
|
17435
|
+
};
|
|
17436
|
+
}
|
|
17437
|
+
/**
|
|
16753
17438
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
16754
17439
|
* surface that admin-ui consumes through `useAddonPagesListPages()`.
|
|
16755
17440
|
*
|
|
@@ -16781,52 +17466,6 @@ var AddonPageInfoSchema = object({
|
|
|
16781
17466
|
bundleUrl: string()
|
|
16782
17467
|
});
|
|
16783
17468
|
method(_void(), array(AddonPageInfoSchema).readonly());
|
|
16784
|
-
/**
|
|
16785
|
-
* `addon-pages-source` — collection cap exposing per-provider raw page
|
|
16786
|
-
* declarations. Every addon that contributes a UI page registers a
|
|
16787
|
-
* provider here. The hub-side singleton aggregator (`addon-pages` cap,
|
|
16788
|
-
* see `addon-pages.cap.ts`) walks this collection, stamps versioned
|
|
16789
|
-
* `bundleUrl` values, and returns the enriched `AddonPageInfo[]` list
|
|
16790
|
-
* that admin-ui consumes.
|
|
16791
|
-
*
|
|
16792
|
-
* The split exists because the public listing has a different output
|
|
16793
|
-
* shape than the per-provider raw declarations, and we want both ends
|
|
16794
|
-
* to flow through codegen instead of relying on a hand-written wrapper.
|
|
16795
|
-
*/
|
|
16796
|
-
var AddonPageDeclarationSchema = object({
|
|
16797
|
-
id: string(),
|
|
16798
|
-
label: string(),
|
|
16799
|
-
icon: string(),
|
|
16800
|
-
path: string(),
|
|
16801
|
-
/**
|
|
16802
|
-
* Module Federation remote name — must match the `name` field on the
|
|
16803
|
-
* page addon's `federation()` plugin config. Used by admin-ui's
|
|
16804
|
-
* `<AddonPageLoader>` to call `loadRemote('<remoteName>/page')`.
|
|
16805
|
-
* Conventionally `addon_<id>_page` (snake_case; MF names cannot
|
|
16806
|
-
* contain hyphens).
|
|
16807
|
-
*/
|
|
16808
|
-
remoteName: string(),
|
|
16809
|
-
/**
|
|
16810
|
-
* Bundle filename inside the addon's `dist/` dir served at
|
|
16811
|
-
* `/api/addon-pages/<addonId>/<bundle>`. With Module Federation this
|
|
16812
|
-
* is always `'remoteEntry.js'`; the value is kept on the metadata so
|
|
16813
|
-
* the static-file route can compute an mtime-based cache-buster URL
|
|
16814
|
-
* without a separate filesystem stat.
|
|
16815
|
-
*/
|
|
16816
|
-
bundle: string(),
|
|
16817
|
-
/**
|
|
16818
|
-
* Sidebar section this page docks into. Well-known ids: `'detection'`,
|
|
16819
|
-
* `'cluster'`, `'administration'` — the page renders inside that group.
|
|
16820
|
-
* Any OTHER string creates (or joins) a custom section rendered after
|
|
16821
|
-
* the built-in groups; its label comes from `sectionLabel` (first
|
|
16822
|
-
* declaration wins), falling back to the id. Absent → the legacy
|
|
16823
|
-
* "Addon Pages" group.
|
|
16824
|
-
*/
|
|
16825
|
-
section: string().optional(),
|
|
16826
|
-
/** Display label for a CUSTOM `section` id (ignored for well-known ids). */
|
|
16827
|
-
sectionLabel: string().optional()
|
|
16828
|
-
});
|
|
16829
|
-
method(_void(), array(AddonPageDeclarationSchema).readonly(), { auth: "admin" });
|
|
16830
17469
|
var AddonHttpRouteSchema = object({
|
|
16831
17470
|
method: _enum([
|
|
16832
17471
|
"GET",
|
|
@@ -17108,9 +17747,21 @@ var AlertSeveritySchema = _enum([
|
|
|
17108
17747
|
"error",
|
|
17109
17748
|
"critical"
|
|
17110
17749
|
]);
|
|
17750
|
+
/**
|
|
17751
|
+
* An action that RUNS something instead of going somewhere: the admin UI calls
|
|
17752
|
+
* the addon's custom action (`addons.custom`) with exactly these fields. The
|
|
17753
|
+
* producer owns the meaning; the UI knows nothing about the addon or the kind.
|
|
17754
|
+
*/
|
|
17755
|
+
var AlertActionInvokeSchema = object({
|
|
17756
|
+
addonId: string().min(1),
|
|
17757
|
+
action: string().min(1),
|
|
17758
|
+
input: record(string(), unknown()).optional()
|
|
17759
|
+
});
|
|
17760
|
+
/** An action has `href` (a link) OR `invoke` (a button that runs a custom action). */
|
|
17111
17761
|
var AlertActionSchema = object({
|
|
17112
17762
|
label: string(),
|
|
17113
17763
|
href: string().optional(),
|
|
17764
|
+
invoke: AlertActionInvokeSchema.optional(),
|
|
17114
17765
|
/**
|
|
17115
17766
|
* How `href` is followed. Absent / `app`: an admin-ui route (client-side).
|
|
17116
17767
|
* `server`: a route the HUB serves (an addon HTTP route such as an OAuth
|
|
@@ -19357,7 +20008,11 @@ var CompositionProblemSchema = object({
|
|
|
19357
20008
|
"mixed-quantity",
|
|
19358
20009
|
"helper-mismatch",
|
|
19359
20010
|
"member-constraint",
|
|
19360
|
-
"retention"
|
|
20011
|
+
"retention",
|
|
20012
|
+
"command-method-unknown",
|
|
20013
|
+
"command-source-unknown",
|
|
20014
|
+
"command-input-unknown",
|
|
20015
|
+
"command-input-missing"
|
|
19361
20016
|
]),
|
|
19362
20017
|
path: string(),
|
|
19363
20018
|
message: string()
|
|
@@ -19396,7 +20051,9 @@ var CompositionFieldRoleSchema = _enum([
|
|
|
19396
20051
|
var CompositionFieldItemSchema = object({
|
|
19397
20052
|
arrayPath: string(),
|
|
19398
20053
|
key: string(),
|
|
19399
|
-
label: string()
|
|
20054
|
+
label: string(),
|
|
20055
|
+
/** True when the item carries a `reset` forward: the composer writes `resettable` from this (D967). */
|
|
20056
|
+
resettable: boolean().optional()
|
|
19400
20057
|
});
|
|
19401
20058
|
var CompositionFieldPlanSchema = object({
|
|
19402
20059
|
cap: string(),
|
|
@@ -19601,7 +20258,7 @@ Object.freeze({
|
|
|
19601
20258
|
* One catalog row per base reading a group helper can build (D944 §3).
|
|
19602
20259
|
* Data, not a form default written into the block.
|
|
19603
20260
|
*/
|
|
19604
|
-
var NOW$
|
|
20261
|
+
var NOW$3 = {
|
|
19605
20262
|
fieldPath: "lastFetchedAt",
|
|
19606
20263
|
expr: "now"
|
|
19607
20264
|
};
|
|
@@ -19610,12 +20267,13 @@ var CHANGED = {
|
|
|
19610
20267
|
expr: "now"
|
|
19611
20268
|
};
|
|
19612
20269
|
function numeric(input) {
|
|
20270
|
+
const { alsoFrom, ...base } = input;
|
|
19613
20271
|
return {
|
|
19614
|
-
...
|
|
20272
|
+
...base,
|
|
19615
20273
|
family: "numeric",
|
|
19616
20274
|
deviceType: DeviceType.Sensor,
|
|
19617
20275
|
memberDeviceType: DeviceType.Sensor,
|
|
19618
|
-
memberDeviceTypes: [DeviceType.Sensor],
|
|
20276
|
+
memberDeviceTypes: [DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
|
|
19619
20277
|
activeWhen: void 0,
|
|
19620
20278
|
commandCaps: [],
|
|
19621
20279
|
baseUnit: baseUnitOf(input.quantity),
|
|
@@ -19623,9 +20281,10 @@ function numeric(input) {
|
|
|
19623
20281
|
accept: [{
|
|
19624
20282
|
cap: input.outputCap,
|
|
19625
20283
|
fieldPath: input.outputField
|
|
19626
|
-
}]
|
|
20284
|
+
}, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
|
|
19627
20285
|
};
|
|
19628
20286
|
}
|
|
20287
|
+
var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
|
|
19629
20288
|
function binary(input) {
|
|
19630
20289
|
return {
|
|
19631
20290
|
...input,
|
|
@@ -19651,7 +20310,14 @@ var GROUP_TEMPLATES = [
|
|
|
19651
20310
|
quantity: "temperature",
|
|
19652
20311
|
defaultAggregate: "mean",
|
|
19653
20312
|
empty: "null",
|
|
19654
|
-
companions: [NOW$
|
|
20313
|
+
companions: [NOW$3],
|
|
20314
|
+
alsoFrom: {
|
|
20315
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
20316
|
+
accept: {
|
|
20317
|
+
cap: "climate-control",
|
|
20318
|
+
fieldPath: "currentTemp"
|
|
20319
|
+
}
|
|
20320
|
+
}
|
|
19655
20321
|
}),
|
|
19656
20322
|
numeric({
|
|
19657
20323
|
id: "humidity",
|
|
@@ -19662,7 +20328,14 @@ var GROUP_TEMPLATES = [
|
|
|
19662
20328
|
quantity: "humidity",
|
|
19663
20329
|
defaultAggregate: "mean",
|
|
19664
20330
|
empty: "null",
|
|
19665
|
-
companions: [NOW$
|
|
20331
|
+
companions: [NOW$3],
|
|
20332
|
+
alsoFrom: {
|
|
20333
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
20334
|
+
accept: {
|
|
20335
|
+
cap: "climate-control",
|
|
20336
|
+
fieldPath: "currentHumidity"
|
|
20337
|
+
}
|
|
20338
|
+
}
|
|
19666
20339
|
}),
|
|
19667
20340
|
numeric({
|
|
19668
20341
|
id: "pressure",
|
|
@@ -19673,7 +20346,7 @@ var GROUP_TEMPLATES = [
|
|
|
19673
20346
|
quantity: "pressure",
|
|
19674
20347
|
defaultAggregate: "mean",
|
|
19675
20348
|
empty: "null",
|
|
19676
|
-
companions: [NOW$
|
|
20349
|
+
companions: [NOW$3]
|
|
19677
20350
|
}),
|
|
19678
20351
|
numeric({
|
|
19679
20352
|
id: "illuminance",
|
|
@@ -19684,7 +20357,7 @@ var GROUP_TEMPLATES = [
|
|
|
19684
20357
|
quantity: "illuminance",
|
|
19685
20358
|
defaultAggregate: "mean",
|
|
19686
20359
|
empty: "null",
|
|
19687
|
-
companions: [NOW$
|
|
20360
|
+
companions: [NOW$3]
|
|
19688
20361
|
}),
|
|
19689
20362
|
numeric({
|
|
19690
20363
|
id: "power",
|
|
@@ -19695,7 +20368,7 @@ var GROUP_TEMPLATES = [
|
|
|
19695
20368
|
quantity: "power",
|
|
19696
20369
|
defaultAggregate: "sum",
|
|
19697
20370
|
empty: "omit",
|
|
19698
|
-
companions: [NOW$
|
|
20371
|
+
companions: [NOW$3]
|
|
19699
20372
|
}),
|
|
19700
20373
|
numeric({
|
|
19701
20374
|
id: "energy",
|
|
@@ -19706,7 +20379,7 @@ var GROUP_TEMPLATES = [
|
|
|
19706
20379
|
quantity: "energy",
|
|
19707
20380
|
defaultAggregate: "sum",
|
|
19708
20381
|
empty: "omit",
|
|
19709
|
-
companions: [NOW$
|
|
20382
|
+
companions: [NOW$3]
|
|
19710
20383
|
}),
|
|
19711
20384
|
numeric({
|
|
19712
20385
|
id: "battery",
|
|
@@ -19741,7 +20414,7 @@ var GROUP_TEMPLATES = [
|
|
|
19741
20414
|
quantity: "device",
|
|
19742
20415
|
defaultAggregate: "mean",
|
|
19743
20416
|
empty: "null",
|
|
19744
|
-
companions: [NOW$
|
|
20417
|
+
companions: [NOW$3]
|
|
19745
20418
|
}),
|
|
19746
20419
|
binary({
|
|
19747
20420
|
id: "motion",
|
|
@@ -22143,6 +22816,36 @@ var ExposeInputSchema = object({
|
|
|
22143
22816
|
capabilities: array(string()).optional()
|
|
22144
22817
|
});
|
|
22145
22818
|
var UnexposeInputSchema = object({ deviceId: string() });
|
|
22819
|
+
/**
|
|
22820
|
+
* What an exporter may expose besides devices (D968). An action and a
|
|
22821
|
+
* notification target are LIST ENTRIES, never devices (D954): they enter an
|
|
22822
|
+
* exporter's own selection, not the device registry.
|
|
22823
|
+
*/
|
|
22824
|
+
var ExportEntityKindSchema = _enum([
|
|
22825
|
+
"device",
|
|
22826
|
+
"action",
|
|
22827
|
+
"notifier"
|
|
22828
|
+
]);
|
|
22829
|
+
var ExportEntityRefSchema = discriminatedUnion("kind", [
|
|
22830
|
+
object({
|
|
22831
|
+
kind: literal("device"),
|
|
22832
|
+
deviceId: string()
|
|
22833
|
+
}),
|
|
22834
|
+
object({
|
|
22835
|
+
kind: literal("action"),
|
|
22836
|
+
actionId: string().min(1)
|
|
22837
|
+
}),
|
|
22838
|
+
object({
|
|
22839
|
+
kind: literal("notifier"),
|
|
22840
|
+
targetId: string().min(1)
|
|
22841
|
+
})
|
|
22842
|
+
]);
|
|
22843
|
+
var ExposedEntitySchema = object({
|
|
22844
|
+
entity: ExportEntityRefSchema,
|
|
22845
|
+
exposedAs: string().optional()
|
|
22846
|
+
});
|
|
22847
|
+
var ExposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
|
|
22848
|
+
var UnexposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
|
|
22146
22849
|
var deviceExportCapability = {
|
|
22147
22850
|
name: "device-export",
|
|
22148
22851
|
scope: "system",
|
|
@@ -22172,6 +22875,16 @@ var deviceExportCapability = {
|
|
|
22172
22875
|
unexposeDevice: method(UnexposeInputSchema, _void(), {
|
|
22173
22876
|
kind: "mutation",
|
|
22174
22877
|
auth: "admin"
|
|
22878
|
+
}),
|
|
22879
|
+
listSupportedEntityKinds: optionalMethod(_void(), array(ExportEntityKindSchema)),
|
|
22880
|
+
listExposedEntities: optionalMethod(_void(), array(ExposedEntitySchema)),
|
|
22881
|
+
exposeEntity: optionalMethod(ExposeEntityInputSchema, _void(), {
|
|
22882
|
+
kind: "mutation",
|
|
22883
|
+
auth: "admin"
|
|
22884
|
+
}),
|
|
22885
|
+
unexposeEntity: optionalMethod(UnexposeEntityInputSchema, _void(), {
|
|
22886
|
+
kind: "mutation",
|
|
22887
|
+
auth: "admin"
|
|
22175
22888
|
})
|
|
22176
22889
|
}
|
|
22177
22890
|
};
|
|
@@ -43314,6 +44027,14 @@ method(object({
|
|
|
43314
44027
|
kind: "mutation",
|
|
43315
44028
|
auth: "admin"
|
|
43316
44029
|
});
|
|
44030
|
+
method(object({
|
|
44031
|
+
nodeId: string().min(1),
|
|
44032
|
+
/** Epoch ms the node was forgotten (the tombstone's `removedAt`). */
|
|
44033
|
+
removedAt: number()
|
|
44034
|
+
}), object({ counts: record(string(), number().int().nonnegative()) }), {
|
|
44035
|
+
kind: "mutation",
|
|
44036
|
+
auth: "admin"
|
|
44037
|
+
});
|
|
43317
44038
|
/**
|
|
43318
44039
|
* `device-removal-hook` — the reliable way an addon learns a device was DELETED,
|
|
43319
44040
|
* so it can delete what it keeps for that device (D865).
|
|
@@ -43961,6 +44682,17 @@ var LlmProfileSchema = object({
|
|
|
43961
44682
|
* field in its editor only when its descriptor lists it in `profileFields`. */
|
|
43962
44683
|
topK: number().int().positive().optional(),
|
|
43963
44684
|
maxTokens: number().int().positive().optional(),
|
|
44685
|
+
/** How hard the model "thinks" before it answers. Omitted = the model's own
|
|
44686
|
+
* default. `off` matters for structured output: a thinking model can spend
|
|
44687
|
+
* the whole completion on reasoning and return an empty `content`. Carried
|
|
44688
|
+
* only by the wires that have it — a kind offers the field in its editor
|
|
44689
|
+
* only when its descriptor lists it in `profileFields`. */
|
|
44690
|
+
reasoningEffort: _enum([
|
|
44691
|
+
"off",
|
|
44692
|
+
"low",
|
|
44693
|
+
"medium",
|
|
44694
|
+
"high"
|
|
44695
|
+
]).optional(),
|
|
43964
44696
|
/** Prompt context window. Advisory for cloud kinds (they enforce their own). */
|
|
43965
44697
|
contextLength: number().int().positive().optional(),
|
|
43966
44698
|
/** Default system prompt. A caller's `system` REPLACES it (never appends —
|
|
@@ -43999,6 +44731,7 @@ var LlmProfileFieldSchema = _enum([
|
|
|
43999
44731
|
"topP",
|
|
44000
44732
|
"topK",
|
|
44001
44733
|
"maxTokens",
|
|
44734
|
+
"reasoningEffort",
|
|
44002
44735
|
"contextLength",
|
|
44003
44736
|
"systemPrompt",
|
|
44004
44737
|
"timeoutMs",
|
|
@@ -44022,7 +44755,7 @@ var LlmProviderWidgetSchema = object({
|
|
|
44022
44755
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
44023
44756
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
44024
44757
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
44025
|
-
var ConfigSchemaPassthrough$
|
|
44758
|
+
var ConfigSchemaPassthrough$2 = unknown();
|
|
44026
44759
|
var LlmProfileKindDescriptorSchema = object({
|
|
44027
44760
|
kind: LlmProfileKindSchema,
|
|
44028
44761
|
label: string(),
|
|
@@ -44031,9 +44764,9 @@ var LlmProfileKindDescriptorSchema = object({
|
|
|
44031
44764
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
44032
44765
|
addonId: string(),
|
|
44033
44766
|
/** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
|
|
44034
|
-
connectionSchema: ConfigSchemaPassthrough$
|
|
44767
|
+
connectionSchema: ConfigSchemaPassthrough$2,
|
|
44035
44768
|
/** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
|
|
44036
|
-
advancedSchema: ConfigSchemaPassthrough$
|
|
44769
|
+
advancedSchema: ConfigSchemaPassthrough$2.optional(),
|
|
44037
44770
|
/** The kind's defaults; a model from `listModels` may override any of them. */
|
|
44038
44771
|
features: LlmModelFeaturesSchema,
|
|
44039
44772
|
/** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
|
|
@@ -44559,10 +45292,10 @@ var CpuBreakdownSchema = object({
|
|
|
44559
45292
|
cores: number()
|
|
44560
45293
|
});
|
|
44561
45294
|
var MemoryInfoSchema = object({
|
|
44562
|
-
percent: number(),
|
|
45295
|
+
percent: number().nullable(),
|
|
44563
45296
|
totalBytes: number(),
|
|
44564
|
-
usedBytes: number(),
|
|
44565
|
-
availableBytes: number(),
|
|
45297
|
+
usedBytes: number().nullable(),
|
|
45298
|
+
availableBytes: number().nullable(),
|
|
44566
45299
|
swapUsedBytes: number(),
|
|
44567
45300
|
swapTotalBytes: number()
|
|
44568
45301
|
});
|
|
@@ -44866,8 +45599,9 @@ var GetLoadSeriesInputSchema = object({
|
|
|
44866
45599
|
});
|
|
44867
45600
|
var SystemMetricsSchema = object({
|
|
44868
45601
|
cpuPercent: number(),
|
|
44869
|
-
|
|
44870
|
-
|
|
45602
|
+
/** `null` when the memory sample failed or was not taken yet (D393). */
|
|
45603
|
+
memoryPercent: number().nullable(),
|
|
45604
|
+
memoryUsedMB: number().nullable(),
|
|
44871
45605
|
memoryTotalMB: number(),
|
|
44872
45606
|
diskPercent: number().optional(),
|
|
44873
45607
|
temperature: number().optional(),
|
|
@@ -45103,379 +45837,6 @@ var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
|
|
|
45103
45837
|
sourcePort: number().optional()
|
|
45104
45838
|
});
|
|
45105
45839
|
method(_void(), NetworkEndpointSchema, { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), method(_void(), NetworkEndpointSchema.nullable()), method(_void(), NetworkAccessStatusSchema), method(_void(), array(NetworkEndpointEntrySchema).readonly());
|
|
45106
|
-
/**
|
|
45107
|
-
* notification-output — canonical, capability-gated notification delivery.
|
|
45108
|
-
*
|
|
45109
|
-
* Apprise-derived model (see
|
|
45110
|
-
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
45111
|
-
* callers emit ONE canonical `Notification`; each provider declares a
|
|
45112
|
-
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
45113
|
-
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
45114
|
-
* message to what the kind supports — callers never special-case a service.
|
|
45115
|
-
*
|
|
45116
|
-
* DESIGN DECISIONS (locked):
|
|
45117
|
-
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
45118
|
-
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
45119
|
-
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
45120
|
-
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
45121
|
-
* alternative would fork the UI per addon and cannot host the
|
|
45122
|
-
* discovery→adopt flow.
|
|
45123
|
-
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
45124
|
-
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
45125
|
-
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
45126
|
-
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
45127
|
-
* `addonId` the generated collection router extracts from the call input.
|
|
45128
|
-
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
45129
|
-
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
45130
|
-
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
45131
|
-
* base64 fallback needed.
|
|
45132
|
-
*
|
|
45133
|
-
* TODO (deferred, closed-set change — separate decision): add
|
|
45134
|
-
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
45135
|
-
* admin "Integrations" page.
|
|
45136
|
-
*/
|
|
45137
|
-
/**
|
|
45138
|
-
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
45139
|
-
* adapter picks what it supports and the degrade engine filters the rest.
|
|
45140
|
-
*/
|
|
45141
|
-
var AttachmentMediaTypeSchema = _enum([
|
|
45142
|
-
"image",
|
|
45143
|
-
"video",
|
|
45144
|
-
"gif",
|
|
45145
|
-
"audio",
|
|
45146
|
-
"icon"
|
|
45147
|
-
]);
|
|
45148
|
-
/**
|
|
45149
|
-
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
45150
|
-
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
45151
|
-
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
45152
|
-
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
45153
|
-
*/
|
|
45154
|
-
var AttachmentSchema = object({
|
|
45155
|
-
mediaType: AttachmentMediaTypeSchema,
|
|
45156
|
-
url: string().optional(),
|
|
45157
|
-
bytes: _instanceof(Uint8Array).optional(),
|
|
45158
|
-
mime: string().optional(),
|
|
45159
|
-
name: string().optional()
|
|
45160
|
-
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
45161
|
-
var NotificationFormatSchema = _enum([
|
|
45162
|
-
"text",
|
|
45163
|
-
"markdown",
|
|
45164
|
-
"html"
|
|
45165
|
-
]);
|
|
45166
|
-
/**
|
|
45167
|
-
* The CLOSED icon vocabulary an action button may use.
|
|
45168
|
-
*
|
|
45169
|
-
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
45170
|
-
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
45171
|
-
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
45172
|
-
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
45173
|
-
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
45174
|
-
*
|
|
45175
|
-
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
45176
|
-
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
45177
|
-
* differently.
|
|
45178
|
-
*
|
|
45179
|
-
* ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
|
|
45180
|
-
*
|
|
45181
|
-
* These names are for US. **No adapter may forward one verbatim.** Each maps
|
|
45182
|
-
* the whole set onto its own renderer's vocabulary through a
|
|
45183
|
-
* `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
|
|
45184
|
-
* fallback, so adding a member here fails every adapter's build until someone
|
|
45185
|
-
* decides its glyph, which is the only place that decision can be made
|
|
45186
|
-
* honestly.
|
|
45187
|
-
*
|
|
45188
|
-
* This paragraph is the bug. Zentik declared `actionIcons: true` and passed
|
|
45189
|
-
* `disarm` straight through; iOS feeds that string to
|
|
45190
|
-
* `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
|
|
45191
|
-
* and every snooze and alarm button arrived BLANK. A pass-through is not a
|
|
45192
|
-
* mapping, and "the field is documented" is not "the value renders".
|
|
45193
|
-
*
|
|
45194
|
-
* Adding a member is TRAIN-BOUND. The enum lives in the published
|
|
45195
|
-
* `@camstack/server` closure and the cap seam validates against the HUB's copy,
|
|
45196
|
-
* so an addon that emits a token the running hub does not know does not lose an
|
|
45197
|
-
* icon — its whole `send` fails Zod validation and the notification never
|
|
45198
|
-
* arrives. Never emit a new token from an addon before the train carrying it.
|
|
45199
|
-
*/
|
|
45200
|
-
var NotificationActionIconSchema = _enum([
|
|
45201
|
-
"acknowledge",
|
|
45202
|
-
"dismiss",
|
|
45203
|
-
"silence",
|
|
45204
|
-
"snooze",
|
|
45205
|
-
"view",
|
|
45206
|
-
"play",
|
|
45207
|
-
"open",
|
|
45208
|
-
"close",
|
|
45209
|
-
"lock",
|
|
45210
|
-
"unlock",
|
|
45211
|
-
"arm",
|
|
45212
|
-
"arm-home",
|
|
45213
|
-
"arm-away",
|
|
45214
|
-
"arm-night",
|
|
45215
|
-
"disarm",
|
|
45216
|
-
"light",
|
|
45217
|
-
"alert",
|
|
45218
|
-
"camera"
|
|
45219
|
-
]);
|
|
45220
|
-
/** A single tap-through action button. */
|
|
45221
|
-
var NotificationActionSchema = object({
|
|
45222
|
-
id: string(),
|
|
45223
|
-
label: string(),
|
|
45224
|
-
url: string().optional(),
|
|
45225
|
-
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
45226
|
-
icon: NotificationActionIconSchema.optional(),
|
|
45227
|
-
/**
|
|
45228
|
-
* Renders in a warning style where the notifier supports it.
|
|
45229
|
-
*
|
|
45230
|
-
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
45231
|
-
* else — see `notification-center/action-token.ts` for what that does and
|
|
45232
|
-
* does not buy.
|
|
45233
|
-
*/
|
|
45234
|
-
destructive: boolean().optional(),
|
|
45235
|
-
/**
|
|
45236
|
-
* How the tap should REACH the url.
|
|
45237
|
-
*
|
|
45238
|
-
* `navigate` (absent, and every button authored before this field) opens it:
|
|
45239
|
-
* the phone leaves the notification and shows whatever the callback returns.
|
|
45240
|
-
* That is right for a button whose answer the operator wants to read.
|
|
45241
|
-
*
|
|
45242
|
-
* `background` fires it as a POST and stays put. It exists for the buttons
|
|
45243
|
-
* whose whole point is not to interrupt — "silence this for 30 minutes" is
|
|
45244
|
-
* an answer to the notification, and being thrown into a browser tab to
|
|
45245
|
-
* confirm it costs more attention than the notification did. A backend that
|
|
45246
|
-
* cannot do a background call renders it as an ordinary link (the adapters
|
|
45247
|
-
* fall back rather than dropping the button), so this is a preference, never
|
|
45248
|
-
* a requirement.
|
|
45249
|
-
*/
|
|
45250
|
-
mode: _enum(["navigate", "background"]).optional()
|
|
45251
|
-
});
|
|
45252
|
-
/**
|
|
45253
|
-
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
45254
|
-
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
45255
|
-
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
45256
|
-
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
45257
|
-
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
45258
|
-
* `priority` for that one target.
|
|
45259
|
-
*/
|
|
45260
|
-
var NotificationSchema = object({
|
|
45261
|
-
body: string(),
|
|
45262
|
-
title: string().optional(),
|
|
45263
|
-
format: NotificationFormatSchema.default("text"),
|
|
45264
|
-
priority: number().int().min(1).max(5).default(3),
|
|
45265
|
-
level: string().optional(),
|
|
45266
|
-
attachments: array(AttachmentSchema).optional(),
|
|
45267
|
-
clickUrl: string().optional(),
|
|
45268
|
-
actions: array(NotificationActionSchema).optional(),
|
|
45269
|
-
sound: string().optional(),
|
|
45270
|
-
ttl: number().optional(),
|
|
45271
|
-
tag: string().optional(),
|
|
45272
|
-
deviceId: number().optional(),
|
|
45273
|
-
eventId: string().optional(),
|
|
45274
|
-
metadata: record(string(), unknown()).optional()
|
|
45275
|
-
});
|
|
45276
|
-
/** One declared native severity/priority level for a kind. */
|
|
45277
|
-
var TargetKindLevelSchema = object({
|
|
45278
|
-
id: string(),
|
|
45279
|
-
label: string(),
|
|
45280
|
-
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
45281
|
-
ordinal: number().int().min(1).max(5).nullable(),
|
|
45282
|
-
flags: object({
|
|
45283
|
-
critical: boolean().optional(),
|
|
45284
|
-
silent: boolean().optional(),
|
|
45285
|
-
noPush: boolean().optional()
|
|
45286
|
-
}).optional(),
|
|
45287
|
-
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
45288
|
-
requires: array(string()).optional(),
|
|
45289
|
-
description: string().optional()
|
|
45290
|
-
});
|
|
45291
|
-
/** The full capability block consulted before dispatch. */
|
|
45292
|
-
var TargetKindCapsSchema = object({
|
|
45293
|
-
attachments: object({
|
|
45294
|
-
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
45295
|
-
mode: _enum([
|
|
45296
|
-
"url",
|
|
45297
|
-
"bytes",
|
|
45298
|
-
"both"
|
|
45299
|
-
]),
|
|
45300
|
-
max: number().int().nonnegative(),
|
|
45301
|
-
maxBytes: number().int().positive().optional()
|
|
45302
|
-
}),
|
|
45303
|
-
/** Max action buttons (0 = none). */
|
|
45304
|
-
actions: number().int().nonnegative(),
|
|
45305
|
-
/**
|
|
45306
|
-
* Whether this kind renders a per-action ICON.
|
|
45307
|
-
*
|
|
45308
|
-
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
45309
|
-
* run on the addon cap path — three production failures in one day taught
|
|
45310
|
-
* this repo that once. Absent is read as false by the degrade engine, which
|
|
45311
|
-
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
45312
|
-
* assumed and dropped costs the operator's trust in the field.
|
|
45313
|
-
*/
|
|
45314
|
-
actionIcons: boolean().optional(),
|
|
45315
|
-
levels: array(TargetKindLevelSchema),
|
|
45316
|
-
format: array(NotificationFormatSchema),
|
|
45317
|
-
clickUrl: boolean(),
|
|
45318
|
-
sound: boolean(),
|
|
45319
|
-
ttl: boolean(),
|
|
45320
|
-
bodyMaxLen: number().int().positive()
|
|
45321
|
-
});
|
|
45322
|
-
/**
|
|
45323
|
-
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
45324
|
-
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
45325
|
-
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
45326
|
-
* the union is large and not meant for runtime validation here; the exported
|
|
45327
|
-
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
45328
|
-
*/
|
|
45329
|
-
var ConfigSchemaPassthrough$2 = unknown();
|
|
45330
|
-
var TargetKindSchema = object({
|
|
45331
|
-
kind: string(),
|
|
45332
|
-
label: string(),
|
|
45333
|
-
icon: string(),
|
|
45334
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
45335
|
-
addonId: string(),
|
|
45336
|
-
/**
|
|
45337
|
-
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
45338
|
-
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
45339
|
-
* when the addon bundles no icon for that kind — the client then falls back
|
|
45340
|
-
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
45341
|
-
*
|
|
45342
|
-
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
45343
|
-
* client, and a native client joins it onto its own hub base.
|
|
45344
|
-
*
|
|
45345
|
-
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
45346
|
-
* field that survived only because the runtime cap-router forwards provider
|
|
45347
|
-
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
45348
|
-
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
45349
|
-
* broken silently the moment output validation was tightened anywhere.
|
|
45350
|
-
*/
|
|
45351
|
-
iconUrl: string().optional(),
|
|
45352
|
-
/**
|
|
45353
|
-
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
45354
|
-
*
|
|
45355
|
-
* The server knows this and therefore says it, because the client cannot
|
|
45356
|
-
* safely guess: a React-Native client renders SVG and raster through two
|
|
45357
|
-
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
45358
|
-
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
45359
|
-
* placeholder glyph for every vector icon while the web build looked fine.
|
|
45360
|
-
*
|
|
45361
|
-
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
45362
|
-
* not been updated — a client that cannot determine the type should prefer
|
|
45363
|
-
* its raster path, which is the safe default for an unknown image.
|
|
45364
|
-
*/
|
|
45365
|
-
iconMediaType: string().optional(),
|
|
45366
|
-
configSchema: ConfigSchemaPassthrough$2,
|
|
45367
|
-
/**
|
|
45368
|
-
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
45369
|
-
* base URL, instance, chat, recipient). A save that changes any of them
|
|
45370
|
-
* while leaving a secret redacted is refused by the provider (D634), so an
|
|
45371
|
-
* editor uses this to ask for the secret on exactly those edits instead of
|
|
45372
|
-
* on every edit.
|
|
45373
|
-
*
|
|
45374
|
-
* Optional: absent from a provider that holds no secret (the Home Assistant
|
|
45375
|
-
* kinds) and from a provider older than this field — an editor that finds
|
|
45376
|
-
* it absent must assume ANY edit may need the secret.
|
|
45377
|
-
*/
|
|
45378
|
-
destinationKeys: array(string()).optional(),
|
|
45379
|
-
supportsDiscovery: boolean(),
|
|
45380
|
-
caps: TargetKindCapsSchema
|
|
45381
|
-
});
|
|
45382
|
-
/**
|
|
45383
|
-
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
45384
|
-
* (return a presence marker only) when serving `listTargets` — never
|
|
45385
|
-
* round-trip a stored secret to the UI.
|
|
45386
|
-
*/
|
|
45387
|
-
var TargetSchema = object({
|
|
45388
|
-
id: string(),
|
|
45389
|
-
name: string(),
|
|
45390
|
-
kind: string(),
|
|
45391
|
-
addonId: string(),
|
|
45392
|
-
enabled: boolean(),
|
|
45393
|
-
config: record(string(), unknown())
|
|
45394
|
-
});
|
|
45395
|
-
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
45396
|
-
var DiscoveredTargetSchema = object({
|
|
45397
|
-
kind: string(),
|
|
45398
|
-
suggestedName: string(),
|
|
45399
|
-
config: record(string(), unknown())
|
|
45400
|
-
});
|
|
45401
|
-
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
45402
|
-
var RenderedAsSchema = object({
|
|
45403
|
-
level: string(),
|
|
45404
|
-
format: NotificationFormatSchema,
|
|
45405
|
-
attachmentsSent: number().int().nonnegative(),
|
|
45406
|
-
actionsSent: number().int().nonnegative(),
|
|
45407
|
-
truncated: boolean(),
|
|
45408
|
-
dropped: array(string())
|
|
45409
|
-
});
|
|
45410
|
-
var SendResultSchema = object({
|
|
45411
|
-
success: boolean(),
|
|
45412
|
-
error: string().optional(),
|
|
45413
|
-
renderedAs: RenderedAsSchema.optional()
|
|
45414
|
-
});
|
|
45415
|
-
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
45416
|
-
var TestResultSchema = SendResultSchema;
|
|
45417
|
-
/**
|
|
45418
|
-
* Pre-save credential probe against a partial (unsaved) target config.
|
|
45419
|
-
* `resolvedUrl` never includes secrets (token stripped from path).
|
|
45420
|
-
*/
|
|
45421
|
-
var ProbeTargetConfigResultSchema = object({
|
|
45422
|
-
ok: boolean(),
|
|
45423
|
-
resolvedUrl: string(),
|
|
45424
|
-
httpStatus: number().int().optional(),
|
|
45425
|
-
stateInstance: string().optional(),
|
|
45426
|
-
error: string().optional()
|
|
45427
|
-
});
|
|
45428
|
-
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
|
|
45429
|
-
kind: string(),
|
|
45430
|
-
config: record(string(), unknown()).optional(),
|
|
45431
|
-
/**
|
|
45432
|
-
* When editing / duplicating, the blank password field never round-trips
|
|
45433
|
-
* the stored token. Pass the source target id so the provider can restore
|
|
45434
|
-
* secrets server-side before dialling (same merge as upsert).
|
|
45435
|
-
*/
|
|
45436
|
-
targetId: string().optional()
|
|
45437
|
-
}), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
|
|
45438
|
-
kind: string(),
|
|
45439
|
-
config: record(string(), unknown()),
|
|
45440
|
-
/** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
|
|
45441
|
-
targetId: string().optional()
|
|
45442
|
-
}), ProbeTargetConfigResultSchema, {
|
|
45443
|
-
kind: "mutation",
|
|
45444
|
-
auth: "admin"
|
|
45445
|
-
}), method(object({
|
|
45446
|
-
targetId: string(),
|
|
45447
|
-
notification: NotificationSchema
|
|
45448
|
-
}), SendResultSchema, {
|
|
45449
|
-
kind: "mutation",
|
|
45450
|
-
auth: "admin"
|
|
45451
|
-
}), method(object({
|
|
45452
|
-
targetId: string(),
|
|
45453
|
-
sample: NotificationSchema.optional()
|
|
45454
|
-
}), TestResultSchema, {
|
|
45455
|
-
kind: "mutation",
|
|
45456
|
-
auth: "admin"
|
|
45457
|
-
}), method(object({
|
|
45458
|
-
target: TargetSchema,
|
|
45459
|
-
/**
|
|
45460
|
-
* Duplicate flow: create a NEW target id while copying secrets from an
|
|
45461
|
-
* existing row. The UI never holds the stored token; blank / redacted
|
|
45462
|
-
* password fields are restored from this source (D634 still applies if
|
|
45463
|
-
* destinations diverge without a re-typed secret).
|
|
45464
|
-
*/
|
|
45465
|
-
cloneSecretsFrom: string().optional()
|
|
45466
|
-
}), TargetSchema, {
|
|
45467
|
-
kind: "mutation",
|
|
45468
|
-
auth: "admin"
|
|
45469
|
-
}), method(object({ targetId: string() }), _void(), {
|
|
45470
|
-
kind: "mutation",
|
|
45471
|
-
auth: "admin"
|
|
45472
|
-
}), method(object({
|
|
45473
|
-
targetId: string(),
|
|
45474
|
-
enabled: boolean()
|
|
45475
|
-
}), _void(), {
|
|
45476
|
-
kind: "mutation",
|
|
45477
|
-
auth: "admin"
|
|
45478
|
-
});
|
|
45479
45840
|
var AUDIO_MACRO_LABELS = [
|
|
45480
45841
|
{
|
|
45481
45842
|
id: "speech",
|
|
@@ -51876,14 +52237,6 @@ var EngineProvisioningSchema = object({
|
|
|
51876
52237
|
*/
|
|
51877
52238
|
configIssues: array(string()).optional()
|
|
51878
52239
|
});
|
|
51879
|
-
var PipelineStepInputSchema = lazy(() => object({
|
|
51880
|
-
addonId: string(),
|
|
51881
|
-
modelId: string().optional(),
|
|
51882
|
-
enabled: boolean().default(true),
|
|
51883
|
-
children: array(PipelineStepInputSchema).optional(),
|
|
51884
|
-
settings: record(string(), unknown()).optional(),
|
|
51885
|
-
jumpDeviceKey: string().optional()
|
|
51886
|
-
}));
|
|
51887
52240
|
var ModelSubstitutionSchema = object({
|
|
51888
52241
|
addonId: string(),
|
|
51889
52242
|
chosen: string(),
|
|
@@ -51962,7 +52315,6 @@ var ConfigUISchemaBridge = custom();
|
|
|
51962
52315
|
var ConfigUISchemaNullableBridge = custom();
|
|
51963
52316
|
var InferenceCapabilitiesBridge = custom();
|
|
51964
52317
|
var ModelAvailabilityListBridge = custom();
|
|
51965
|
-
var PipelineRunResultBridge = custom();
|
|
51966
52318
|
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
51967
52319
|
modelId: string(),
|
|
51968
52320
|
settings: record(string(), unknown()).readonly()
|
|
@@ -57740,7 +58092,9 @@ var ManifestShapeSchema = object({
|
|
|
57740
58092
|
icon: string().optional()
|
|
57741
58093
|
}).optional(),
|
|
57742
58094
|
protected: boolean().optional(),
|
|
57743
|
-
removable: boolean().optional()
|
|
58095
|
+
removable: boolean().optional(),
|
|
58096
|
+
/** Declared Integrations-page block (mirror of `AddonDeclaration.integrationSection`). */
|
|
58097
|
+
integrationSection: _enum(["system", "providers"]).optional()
|
|
57744
58098
|
});
|
|
57745
58099
|
var AddonProcessSchema = object({
|
|
57746
58100
|
pid: number().optional(),
|
|
@@ -58461,11 +58815,373 @@ DeviceType.Light, method(object({
|
|
|
58461
58815
|
level: number().min(0).max(100),
|
|
58462
58816
|
lastChangedAt: number()
|
|
58463
58817
|
});
|
|
58818
|
+
/**
|
|
58819
|
+
* The role vocabulary of a remote (D963): what a button MEANS, independent of
|
|
58820
|
+
* how it is wired. A layout template places buttons by role; a device binds a
|
|
58821
|
+
* role to an action; an exporter asks for a role by name. Roles are shared so
|
|
58822
|
+
* one layout fits every appliance and one voice command fits every binding.
|
|
58823
|
+
*
|
|
58824
|
+
* A role outside this list is `custom:<key>` — the operator's own button (a
|
|
58825
|
+
* SmartIR source, a channel preset). The key is a lowercase slug.
|
|
58826
|
+
*/
|
|
58827
|
+
var REMOTE_KNOWN_ROLES = [
|
|
58828
|
+
"power",
|
|
58829
|
+
"power_on",
|
|
58830
|
+
"power_off",
|
|
58831
|
+
"volume_up",
|
|
58832
|
+
"volume_down",
|
|
58833
|
+
"mute",
|
|
58834
|
+
"channel_up",
|
|
58835
|
+
"channel_down",
|
|
58836
|
+
"up",
|
|
58837
|
+
"down",
|
|
58838
|
+
"left",
|
|
58839
|
+
"right",
|
|
58840
|
+
"ok",
|
|
58841
|
+
"back",
|
|
58842
|
+
"home",
|
|
58843
|
+
"menu",
|
|
58844
|
+
"info",
|
|
58845
|
+
"guide",
|
|
58846
|
+
"exit",
|
|
58847
|
+
"input",
|
|
58848
|
+
"play",
|
|
58849
|
+
"pause",
|
|
58850
|
+
"play_pause",
|
|
58851
|
+
"stop",
|
|
58852
|
+
"next",
|
|
58853
|
+
"previous",
|
|
58854
|
+
"fast_forward",
|
|
58855
|
+
"rewind",
|
|
58856
|
+
"digit_0",
|
|
58857
|
+
"digit_1",
|
|
58858
|
+
"digit_2",
|
|
58859
|
+
"digit_3",
|
|
58860
|
+
"digit_4",
|
|
58861
|
+
"digit_5",
|
|
58862
|
+
"digit_6",
|
|
58863
|
+
"digit_7",
|
|
58864
|
+
"digit_8",
|
|
58865
|
+
"digit_9"
|
|
58866
|
+
];
|
|
58867
|
+
var CUSTOM_KEY_RE = /^[a-z0-9][a-z0-9_]{0,47}$/;
|
|
58868
|
+
var KNOWN_ROLES = new Set(REMOTE_KNOWN_ROLES);
|
|
58869
|
+
function isRemoteKnownRole(value) {
|
|
58870
|
+
return KNOWN_ROLES.has(value);
|
|
58871
|
+
}
|
|
58872
|
+
function isRemoteCustomKey(key) {
|
|
58873
|
+
return CUSTOM_KEY_RE.test(key);
|
|
58874
|
+
}
|
|
58875
|
+
/** The key of a `custom:<key>` role, or null for any other string. */
|
|
58876
|
+
function customKeyOfRole(role) {
|
|
58877
|
+
if (!role.startsWith("custom:")) return null;
|
|
58878
|
+
const key = role.slice(7);
|
|
58879
|
+
return isRemoteCustomKey(key) ? key : null;
|
|
58880
|
+
}
|
|
58881
|
+
function isRemoteRole(value) {
|
|
58882
|
+
return isRemoteKnownRole(value) || customKeyOfRole(value) !== null;
|
|
58883
|
+
}
|
|
58884
|
+
var RemoteRoleSchema = string().refine(isRemoteRole, { message: "a role is one of the known roles or custom:<key> (lowercase letters, digits, _)" });
|
|
58885
|
+
var RemoteBindingSchema = object({ action: AutomationCapStepSchema.extend({ deviceId: number().int().nonnegative() }) });
|
|
58886
|
+
var RemoteCustomButtonSchema = object({
|
|
58887
|
+
/** The slug after `custom:` in the role. */
|
|
58888
|
+
key: string().refine(isRemoteCustomKey, { message: "a lowercase slug" }),
|
|
58889
|
+
/** What the operator calls it, and what a voice command may name. */
|
|
58890
|
+
name: string().min(1).max(60)
|
|
58891
|
+
});
|
|
58892
|
+
var RemotePowerModeSchema = _enum(["toggle", "discrete"]);
|
|
58893
|
+
var RemoteConfigSchema = object({
|
|
58894
|
+
layoutTemplateId: string().min(1).nullable(),
|
|
58895
|
+
/**
|
|
58896
|
+
* The transmitter device new bindings and an import send through. A binding
|
|
58897
|
+
* names its own device, so one command may override it.
|
|
58898
|
+
*/
|
|
58899
|
+
defaultTransmitterId: number().int().nonnegative().nullable().default(null),
|
|
58900
|
+
/** Keyed by role. A role with no entry falls back to the native cap. */
|
|
58901
|
+
bindings: record(string(), RemoteBindingSchema),
|
|
58902
|
+
customButtons: array(RemoteCustomButtonSchema).max(100),
|
|
58903
|
+
power: object({ mode: RemotePowerModeSchema })
|
|
58904
|
+
}).superRefine((config, ctx) => {
|
|
58905
|
+
const roles = Object.keys(config.bindings);
|
|
58906
|
+
if (roles.length > 200) ctx.addIssue({
|
|
58907
|
+
code: "custom",
|
|
58908
|
+
message: "too many bindings",
|
|
58909
|
+
path: ["bindings"]
|
|
58910
|
+
});
|
|
58911
|
+
for (const role of roles) if (!isRemoteRole(role)) ctx.addIssue({
|
|
58912
|
+
code: "custom",
|
|
58913
|
+
message: `"${role}" is not a role`,
|
|
58914
|
+
path: ["bindings", role]
|
|
58915
|
+
});
|
|
58916
|
+
const keys = /* @__PURE__ */ new Set();
|
|
58917
|
+
config.customButtons.forEach((button, index) => {
|
|
58918
|
+
if (keys.has(button.key)) ctx.addIssue({
|
|
58919
|
+
code: "custom",
|
|
58920
|
+
message: `custom button "${button.key}" is listed twice`,
|
|
58921
|
+
path: [
|
|
58922
|
+
"customButtons",
|
|
58923
|
+
index,
|
|
58924
|
+
"key"
|
|
58925
|
+
]
|
|
58926
|
+
});
|
|
58927
|
+
keys.add(button.key);
|
|
58928
|
+
});
|
|
58929
|
+
for (const role of roles) {
|
|
58930
|
+
const key = customKeyOfRole(role);
|
|
58931
|
+
if (key !== null && !keys.has(key)) ctx.addIssue({
|
|
58932
|
+
code: "custom",
|
|
58933
|
+
message: `${role} is bound but has no entry in customButtons`,
|
|
58934
|
+
path: ["bindings", role]
|
|
58935
|
+
});
|
|
58936
|
+
}
|
|
58937
|
+
});
|
|
58938
|
+
object({
|
|
58939
|
+
power: object({
|
|
58940
|
+
state: _enum(["on", "off"]),
|
|
58941
|
+
at: number()
|
|
58942
|
+
}).nullable(),
|
|
58943
|
+
muted: object({
|
|
58944
|
+
value: boolean(),
|
|
58945
|
+
at: number()
|
|
58946
|
+
}).nullable()
|
|
58947
|
+
});
|
|
58948
|
+
var RemoteLayoutButtonSchema = object({
|
|
58949
|
+
id: string().min(1).max(40),
|
|
58950
|
+
/** 0-based grid position. */
|
|
58951
|
+
row: number().int().min(0).max(24),
|
|
58952
|
+
col: number().int().min(0).max(24),
|
|
58953
|
+
rowSpan: number().int().min(1).max(24),
|
|
58954
|
+
colSpan: number().int().min(1).max(24),
|
|
58955
|
+
icon: string().min(1).max(60).optional(),
|
|
58956
|
+
label: string().min(1).max(40).optional(),
|
|
58957
|
+
role: RemoteRoleSchema
|
|
58958
|
+
});
|
|
58959
|
+
object({
|
|
58960
|
+
columns: number().int().min(1).max(24),
|
|
58961
|
+
rows: number().int().min(1).max(24),
|
|
58962
|
+
buttons: array(RemoteLayoutButtonSchema).max(200)
|
|
58963
|
+
}).superRefine((grid, ctx) => {
|
|
58964
|
+
const ids = /* @__PURE__ */ new Set();
|
|
58965
|
+
const taken = /* @__PURE__ */ new Map();
|
|
58966
|
+
grid.buttons.forEach((button, index) => {
|
|
58967
|
+
if (ids.has(button.id)) ctx.addIssue({
|
|
58968
|
+
code: "custom",
|
|
58969
|
+
message: `button id "${button.id}" is used twice`,
|
|
58970
|
+
path: [
|
|
58971
|
+
"buttons",
|
|
58972
|
+
index,
|
|
58973
|
+
"id"
|
|
58974
|
+
]
|
|
58975
|
+
});
|
|
58976
|
+
ids.add(button.id);
|
|
58977
|
+
if (button.row + button.rowSpan > grid.rows || button.col + button.colSpan > grid.columns) {
|
|
58978
|
+
ctx.addIssue({
|
|
58979
|
+
code: "custom",
|
|
58980
|
+
message: `button "${button.id}" leaves the grid`,
|
|
58981
|
+
path: ["buttons", index]
|
|
58982
|
+
});
|
|
58983
|
+
return;
|
|
58984
|
+
}
|
|
58985
|
+
for (let r = button.row; r < button.row + button.rowSpan; r += 1) for (let c = button.col; c < button.col + button.colSpan; c += 1) {
|
|
58986
|
+
const cell = `${r}:${c}`;
|
|
58987
|
+
const other = taken.get(cell);
|
|
58988
|
+
if (other !== void 0) {
|
|
58989
|
+
ctx.addIssue({
|
|
58990
|
+
code: "custom",
|
|
58991
|
+
message: `buttons "${other}" and "${button.id}" overlap`,
|
|
58992
|
+
path: ["buttons", index]
|
|
58993
|
+
});
|
|
58994
|
+
return;
|
|
58995
|
+
}
|
|
58996
|
+
taken.set(cell, button.id);
|
|
58997
|
+
}
|
|
58998
|
+
});
|
|
58999
|
+
});
|
|
59000
|
+
var RemoteBoundCommandSchema = object({
|
|
59001
|
+
role: RemoteRoleSchema,
|
|
59002
|
+
/** The operator's name for a custom button; absent for a known role. */
|
|
59003
|
+
label: string().optional(),
|
|
59004
|
+
custom: boolean()
|
|
59005
|
+
});
|
|
59006
|
+
var RemoteCommandListSchema = object({
|
|
59007
|
+
layoutTemplateId: string().nullable(),
|
|
59008
|
+
power: object({ mode: RemotePowerModeSchema }),
|
|
59009
|
+
/** Only the roles that are BOUND — the ones a press can reach. */
|
|
59010
|
+
commands: array(RemoteBoundCommandSchema)
|
|
59011
|
+
});
|
|
59012
|
+
var RemoteRefusalReasonSchema = _enum([
|
|
59013
|
+
"no-remote",
|
|
59014
|
+
"unbound-role",
|
|
59015
|
+
"action-failed"
|
|
59016
|
+
]);
|
|
59017
|
+
var RemoteSendResultSchema = discriminatedUnion("status", [
|
|
59018
|
+
object({
|
|
59019
|
+
status: literal("sent"),
|
|
59020
|
+
/** How many times the action ran. */
|
|
59021
|
+
sends: number().int().min(1)
|
|
59022
|
+
}),
|
|
59023
|
+
object({
|
|
59024
|
+
status: literal("skipped"),
|
|
59025
|
+
reason: literal("already-in-state")
|
|
59026
|
+
}),
|
|
59027
|
+
object({
|
|
59028
|
+
status: literal("refused"),
|
|
59029
|
+
reason: RemoteRefusalReasonSchema,
|
|
59030
|
+
detail: string().optional()
|
|
59031
|
+
})
|
|
59032
|
+
]);
|
|
59033
|
+
var RemoteMediaCommandSchema = _enum([
|
|
59034
|
+
"play",
|
|
59035
|
+
"pause",
|
|
59036
|
+
"stop",
|
|
59037
|
+
"next",
|
|
59038
|
+
"previous",
|
|
59039
|
+
"setMute",
|
|
59040
|
+
"selectSource"
|
|
59041
|
+
]);
|
|
59042
|
+
/** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
|
|
59043
|
+
var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
|
|
59044
|
+
var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status: literal("saved") }), object({
|
|
59045
|
+
status: literal("refused"),
|
|
59046
|
+
reason: _enum(["unknown-template", "not-a-media-player"]),
|
|
59047
|
+
detail: string()
|
|
59048
|
+
})]);
|
|
59049
|
+
var deviceInput = object({ deviceId: number().int().nonnegative() });
|
|
59050
|
+
DeviceType.MediaPlayer;
|
|
59051
|
+
method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
|
|
59052
|
+
kind: "mutation",
|
|
59053
|
+
auth: "admin"
|
|
59054
|
+
}), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
|
|
59055
|
+
role: RemoteRoleSchema,
|
|
59056
|
+
/** Sends in a row (volume steps). */
|
|
59057
|
+
repeat: number().int().min(1).max(50).default(1)
|
|
59058
|
+
}), RemoteSendResultSchema, {
|
|
59059
|
+
kind: "mutation",
|
|
59060
|
+
auth: "protected"
|
|
59061
|
+
}), method(deviceInput.extend({
|
|
59062
|
+
command: RemoteMediaCommandSchema,
|
|
59063
|
+
muted: boolean().optional(),
|
|
59064
|
+
source: string().optional(),
|
|
59065
|
+
repeat: number().int().min(1).max(50).default(1)
|
|
59066
|
+
}), RemoteMediaCommandResultSchema, {
|
|
59067
|
+
kind: "mutation",
|
|
59068
|
+
auth: "protected"
|
|
59069
|
+
});
|
|
59070
|
+
var TemplateKindSchema = _enum(["remote"]);
|
|
59071
|
+
/**
|
|
59072
|
+
* template — the generic store of reusable, named operator data (D963). A
|
|
59073
|
+
* record is `{ id, kind, name, payload }`; the kinds (today only `remote`, the
|
|
59074
|
+
* button grid of a remote) and the schema each payload must satisfy are
|
|
59075
|
+
* declared by the system in `template-kinds.ts`. Nothing here is specific to a
|
|
59076
|
+
* kind: the engine validates a payload against its kind's schema and, on a
|
|
59077
|
+
* delete, asks the kind's owner whether anything still points at the record.
|
|
59078
|
+
*
|
|
59079
|
+
* Every refusal is a typed result — a UI says "unknown kind" or names the
|
|
59080
|
+
* devices that still use a template, without parsing text.
|
|
59081
|
+
*/
|
|
59082
|
+
var TemplateRecordSchema = object({
|
|
59083
|
+
id: string().min(1),
|
|
59084
|
+
kind: TemplateKindSchema,
|
|
59085
|
+
name: string().min(1).max(120),
|
|
59086
|
+
/** Shaped by the kind; `checkTemplatePayload(kind, payload)` reads it. */
|
|
59087
|
+
payload: unknown(),
|
|
59088
|
+
createdAt: number(),
|
|
59089
|
+
updatedAt: number()
|
|
59090
|
+
});
|
|
59091
|
+
var TemplateWriteResultSchema = discriminatedUnion("status", [object({
|
|
59092
|
+
status: literal("saved"),
|
|
59093
|
+
template: TemplateRecordSchema
|
|
59094
|
+
}), object({
|
|
59095
|
+
status: literal("refused"),
|
|
59096
|
+
reason: _enum(["invalid-payload", "not-found"]),
|
|
59097
|
+
detail: string()
|
|
59098
|
+
})]);
|
|
59099
|
+
/** A device still pointing at a template. */
|
|
59100
|
+
var TemplateUserSchema = object({
|
|
59101
|
+
deviceId: number().int().nonnegative(),
|
|
59102
|
+
name: string()
|
|
59103
|
+
});
|
|
59104
|
+
var TemplateDeleteResultSchema = discriminatedUnion("status", [
|
|
59105
|
+
object({ status: literal("deleted") }),
|
|
59106
|
+
object({ status: literal("not-found") }),
|
|
59107
|
+
object({
|
|
59108
|
+
status: literal("in-use"),
|
|
59109
|
+
devices: array(TemplateUserSchema).min(1)
|
|
59110
|
+
})
|
|
59111
|
+
]);
|
|
59112
|
+
method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSchema), { auth: "protected" }), method(object({ id: string().min(1) }), TemplateRecordSchema.nullable(), { auth: "protected" }), method(object({
|
|
59113
|
+
kind: TemplateKindSchema,
|
|
59114
|
+
name: string().min(1).max(120),
|
|
59115
|
+
payload: unknown()
|
|
59116
|
+
}), TemplateWriteResultSchema, {
|
|
59117
|
+
kind: "mutation",
|
|
59118
|
+
auth: "admin"
|
|
59119
|
+
}), method(object({
|
|
59120
|
+
id: string().min(1),
|
|
59121
|
+
name: string().min(1).max(120).optional(),
|
|
59122
|
+
payload: unknown().optional()
|
|
59123
|
+
}), TemplateWriteResultSchema, {
|
|
59124
|
+
kind: "mutation",
|
|
59125
|
+
auth: "admin"
|
|
59126
|
+
}), method(object({ id: string().min(1) }), TemplateDeleteResultSchema, {
|
|
59127
|
+
kind: "mutation",
|
|
59128
|
+
auth: "admin"
|
|
59129
|
+
});
|
|
58464
59130
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
58465
59131
|
kind: "mutation",
|
|
58466
59132
|
auth: "protected"
|
|
58467
59133
|
});
|
|
58468
59134
|
/**
|
|
59135
|
+
* A pulse train in signed microseconds: mark (+) first, then space (-), strictly
|
|
59136
|
+
* alternating, no zeros, 2..1024 entries.
|
|
59137
|
+
*/
|
|
59138
|
+
var IrTimingsSchema = array(number().int()).min(2).max(1024).superRefine((timings, ctx) => {
|
|
59139
|
+
timings.forEach((value, index) => {
|
|
59140
|
+
const expectMark = index % 2 === 0;
|
|
59141
|
+
if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
|
|
59142
|
+
code: "custom",
|
|
59143
|
+
message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
|
|
59144
|
+
path: [index]
|
|
59145
|
+
});
|
|
59146
|
+
});
|
|
59147
|
+
});
|
|
59148
|
+
/** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
|
|
59149
|
+
var TransmitSettingsSchema = object({
|
|
59150
|
+
carrierHz: number().int().positive().optional(),
|
|
59151
|
+
dutyCyclePercent: number().int().min(1).max(100).optional(),
|
|
59152
|
+
repeat: number().int().min(0).max(20).optional(),
|
|
59153
|
+
repeatDelayMs: number().int().min(0).optional()
|
|
59154
|
+
});
|
|
59155
|
+
/** The setting keys a transmitter may declare as settable (`getInfo.settable`). */
|
|
59156
|
+
var TransmitSettingKeySchema = _enum([
|
|
59157
|
+
"carrierHz",
|
|
59158
|
+
"dutyCyclePercent",
|
|
59159
|
+
"repeat",
|
|
59160
|
+
"repeatDelayMs"
|
|
59161
|
+
]);
|
|
59162
|
+
var IrMediumSchema = _enum(["ir", "rf"]);
|
|
59163
|
+
var IrSendResultSchema = object({
|
|
59164
|
+
ok: literal(true),
|
|
59165
|
+
/** Settings the transmitter could not apply; the train was still sent. */
|
|
59166
|
+
ignoredSettings: array(string())
|
|
59167
|
+
});
|
|
59168
|
+
var IrTransmitterInfoSchema = object({
|
|
59169
|
+
media: array(IrMediumSchema),
|
|
59170
|
+
settable: array(TransmitSettingKeySchema),
|
|
59171
|
+
maxTimings: number().int().positive()
|
|
59172
|
+
});
|
|
59173
|
+
DeviceType.Generic, method(object({
|
|
59174
|
+
deviceId: number().int().nonnegative(),
|
|
59175
|
+
timings: IrTimingsSchema,
|
|
59176
|
+
settings: TransmitSettingsSchema.optional()
|
|
59177
|
+
}), IrSendResultSchema, {
|
|
59178
|
+
kind: "mutation",
|
|
59179
|
+
auth: "protected"
|
|
59180
|
+
}), method(object({ deviceId: number().int().nonnegative() }), IrTransmitterInfoSchema, {
|
|
59181
|
+
kind: "query",
|
|
59182
|
+
auth: "protected"
|
|
59183
|
+
});
|
|
59184
|
+
/**
|
|
58469
59185
|
* `calendar-source` — collection cap exposing per-provider calendars and
|
|
58470
59186
|
* their events. Every addon that contributes calendars (Home Assistant,
|
|
58471
59187
|
* a future Google Calendar addon, …) registers a provider here. The hub
|
|
@@ -59485,7 +60201,7 @@ object({
|
|
|
59485
60201
|
/** Ms epoch of the last value received from the appliance; 0 = never. */
|
|
59486
60202
|
lastFetchedAt: number()
|
|
59487
60203
|
});
|
|
59488
|
-
var DeviceIdSchema = number().int().nonnegative();
|
|
60204
|
+
var DeviceIdSchema$1 = number().int().nonnegative();
|
|
59489
60205
|
/** A value a program option or setting can take. */
|
|
59490
60206
|
var DishwasherValueSchema = union([
|
|
59491
60207
|
boolean(),
|
|
@@ -59549,77 +60265,77 @@ var DishwasherOptionsSchema = object({
|
|
|
59549
60265
|
options: array(DishwasherOptionDescriptorSchema)
|
|
59550
60266
|
});
|
|
59551
60267
|
DeviceType.Dishwasher, method(object({
|
|
59552
|
-
deviceId: DeviceIdSchema,
|
|
60268
|
+
deviceId: DeviceIdSchema$1,
|
|
59553
60269
|
program: string().min(1).optional(),
|
|
59554
60270
|
options: record(string(), DishwasherValueSchema).optional()
|
|
59555
60271
|
}), _void(), {
|
|
59556
60272
|
kind: "mutation",
|
|
59557
60273
|
auth: "protected"
|
|
59558
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60274
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59559
60275
|
kind: "mutation",
|
|
59560
60276
|
auth: "protected"
|
|
59561
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60277
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59562
60278
|
kind: "mutation",
|
|
59563
60279
|
auth: "protected"
|
|
59564
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
60280
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
59565
60281
|
kind: "mutation",
|
|
59566
60282
|
auth: "protected"
|
|
59567
60283
|
}), method(object({
|
|
59568
|
-
deviceId: DeviceIdSchema,
|
|
60284
|
+
deviceId: DeviceIdSchema$1,
|
|
59569
60285
|
program: string().min(1)
|
|
59570
60286
|
}), _void(), {
|
|
59571
60287
|
kind: "mutation",
|
|
59572
60288
|
auth: "protected"
|
|
59573
60289
|
}), method(object({
|
|
59574
|
-
deviceId: DeviceIdSchema,
|
|
60290
|
+
deviceId: DeviceIdSchema$1,
|
|
59575
60291
|
on: boolean()
|
|
59576
60292
|
}), _void(), {
|
|
59577
60293
|
kind: "mutation",
|
|
59578
60294
|
auth: "protected"
|
|
59579
60295
|
}), method(object({
|
|
59580
|
-
deviceId: DeviceIdSchema,
|
|
60296
|
+
deviceId: DeviceIdSchema$1,
|
|
59581
60297
|
on: boolean()
|
|
59582
60298
|
}), _void(), {
|
|
59583
60299
|
kind: "mutation",
|
|
59584
60300
|
auth: "protected"
|
|
59585
60301
|
}), method(object({
|
|
59586
|
-
deviceId: DeviceIdSchema,
|
|
60302
|
+
deviceId: DeviceIdSchema$1,
|
|
59587
60303
|
on: boolean()
|
|
59588
60304
|
}), _void(), {
|
|
59589
60305
|
kind: "mutation",
|
|
59590
60306
|
auth: "protected"
|
|
59591
60307
|
}), method(object({
|
|
59592
|
-
deviceId: DeviceIdSchema,
|
|
60308
|
+
deviceId: DeviceIdSchema$1,
|
|
59593
60309
|
on: boolean()
|
|
59594
60310
|
}), _void(), {
|
|
59595
60311
|
kind: "mutation",
|
|
59596
60312
|
auth: "protected"
|
|
59597
60313
|
}), method(object({
|
|
59598
|
-
deviceId: DeviceIdSchema,
|
|
60314
|
+
deviceId: DeviceIdSchema$1,
|
|
59599
60315
|
on: boolean()
|
|
59600
60316
|
}), _void(), {
|
|
59601
60317
|
kind: "mutation",
|
|
59602
60318
|
auth: "protected"
|
|
59603
60319
|
}), method(object({
|
|
59604
|
-
deviceId: DeviceIdSchema,
|
|
60320
|
+
deviceId: DeviceIdSchema$1,
|
|
59605
60321
|
on: boolean()
|
|
59606
60322
|
}), _void(), {
|
|
59607
60323
|
kind: "mutation",
|
|
59608
60324
|
auth: "protected"
|
|
59609
60325
|
}), method(object({
|
|
59610
|
-
deviceId: DeviceIdSchema,
|
|
60326
|
+
deviceId: DeviceIdSchema$1,
|
|
59611
60327
|
on: boolean()
|
|
59612
60328
|
}), _void(), {
|
|
59613
60329
|
kind: "mutation",
|
|
59614
60330
|
auth: "protected"
|
|
59615
60331
|
}), method(object({
|
|
59616
|
-
deviceId: DeviceIdSchema,
|
|
60332
|
+
deviceId: DeviceIdSchema$1,
|
|
59617
60333
|
key: string().min(1),
|
|
59618
60334
|
value: DishwasherValueSchema
|
|
59619
60335
|
}), _void(), {
|
|
59620
60336
|
kind: "mutation",
|
|
59621
60337
|
auth: "protected"
|
|
59622
|
-
}), method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" });
|
|
60338
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
|
|
59623
60339
|
DeviceType.Camera;
|
|
59624
60340
|
object({
|
|
59625
60341
|
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
@@ -61192,9 +61908,35 @@ var MediaInfoSchema = object({
|
|
|
61192
61908
|
/** Optional cover-art / thumbnail URL. */
|
|
61193
61909
|
imageUrl: string().optional()
|
|
61194
61910
|
});
|
|
61911
|
+
/**
|
|
61912
|
+
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
61913
|
+
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
61914
|
+
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
61915
|
+
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
61916
|
+
* guess, never as a reading.
|
|
61917
|
+
*/
|
|
61918
|
+
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
61919
|
+
/** The fields of a media-player status a driver can only guess. */
|
|
61920
|
+
var MediaPlayerAssumedFieldSchema = _enum([
|
|
61921
|
+
"state",
|
|
61922
|
+
"volumeLevel",
|
|
61923
|
+
"isMuted",
|
|
61924
|
+
"source"
|
|
61925
|
+
]);
|
|
61195
61926
|
object({
|
|
61196
61927
|
/** Playback lifecycle state. */
|
|
61197
61928
|
state: MediaPlayerStateSchema,
|
|
61929
|
+
/**
|
|
61930
|
+
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
61931
|
+
* A slice written before this field existed parses as `reported`.
|
|
61932
|
+
*/
|
|
61933
|
+
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
61934
|
+
/**
|
|
61935
|
+
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
61936
|
+
* this is not empty; a field not listed here is a reading even then (power
|
|
61937
|
+
* from a running-state source, mute guessed from the last send).
|
|
61938
|
+
*/
|
|
61939
|
+
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
61198
61940
|
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
61199
61941
|
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
61200
61942
|
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -62047,7 +62789,8 @@ var TopologyNodeSchema = object({
|
|
|
62047
62789
|
isHub: boolean(),
|
|
62048
62790
|
isOnline: boolean(),
|
|
62049
62791
|
cpuPercent: number(),
|
|
62050
|
-
|
|
62792
|
+
/** `null` when the node's memory read failed or it has not reported one (D393). */
|
|
62793
|
+
memoryPercent: number().nullable(),
|
|
62051
62794
|
uptime: number(),
|
|
62052
62795
|
lastSeen: string(),
|
|
62053
62796
|
localIps: array(string()).readonly(),
|
|
@@ -62582,9 +63325,10 @@ object({
|
|
|
62582
63325
|
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
62583
63326
|
* the device has not reported yet. */
|
|
62584
63327
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
62585
|
-
/** Food in the BOWL
|
|
62586
|
-
* feeder
|
|
62587
|
-
|
|
63328
|
+
/** Food in the BOWL, a mass (stored in kilograms, D944). Reported only by a
|
|
63329
|
+
* feeder with a bowl scale; null when the model has none or its reading is
|
|
63330
|
+
* of an unproven unit. */
|
|
63331
|
+
bowlFood: number().nullable().meta(readingMeta("mass")),
|
|
62588
63332
|
/** True while the pet is eating (`state.eating`). */
|
|
62589
63333
|
eating: boolean(),
|
|
62590
63334
|
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
@@ -62600,9 +63344,14 @@ object({
|
|
|
62600
63344
|
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
62601
63345
|
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
62602
63346
|
lowFood: boolean(),
|
|
62603
|
-
/** Battery charge 0..100 (%).
|
|
62604
|
-
*
|
|
63347
|
+
/** Battery charge 0..100 (%). On a feeder running on `mains` this is the
|
|
63348
|
+
* BACKUP battery's charge, not the power source. Null when the device has
|
|
63349
|
+
* no battery reading. */
|
|
62605
63350
|
batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
63351
|
+
/** What the feeder is powered from right now: `mains` (plugged in, the
|
|
63352
|
+
* battery is only a backup) or `battery`. Null when the device does not
|
|
63353
|
+
* report it. */
|
|
63354
|
+
powerSource: _enum(["mains", "battery"]).nullable(),
|
|
62606
63355
|
/**
|
|
62607
63356
|
* Desiccant life remaining, stored in seconds (duration base, D944).
|
|
62608
63357
|
* Providers convert from the days the feeder reports. Null when the
|
|
@@ -62630,6 +63379,14 @@ object({
|
|
|
62630
63379
|
feedSound: boolean(),
|
|
62631
63380
|
/** Speaker / prompt volume level (device-scaled integer). */
|
|
62632
63381
|
volume: number().meta(readingMeta("none")),
|
|
63382
|
+
/** Portion (grams) of the last manual feed sent from a single-hopper
|
|
63383
|
+
* stepper — the default the next manual feed starts from. Persisted per
|
|
63384
|
+
* device by the provider; null until a manual feed has been sent. */
|
|
63385
|
+
lastFeedGrams: gramsPortion.nullable(),
|
|
63386
|
+
/** Hopper-1 portion of the last manual feed (dual-hopper); null until sent. */
|
|
63387
|
+
lastFeedHopper1: gramsPortion.nullable(),
|
|
63388
|
+
/** Hopper-2 portion of the last manual feed (dual-hopper); null until sent. */
|
|
63389
|
+
lastFeedHopper2: gramsPortion.nullable(),
|
|
62633
63390
|
/** Ms epoch when the slice was last refreshed from the cloud. */
|
|
62634
63391
|
lastFetchedAt: number()
|
|
62635
63392
|
});
|
|
@@ -62684,6 +63441,64 @@ DeviceType.PetFeeder, method(object({
|
|
|
62684
63441
|
kind: "mutation",
|
|
62685
63442
|
auth: "protected"
|
|
62686
63443
|
});
|
|
63444
|
+
object({
|
|
63445
|
+
/** Water in the tank, 0..100 (%). Null while the source has not reported. */
|
|
63446
|
+
waterLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
63447
|
+
/** Water in the tank, in litres. Null while the source has not reported. */
|
|
63448
|
+
waterVolume: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63449
|
+
/** True when the tank is empty. Null while unknown. */
|
|
63450
|
+
empty: boolean().nullable(),
|
|
63451
|
+
/** True while the pump is running. Null while unknown. */
|
|
63452
|
+
pumpRunning: boolean().nullable(),
|
|
63453
|
+
/** True when the pump works on an on/off duty cycle rather than continuously. */
|
|
63454
|
+
pumpIntervalEnabled: boolean().nullable(),
|
|
63455
|
+
/** How long the pump runs per cycle, in seconds. */
|
|
63456
|
+
pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
63457
|
+
/** How long the pump rests per cycle, in seconds. */
|
|
63458
|
+
pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
63459
|
+
/** Water drunk in the last drink, in litres. */
|
|
63460
|
+
lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63461
|
+
/** Water drunk in the current hour, in litres. */
|
|
63462
|
+
currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63463
|
+
/** Water drunk over the last 24 hours (rolling), in litres. */
|
|
63464
|
+
last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63465
|
+
/** Water drunk since local midnight, in litres. */
|
|
63466
|
+
todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
63467
|
+
/** Decoded fault message. Null means healthy; a non-null string is an active fault. */
|
|
63468
|
+
error: string().nullable(),
|
|
63469
|
+
/** Ms epoch when the slice was last refreshed. */
|
|
63470
|
+
lastFetchedAt: number()
|
|
63471
|
+
});
|
|
63472
|
+
var DeviceIdSchema = number().int().nonnegative();
|
|
63473
|
+
var MinutesSchema = number().int().min(0);
|
|
63474
|
+
DeviceType.PetFountain, method(object({
|
|
63475
|
+
deviceId: DeviceIdSchema,
|
|
63476
|
+
on: boolean()
|
|
63477
|
+
}), _void(), {
|
|
63478
|
+
kind: "mutation",
|
|
63479
|
+
auth: "protected"
|
|
63480
|
+
}), method(object({
|
|
63481
|
+
deviceId: DeviceIdSchema,
|
|
63482
|
+
on: boolean()
|
|
63483
|
+
}), _void(), {
|
|
63484
|
+
kind: "mutation",
|
|
63485
|
+
auth: "protected"
|
|
63486
|
+
}), method(object({
|
|
63487
|
+
deviceId: DeviceIdSchema,
|
|
63488
|
+
minutes: MinutesSchema
|
|
63489
|
+
}), _void(), {
|
|
63490
|
+
kind: "mutation",
|
|
63491
|
+
auth: "protected"
|
|
63492
|
+
}), method(object({
|
|
63493
|
+
deviceId: DeviceIdSchema,
|
|
63494
|
+
minutes: MinutesSchema
|
|
63495
|
+
}), _void(), {
|
|
63496
|
+
kind: "mutation",
|
|
63497
|
+
auth: "protected"
|
|
63498
|
+
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
63499
|
+
kind: "mutation",
|
|
63500
|
+
auth: "protected"
|
|
63501
|
+
});
|
|
62687
63502
|
var VehicleSchema = object({
|
|
62688
63503
|
id: string(),
|
|
62689
63504
|
name: string(),
|
|
@@ -67292,9 +68107,17 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
67292
68107
|
kind: "mutation",
|
|
67293
68108
|
auth: "admin"
|
|
67294
68109
|
});
|
|
68110
|
+
discriminatedUnion("kind", [object({
|
|
68111
|
+
kind: literal("raw"),
|
|
68112
|
+
timings: array(number().int()),
|
|
68113
|
+
settings: TransmitSettingsSchema.optional()
|
|
68114
|
+
}), object({
|
|
68115
|
+
kind: literal("pronto"),
|
|
68116
|
+
code: string()
|
|
68117
|
+
})]);
|
|
67295
68118
|
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
67296
68119
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
67297
|
-
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;
|
|
68120
|
+
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;
|
|
67298
68121
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
67299
68122
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
67300
68123
|
new Set(CAP_NAMES);
|
|
@@ -67347,7 +68170,7 @@ var AccessoryKind = {
|
|
|
67347
68170
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
67348
68171
|
};
|
|
67349
68172
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
67350
|
-
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;
|
|
68173
|
+
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;
|
|
67351
68174
|
new Set(Object.values(DeviceType));
|
|
67352
68175
|
Object.freeze({
|
|
67353
68176
|
"accessories.getStatus": {
|
|
@@ -69282,6 +70105,13 @@ Object.freeze({
|
|
|
69282
70105
|
access: "create",
|
|
69283
70106
|
role: "admin"
|
|
69284
70107
|
},
|
|
70108
|
+
"deviceExport.exposeEntity": {
|
|
70109
|
+
capName: "device-export",
|
|
70110
|
+
capScope: "system",
|
|
70111
|
+
addonId: null,
|
|
70112
|
+
access: "create",
|
|
70113
|
+
role: "admin"
|
|
70114
|
+
},
|
|
69285
70115
|
"deviceExport.getDeviceLiveContribution": {
|
|
69286
70116
|
capName: "device-export",
|
|
69287
70117
|
capScope: "system",
|
|
@@ -69310,6 +70140,13 @@ Object.freeze({
|
|
|
69310
70140
|
access: "view",
|
|
69311
70141
|
role: "admin"
|
|
69312
70142
|
},
|
|
70143
|
+
"deviceExport.listExposedEntities": {
|
|
70144
|
+
capName: "device-export",
|
|
70145
|
+
capScope: "system",
|
|
70146
|
+
addonId: null,
|
|
70147
|
+
access: "view",
|
|
70148
|
+
role: "admin"
|
|
70149
|
+
},
|
|
69313
70150
|
"deviceExport.listSupportedDeviceKinds": {
|
|
69314
70151
|
capName: "device-export",
|
|
69315
70152
|
capScope: "system",
|
|
@@ -69317,6 +70154,13 @@ Object.freeze({
|
|
|
69317
70154
|
access: "view",
|
|
69318
70155
|
role: "admin"
|
|
69319
70156
|
},
|
|
70157
|
+
"deviceExport.listSupportedEntityKinds": {
|
|
70158
|
+
capName: "device-export",
|
|
70159
|
+
capScope: "system",
|
|
70160
|
+
addonId: null,
|
|
70161
|
+
access: "view",
|
|
70162
|
+
role: "admin"
|
|
70163
|
+
},
|
|
69320
70164
|
"deviceExport.unexposeDevice": {
|
|
69321
70165
|
capName: "device-export",
|
|
69322
70166
|
capScope: "system",
|
|
@@ -69324,6 +70168,13 @@ Object.freeze({
|
|
|
69324
70168
|
access: "create",
|
|
69325
70169
|
role: "admin"
|
|
69326
70170
|
},
|
|
70171
|
+
"deviceExport.unexposeEntity": {
|
|
70172
|
+
capName: "device-export",
|
|
70173
|
+
capScope: "system",
|
|
70174
|
+
addonId: null,
|
|
70175
|
+
access: "create",
|
|
70176
|
+
role: "admin"
|
|
70177
|
+
},
|
|
69327
70178
|
"deviceExtension.listCandidates": {
|
|
69328
70179
|
capName: "device-extension",
|
|
69329
70180
|
capScope: "device",
|
|
@@ -70899,6 +71750,20 @@ Object.freeze({
|
|
|
70899
71750
|
access: "create",
|
|
70900
71751
|
role: "viewer"
|
|
70901
71752
|
},
|
|
71753
|
+
"irTransmitter.getInfo": {
|
|
71754
|
+
capName: "ir-transmitter",
|
|
71755
|
+
capScope: "device",
|
|
71756
|
+
addonId: null,
|
|
71757
|
+
access: "view",
|
|
71758
|
+
role: "viewer"
|
|
71759
|
+
},
|
|
71760
|
+
"irTransmitter.send": {
|
|
71761
|
+
capName: "ir-transmitter",
|
|
71762
|
+
capScope: "device",
|
|
71763
|
+
addonId: null,
|
|
71764
|
+
access: "create",
|
|
71765
|
+
role: "viewer"
|
|
71766
|
+
},
|
|
70902
71767
|
"keychain.delete": {
|
|
70903
71768
|
capName: "keychain",
|
|
70904
71769
|
capScope: "system",
|
|
@@ -72131,6 +72996,13 @@ Object.freeze({
|
|
|
72131
72996
|
access: "create",
|
|
72132
72997
|
role: "admin"
|
|
72133
72998
|
},
|
|
72999
|
+
"nodeRemovalHook.onNodeRemoved": {
|
|
73000
|
+
capName: "node-removal-hook",
|
|
73001
|
+
capScope: "system",
|
|
73002
|
+
addonId: null,
|
|
73003
|
+
access: "create",
|
|
73004
|
+
role: "admin"
|
|
73005
|
+
},
|
|
72134
73006
|
"nodes.clusterAddonStatus": {
|
|
72135
73007
|
capName: "nodes",
|
|
72136
73008
|
capScope: "system",
|
|
@@ -72768,6 +73640,48 @@ Object.freeze({
|
|
|
72768
73640
|
access: "create",
|
|
72769
73641
|
role: "viewer"
|
|
72770
73642
|
},
|
|
73643
|
+
"petFountain.getStatus": {
|
|
73644
|
+
capName: "pet-fountain",
|
|
73645
|
+
capScope: "device",
|
|
73646
|
+
addonId: null,
|
|
73647
|
+
access: "view",
|
|
73648
|
+
role: "viewer"
|
|
73649
|
+
},
|
|
73650
|
+
"petFountain.resetDailyConsumption": {
|
|
73651
|
+
capName: "pet-fountain",
|
|
73652
|
+
capScope: "device",
|
|
73653
|
+
addonId: null,
|
|
73654
|
+
access: "delete",
|
|
73655
|
+
role: "viewer"
|
|
73656
|
+
},
|
|
73657
|
+
"petFountain.setPump": {
|
|
73658
|
+
capName: "pet-fountain",
|
|
73659
|
+
capScope: "device",
|
|
73660
|
+
addonId: null,
|
|
73661
|
+
access: "create",
|
|
73662
|
+
role: "viewer"
|
|
73663
|
+
},
|
|
73664
|
+
"petFountain.setPumpInterval": {
|
|
73665
|
+
capName: "pet-fountain",
|
|
73666
|
+
capScope: "device",
|
|
73667
|
+
addonId: null,
|
|
73668
|
+
access: "create",
|
|
73669
|
+
role: "viewer"
|
|
73670
|
+
},
|
|
73671
|
+
"petFountain.setPumpOffMinutes": {
|
|
73672
|
+
capName: "pet-fountain",
|
|
73673
|
+
capScope: "device",
|
|
73674
|
+
addonId: null,
|
|
73675
|
+
access: "create",
|
|
73676
|
+
role: "viewer"
|
|
73677
|
+
},
|
|
73678
|
+
"petFountain.setPumpOnMinutes": {
|
|
73679
|
+
capName: "pet-fountain",
|
|
73680
|
+
capScope: "device",
|
|
73681
|
+
addonId: null,
|
|
73682
|
+
access: "create",
|
|
73683
|
+
role: "viewer"
|
|
73684
|
+
},
|
|
72771
73685
|
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
72772
73686
|
capName: "pipeline-analytics",
|
|
72773
73687
|
capScope: "device",
|
|
@@ -75022,6 +75936,41 @@ Object.freeze({
|
|
|
75022
75936
|
access: "create",
|
|
75023
75937
|
role: "admin"
|
|
75024
75938
|
},
|
|
75939
|
+
"remote.getConfig": {
|
|
75940
|
+
capName: "remote",
|
|
75941
|
+
capScope: "system",
|
|
75942
|
+
addonId: null,
|
|
75943
|
+
access: "view",
|
|
75944
|
+
role: "admin"
|
|
75945
|
+
},
|
|
75946
|
+
"remote.listCommands": {
|
|
75947
|
+
capName: "remote",
|
|
75948
|
+
capScope: "system",
|
|
75949
|
+
addonId: null,
|
|
75950
|
+
access: "view",
|
|
75951
|
+
role: "admin"
|
|
75952
|
+
},
|
|
75953
|
+
"remote.sendCommand": {
|
|
75954
|
+
capName: "remote",
|
|
75955
|
+
capScope: "system",
|
|
75956
|
+
addonId: null,
|
|
75957
|
+
access: "create",
|
|
75958
|
+
role: "admin"
|
|
75959
|
+
},
|
|
75960
|
+
"remote.sendMediaCommand": {
|
|
75961
|
+
capName: "remote",
|
|
75962
|
+
capScope: "system",
|
|
75963
|
+
addonId: null,
|
|
75964
|
+
access: "create",
|
|
75965
|
+
role: "admin"
|
|
75966
|
+
},
|
|
75967
|
+
"remote.setConfig": {
|
|
75968
|
+
capName: "remote",
|
|
75969
|
+
capScope: "system",
|
|
75970
|
+
addonId: null,
|
|
75971
|
+
access: "create",
|
|
75972
|
+
role: "admin"
|
|
75973
|
+
},
|
|
75025
75974
|
"runningState.getStatus": {
|
|
75026
75975
|
capName: "running-state",
|
|
75027
75976
|
capScope: "device",
|
|
@@ -76212,6 +77161,41 @@ Object.freeze({
|
|
|
76212
77161
|
access: "view",
|
|
76213
77162
|
role: "viewer"
|
|
76214
77163
|
},
|
|
77164
|
+
"template.create": {
|
|
77165
|
+
capName: "template",
|
|
77166
|
+
capScope: "system",
|
|
77167
|
+
addonId: null,
|
|
77168
|
+
access: "create",
|
|
77169
|
+
role: "admin"
|
|
77170
|
+
},
|
|
77171
|
+
"template.delete": {
|
|
77172
|
+
capName: "template",
|
|
77173
|
+
capScope: "system",
|
|
77174
|
+
addonId: null,
|
|
77175
|
+
access: "delete",
|
|
77176
|
+
role: "admin"
|
|
77177
|
+
},
|
|
77178
|
+
"template.get": {
|
|
77179
|
+
capName: "template",
|
|
77180
|
+
capScope: "system",
|
|
77181
|
+
addonId: null,
|
|
77182
|
+
access: "view",
|
|
77183
|
+
role: "admin"
|
|
77184
|
+
},
|
|
77185
|
+
"template.list": {
|
|
77186
|
+
capName: "template",
|
|
77187
|
+
capScope: "system",
|
|
77188
|
+
addonId: null,
|
|
77189
|
+
access: "view",
|
|
77190
|
+
role: "admin"
|
|
77191
|
+
},
|
|
77192
|
+
"template.update": {
|
|
77193
|
+
capName: "template",
|
|
77194
|
+
capScope: "system",
|
|
77195
|
+
addonId: null,
|
|
77196
|
+
access: "create",
|
|
77197
|
+
role: "admin"
|
|
77198
|
+
},
|
|
76215
77199
|
"terminalSession.adoptLegacyMonitor": {
|
|
76216
77200
|
capName: "terminal-session",
|
|
76217
77201
|
capScope: "system",
|
|
@@ -78522,6 +79506,11 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
78522
79506
|
icon: "circle-dot"
|
|
78523
79507
|
}]
|
|
78524
79508
|
},
|
|
79509
|
+
"ir-transmitter": {
|
|
79510
|
+
scope: "device",
|
|
79511
|
+
noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
|
|
79512
|
+
notOperatorFacing: { send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it" }
|
|
79513
|
+
},
|
|
78525
79514
|
control: {
|
|
78526
79515
|
scope: "device",
|
|
78527
79516
|
noun: t("Control", "Controllo"),
|
|
@@ -79175,6 +80164,100 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
79175
80164
|
}
|
|
79176
80165
|
]
|
|
79177
80166
|
},
|
|
80167
|
+
"pet-fountain": {
|
|
80168
|
+
scope: "device",
|
|
80169
|
+
noun: t("Pet fountain", "Fontana per animali"),
|
|
80170
|
+
actions: [
|
|
80171
|
+
{
|
|
80172
|
+
id: "petFountain.pumpOn",
|
|
80173
|
+
method: "setPump",
|
|
80174
|
+
label: t("Pump on", "Pompa accesa"),
|
|
80175
|
+
phrase: t("Start the pump of {device}", "Avvia la pompa di {device}"),
|
|
80176
|
+
icon: "play",
|
|
80177
|
+
args: { on: true }
|
|
80178
|
+
},
|
|
80179
|
+
{
|
|
80180
|
+
id: "petFountain.pumpOff",
|
|
80181
|
+
method: "setPump",
|
|
80182
|
+
label: t("Pump off", "Pompa spenta"),
|
|
80183
|
+
phrase: t("Stop the pump of {device}", "Ferma la pompa di {device}"),
|
|
80184
|
+
icon: "square",
|
|
80185
|
+
args: { on: false }
|
|
80186
|
+
},
|
|
80187
|
+
{
|
|
80188
|
+
id: "petFountain.intervalOn",
|
|
80189
|
+
method: "setPumpInterval",
|
|
80190
|
+
label: t("Pump cycle on", "Ciclo pompa attivo"),
|
|
80191
|
+
phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
|
|
80192
|
+
icon: "timer",
|
|
80193
|
+
args: { on: true }
|
|
80194
|
+
},
|
|
80195
|
+
{
|
|
80196
|
+
id: "petFountain.intervalOff",
|
|
80197
|
+
method: "setPumpInterval",
|
|
80198
|
+
label: t("Pump cycle off", "Ciclo pompa spento"),
|
|
80199
|
+
phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
|
|
80200
|
+
icon: "timer-off",
|
|
80201
|
+
args: { on: false }
|
|
80202
|
+
},
|
|
80203
|
+
{
|
|
80204
|
+
id: "petFountain.pumpOnMinutes",
|
|
80205
|
+
method: "setPumpOnMinutes",
|
|
80206
|
+
label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
|
|
80207
|
+
phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
|
|
80208
|
+
icon: "timer",
|
|
80209
|
+
openArgs: [{
|
|
80210
|
+
key: "minutes",
|
|
80211
|
+
label: t("Minutes", "Minuti"),
|
|
80212
|
+
offer: {
|
|
80213
|
+
kind: "number",
|
|
80214
|
+
min: 0,
|
|
80215
|
+
step: 1,
|
|
80216
|
+
unit: "min"
|
|
80217
|
+
}
|
|
80218
|
+
}]
|
|
80219
|
+
},
|
|
80220
|
+
{
|
|
80221
|
+
id: "petFountain.pumpOffMinutes",
|
|
80222
|
+
method: "setPumpOffMinutes",
|
|
80223
|
+
label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
|
|
80224
|
+
phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
|
|
80225
|
+
icon: "timer-off",
|
|
80226
|
+
openArgs: [{
|
|
80227
|
+
key: "minutes",
|
|
80228
|
+
label: t("Minutes", "Minuti"),
|
|
80229
|
+
offer: {
|
|
80230
|
+
kind: "number",
|
|
80231
|
+
min: 0,
|
|
80232
|
+
step: 1,
|
|
80233
|
+
unit: "min"
|
|
80234
|
+
}
|
|
80235
|
+
}]
|
|
80236
|
+
},
|
|
80237
|
+
{
|
|
80238
|
+
id: "petFountain.resetDailyConsumption",
|
|
80239
|
+
method: "resetDailyConsumption",
|
|
80240
|
+
label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
|
|
80241
|
+
phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
|
|
80242
|
+
icon: "rotate-ccw"
|
|
80243
|
+
}
|
|
80244
|
+
],
|
|
80245
|
+
state: [{
|
|
80246
|
+
kind: "boolean",
|
|
80247
|
+
field: "empty",
|
|
80248
|
+
label: t("Tank empty", "Serbatoio vuoto"),
|
|
80249
|
+
whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
|
|
80250
|
+
whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
|
|
80251
|
+
icon: "droplet"
|
|
80252
|
+
}, {
|
|
80253
|
+
kind: "numeric",
|
|
80254
|
+
field: "waterLevel",
|
|
80255
|
+
quantity: t("the water level", "il livello dell’acqua"),
|
|
80256
|
+
label: t("Water level", "Livello dell’acqua"),
|
|
80257
|
+
unit: "%",
|
|
80258
|
+
icon: "droplets"
|
|
80259
|
+
}]
|
|
80260
|
+
},
|
|
79178
80261
|
"media-player": {
|
|
79179
80262
|
scope: "device",
|
|
79180
80263
|
noun: t("Media player", "Lettore multimediale"),
|
|
@@ -80999,6 +82082,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
80999
82082
|
"device-manager": system("the device registry itself — rename, move and remove are administration"),
|
|
81000
82083
|
"device-provider": system(INTERNAL),
|
|
81001
82084
|
"device-removal-hook": system(INTERNAL),
|
|
82085
|
+
"node-removal-hook": system(INTERNAL),
|
|
81002
82086
|
"device-state": system("the runtime-state mirror every trigger already reads through"),
|
|
81003
82087
|
"display-palette": system("the cluster display palette — one colour table for every client, not a device action"),
|
|
81004
82088
|
"embedding-encoder": system(ML),
|
|
@@ -81038,6 +82122,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
81038
82122
|
"recording-archive": system(STORAGE),
|
|
81039
82123
|
"recording-export": system("recording exports — requested from the timeline, not an automation step"),
|
|
81040
82124
|
records: system(INTERNAL),
|
|
82125
|
+
remote: system("the per-device remote setup — authored in the Customize remote editor, sent through the remote UI"),
|
|
81041
82126
|
"server-management": system(CLUSTER),
|
|
81042
82127
|
"settings-store": system(INTERNAL),
|
|
81043
82128
|
"smtp-provider": system(INTERNAL),
|
|
@@ -81050,6 +82135,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
81050
82135
|
"storage-provider": system(STORAGE),
|
|
81051
82136
|
"stream-broker": system(PIPELINE),
|
|
81052
82137
|
system: system(CLUSTER),
|
|
82138
|
+
template: system("operator-authored templates — edited in their own editor, never actuated"),
|
|
81053
82139
|
"terminal-session": system(CLUSTER),
|
|
81054
82140
|
toast: system(UI_PLUMBING),
|
|
81055
82141
|
training: system(ML),
|
|
@@ -81109,7 +82195,7 @@ function projectAction(cap, action) {
|
|
|
81109
82195
|
};
|
|
81110
82196
|
}
|
|
81111
82197
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
81112
|
-
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;
|
|
82198
|
+
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;
|
|
81113
82199
|
DeviceFeature.BatteryOperated;
|
|
81114
82200
|
/**
|
|
81115
82201
|
* How a washer, dryer or dishwasher leaves CamStack.
|
|
@@ -82266,6 +83352,16 @@ Object.freeze({
|
|
|
82266
83352
|
form: "single",
|
|
82267
83353
|
optional: false
|
|
82268
83354
|
}],
|
|
83355
|
+
"irTransmitter.getInfo": [{
|
|
83356
|
+
name: "deviceId",
|
|
83357
|
+
form: "single",
|
|
83358
|
+
optional: false
|
|
83359
|
+
}],
|
|
83360
|
+
"irTransmitter.send": [{
|
|
83361
|
+
name: "deviceId",
|
|
83362
|
+
form: "single",
|
|
83363
|
+
optional: false
|
|
83364
|
+
}],
|
|
82269
83365
|
"keychain.deleteDeviceScope": [{
|
|
82270
83366
|
name: "deviceId",
|
|
82271
83367
|
form: "single",
|
|
@@ -82675,6 +83771,36 @@ Object.freeze({
|
|
|
82675
83771
|
form: "single",
|
|
82676
83772
|
optional: false
|
|
82677
83773
|
}],
|
|
83774
|
+
"petFountain.getStatus": [{
|
|
83775
|
+
name: "deviceId",
|
|
83776
|
+
form: "single",
|
|
83777
|
+
optional: false
|
|
83778
|
+
}],
|
|
83779
|
+
"petFountain.resetDailyConsumption": [{
|
|
83780
|
+
name: "deviceId",
|
|
83781
|
+
form: "single",
|
|
83782
|
+
optional: false
|
|
83783
|
+
}],
|
|
83784
|
+
"petFountain.setPump": [{
|
|
83785
|
+
name: "deviceId",
|
|
83786
|
+
form: "single",
|
|
83787
|
+
optional: false
|
|
83788
|
+
}],
|
|
83789
|
+
"petFountain.setPumpInterval": [{
|
|
83790
|
+
name: "deviceId",
|
|
83791
|
+
form: "single",
|
|
83792
|
+
optional: false
|
|
83793
|
+
}],
|
|
83794
|
+
"petFountain.setPumpOffMinutes": [{
|
|
83795
|
+
name: "deviceId",
|
|
83796
|
+
form: "single",
|
|
83797
|
+
optional: false
|
|
83798
|
+
}],
|
|
83799
|
+
"petFountain.setPumpOnMinutes": [{
|
|
83800
|
+
name: "deviceId",
|
|
83801
|
+
form: "single",
|
|
83802
|
+
optional: false
|
|
83803
|
+
}],
|
|
82678
83804
|
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
82679
83805
|
name: "deviceId",
|
|
82680
83806
|
form: "single",
|
|
@@ -83491,6 +84617,31 @@ Object.freeze({
|
|
|
83491
84617
|
form: "single",
|
|
83492
84618
|
optional: true
|
|
83493
84619
|
}],
|
|
84620
|
+
"remote.getConfig": [{
|
|
84621
|
+
name: "deviceId",
|
|
84622
|
+
form: "single",
|
|
84623
|
+
optional: false
|
|
84624
|
+
}],
|
|
84625
|
+
"remote.listCommands": [{
|
|
84626
|
+
name: "deviceId",
|
|
84627
|
+
form: "single",
|
|
84628
|
+
optional: false
|
|
84629
|
+
}],
|
|
84630
|
+
"remote.sendCommand": [{
|
|
84631
|
+
name: "deviceId",
|
|
84632
|
+
form: "single",
|
|
84633
|
+
optional: false
|
|
84634
|
+
}],
|
|
84635
|
+
"remote.sendMediaCommand": [{
|
|
84636
|
+
name: "deviceId",
|
|
84637
|
+
form: "single",
|
|
84638
|
+
optional: false
|
|
84639
|
+
}],
|
|
84640
|
+
"remote.setConfig": [{
|
|
84641
|
+
name: "deviceId",
|
|
84642
|
+
form: "single",
|
|
84643
|
+
optional: false
|
|
84644
|
+
}],
|
|
83494
84645
|
"runningState.getStatus": [{
|
|
83495
84646
|
name: "deviceId",
|
|
83496
84647
|
form: "single",
|
|
@@ -85299,6 +86450,14 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
|
85299
86450
|
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
85300
86451
|
var MB = 1024 * 1024;
|
|
85301
86452
|
1024 * MB, 3072 * MB;
|
|
86453
|
+
object({
|
|
86454
|
+
manufacturer: string().optional(),
|
|
86455
|
+
supportedModels: array(string()).optional(),
|
|
86456
|
+
supportedController: string().optional(),
|
|
86457
|
+
commandsEncoding: string(),
|
|
86458
|
+
delay: number().nonnegative().optional(),
|
|
86459
|
+
commands: record(string(), unknown())
|
|
86460
|
+
});
|
|
85302
86461
|
process.platform, process.env["SystemRoot"];
|
|
85303
86462
|
var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
|
|
85304
86463
|
/** Heartbeat cadence — ~2 minutes of 4 s fragments. */
|
|
@@ -85330,7 +86489,7 @@ var Fmp4FragmentChild = class {
|
|
|
85330
86489
|
meta: {
|
|
85331
86490
|
sourceId: this.args.sourceId,
|
|
85332
86491
|
decodeHwAccel: requested,
|
|
85333
|
-
error: errMsg$
|
|
86492
|
+
error: errMsg$17(err)
|
|
85334
86493
|
}
|
|
85335
86494
|
});
|
|
85336
86495
|
this.killChild();
|
|
@@ -85509,7 +86668,7 @@ var Fmp4FragmentChild = class {
|
|
|
85509
86668
|
tags: { deviceId: this.args.deviceId },
|
|
85510
86669
|
meta: {
|
|
85511
86670
|
sourceId: this.args.sourceId,
|
|
85512
|
-
error: errMsg$
|
|
86671
|
+
error: errMsg$17(err)
|
|
85513
86672
|
}
|
|
85514
86673
|
});
|
|
85515
86674
|
}
|
|
@@ -132198,6 +133357,176 @@ function clearPairingFiles(accessoryUuid, logger) {
|
|
|
132198
133357
|
} });
|
|
132199
133358
|
}
|
|
132200
133359
|
}
|
|
133360
|
+
/** Deterministic and distinct from every device accessory uuid. */
|
|
133361
|
+
function actionSwitchUuid(actionId) {
|
|
133362
|
+
return import_dist.uuid.generate(`camstack:hap:action:${actionId}`);
|
|
133363
|
+
}
|
|
133364
|
+
function buildActionSwitch(input) {
|
|
133365
|
+
const { actionId, displayName, run } = input;
|
|
133366
|
+
const autoOffMs = input.autoOffMs ?? 1e3;
|
|
133367
|
+
const accessory = new import_dist.Accessory(displayName, actionSwitchUuid(actionId));
|
|
133368
|
+
accessory.category = import_dist.Categories.SWITCH;
|
|
133369
|
+
const info = accessory.getService(import_dist.Service.AccessoryInformation);
|
|
133370
|
+
info?.setCharacteristic(import_dist.Characteristic.Manufacturer, "CamStack");
|
|
133371
|
+
info?.setCharacteristic(import_dist.Characteristic.Model, "Action");
|
|
133372
|
+
info?.setCharacteristic(import_dist.Characteristic.SerialNumber, `camstack-action-${actionId}`);
|
|
133373
|
+
const service = accessory.addService(import_dist.Service.Switch, displayName);
|
|
133374
|
+
const on = service.getCharacteristic(import_dist.Characteristic.On);
|
|
133375
|
+
let timer = null;
|
|
133376
|
+
const clearTimer = () => {
|
|
133377
|
+
if (timer !== null) clearTimeout(timer);
|
|
133378
|
+
timer = null;
|
|
133379
|
+
};
|
|
133380
|
+
on.onSet(async (value) => {
|
|
133381
|
+
if (value !== true) {
|
|
133382
|
+
clearTimer();
|
|
133383
|
+
return;
|
|
133384
|
+
}
|
|
133385
|
+
if (timer !== null) return;
|
|
133386
|
+
timer = setTimeout(() => {
|
|
133387
|
+
timer = null;
|
|
133388
|
+
service.updateCharacteristic(import_dist.Characteristic.On, false);
|
|
133389
|
+
}, autoOffMs);
|
|
133390
|
+
try {
|
|
133391
|
+
await run();
|
|
133392
|
+
} catch {}
|
|
133393
|
+
});
|
|
133394
|
+
on.onGet(() => false);
|
|
133395
|
+
return {
|
|
133396
|
+
accessory,
|
|
133397
|
+
accessories: [accessory],
|
|
133398
|
+
async dispose() {
|
|
133399
|
+
clearTimer();
|
|
133400
|
+
}
|
|
133401
|
+
};
|
|
133402
|
+
}
|
|
133403
|
+
//#endregion
|
|
133404
|
+
//#region src/action-exports.ts
|
|
133405
|
+
/**
|
|
133406
|
+
* The actions this bridge exposes (D968): the persisted selection and the
|
|
133407
|
+
* switch each entry is published as.
|
|
133408
|
+
*
|
|
133409
|
+
* Kept apart from the addon class so the lifecycle can be proved without a
|
|
133410
|
+
* HAP server: the addon supplies `publish` / `unpublish` (bridge first,
|
|
133411
|
+
* standalone as the fallback, exactly as for a device) and `persist` (its own
|
|
133412
|
+
* settings), and this class owns the rest — the lookup of the action's name,
|
|
133413
|
+
* the press that runs it, the refusal that is logged, the pruning of an action
|
|
133414
|
+
* the operator deleted.
|
|
133415
|
+
*
|
|
133416
|
+
* Actions are list entries, not devices (D954): nothing here touches the
|
|
133417
|
+
* device registry, and the log tag is `actionId`.
|
|
133418
|
+
*/
|
|
133419
|
+
var EXPORTER = "export-hap";
|
|
133420
|
+
function errMsg$16(err) {
|
|
133421
|
+
return err instanceof Error ? err.message : String(err);
|
|
133422
|
+
}
|
|
133423
|
+
var ActionExports = class {
|
|
133424
|
+
ports;
|
|
133425
|
+
entries;
|
|
133426
|
+
mappers = /* @__PURE__ */ new Map();
|
|
133427
|
+
constructor(ports, initial) {
|
|
133428
|
+
this.ports = ports;
|
|
133429
|
+
this.entries = initial;
|
|
133430
|
+
}
|
|
133431
|
+
/** The cap's `listExposedEntities` rows for actions. */
|
|
133432
|
+
list() {
|
|
133433
|
+
return this.entries.map((e) => ({
|
|
133434
|
+
entity: {
|
|
133435
|
+
kind: "action",
|
|
133436
|
+
actionId: e.actionId
|
|
133437
|
+
},
|
|
133438
|
+
exposedAs: e.displayName
|
|
133439
|
+
}));
|
|
133440
|
+
}
|
|
133441
|
+
/** Re-publish the persisted selection (boot). One failure does not stop the rest. */
|
|
133442
|
+
async attachAll() {
|
|
133443
|
+
for (const entry of this.entries) try {
|
|
133444
|
+
await this.attach(entry);
|
|
133445
|
+
} catch (err) {
|
|
133446
|
+
this.ports.logger.warn("export-hap: failed to re-attach exported action on boot", {
|
|
133447
|
+
tags: { actionId: entry.actionId },
|
|
133448
|
+
meta: { error: errMsg$16(err) }
|
|
133449
|
+
});
|
|
133450
|
+
}
|
|
133451
|
+
}
|
|
133452
|
+
async expose(actionId) {
|
|
133453
|
+
const action = (await this.ports.api.actions.list.query({})).find((a) => a.id === actionId);
|
|
133454
|
+
if (action === void 0) throw new Error(`export-hap: action '${actionId}' does not exist`);
|
|
133455
|
+
const previous = this.entries.find((e) => e.actionId === actionId);
|
|
133456
|
+
const entry = {
|
|
133457
|
+
actionId,
|
|
133458
|
+
displayName: action.name,
|
|
133459
|
+
addedAt: previous?.addedAt ?? Date.now()
|
|
133460
|
+
};
|
|
133461
|
+
await this.detach(actionId);
|
|
133462
|
+
await this.attach(entry);
|
|
133463
|
+
await this.save([...this.entries.filter((e) => e.actionId !== actionId), entry]);
|
|
133464
|
+
this.ports.logger.info("export-hap: exposed action", {
|
|
133465
|
+
tags: { actionId },
|
|
133466
|
+
meta: { displayName: action.name }
|
|
133467
|
+
});
|
|
133468
|
+
}
|
|
133469
|
+
async unexpose(actionId) {
|
|
133470
|
+
await this.detach(actionId);
|
|
133471
|
+
if (this.entries.some((e) => e.actionId === actionId)) await this.save(this.entries.filter((e) => e.actionId !== actionId));
|
|
133472
|
+
this.ports.logger.info("export-hap: unexposed action", { tags: { actionId } });
|
|
133473
|
+
}
|
|
133474
|
+
/**
|
|
133475
|
+
* Drop what the operator deleted. An action list that could not be read
|
|
133476
|
+
* changes nothing (D49): a failed read must never destroy the selection.
|
|
133477
|
+
*/
|
|
133478
|
+
async reconcile() {
|
|
133479
|
+
if (this.entries.length === 0) return;
|
|
133480
|
+
let live;
|
|
133481
|
+
try {
|
|
133482
|
+
const actions = await this.ports.api.actions.list.query({});
|
|
133483
|
+
live = new Set(actions.map((a) => a.id));
|
|
133484
|
+
} catch (err) {
|
|
133485
|
+
this.ports.logger.warn("export-hap: exported actions not reconciled — list unanswered", { meta: { error: errMsg$16(err) } });
|
|
133486
|
+
return;
|
|
133487
|
+
}
|
|
133488
|
+
const { dropped } = pruneDeletedEntities(this.entries.map((e) => ({
|
|
133489
|
+
kind: "action",
|
|
133490
|
+
actionId: e.actionId
|
|
133491
|
+
})), {
|
|
133492
|
+
actionIds: live,
|
|
133493
|
+
targetIds: /* @__PURE__ */ new Set()
|
|
133494
|
+
}, this.ports.logger, EXPORTER);
|
|
133495
|
+
if (dropped.length === 0) return;
|
|
133496
|
+
for (const ref of dropped) if (ref.kind === "action") await this.detach(ref.actionId);
|
|
133497
|
+
const gone = new Set(dropped.flatMap((r) => r.kind === "action" ? [r.actionId] : []));
|
|
133498
|
+
await this.save(this.entries.filter((e) => !gone.has(e.actionId)));
|
|
133499
|
+
}
|
|
133500
|
+
async dispose() {
|
|
133501
|
+
for (const mapper of this.mappers.values()) await mapper.dispose();
|
|
133502
|
+
this.mappers.clear();
|
|
133503
|
+
}
|
|
133504
|
+
async attach(entry) {
|
|
133505
|
+
const mapper = buildActionSwitch({
|
|
133506
|
+
actionId: entry.actionId,
|
|
133507
|
+
displayName: entry.displayName,
|
|
133508
|
+
run: async () => {
|
|
133509
|
+
await runExportedAction(this.ports.api, this.ports.logger, {
|
|
133510
|
+
exporter: EXPORTER,
|
|
133511
|
+
actionId: entry.actionId
|
|
133512
|
+
});
|
|
133513
|
+
}
|
|
133514
|
+
});
|
|
133515
|
+
for (const accessory of mapper.accessories) await this.ports.publish(accessory);
|
|
133516
|
+
this.mappers.set(entry.actionId, mapper);
|
|
133517
|
+
}
|
|
133518
|
+
async detach(actionId) {
|
|
133519
|
+
const mapper = this.mappers.get(actionId);
|
|
133520
|
+
if (mapper === void 0) return;
|
|
133521
|
+
this.mappers.delete(actionId);
|
|
133522
|
+
for (const accessory of mapper.accessories) await this.ports.unpublish(accessory);
|
|
133523
|
+
await mapper.dispose();
|
|
133524
|
+
}
|
|
133525
|
+
async save(next) {
|
|
133526
|
+
this.entries = next;
|
|
133527
|
+
await this.ports.persist(next);
|
|
133528
|
+
}
|
|
133529
|
+
};
|
|
132201
133530
|
/**
|
|
132202
133531
|
* Whether this device's accessory belongs on the bridge.
|
|
132203
133532
|
*
|
|
@@ -151698,6 +153027,7 @@ var DEFAULT_CONFIG = {
|
|
|
151698
153027
|
uuid: ""
|
|
151699
153028
|
},
|
|
151700
153029
|
exposed: [],
|
|
153030
|
+
exposedActions: [],
|
|
151701
153031
|
exportSyncState: {}
|
|
151702
153032
|
};
|
|
151703
153033
|
var BANNED_PINCODES = new Set([
|
|
@@ -151739,6 +153069,8 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151739
153069
|
/** The bridge setup code pairs a controller: a credential, kept in the keychain (D787). */
|
|
151740
153070
|
secretStatePaths = ["identity.pincode"];
|
|
151741
153071
|
exposed = /* @__PURE__ */ new Map();
|
|
153072
|
+
/** The exported actions — switches beside the devices (D968). */
|
|
153073
|
+
actionExports = null;
|
|
151742
153074
|
lastError;
|
|
151743
153075
|
/** Shared HAP setup code applied to every published accessory. */
|
|
151744
153076
|
pincode = "";
|
|
@@ -151851,7 +153183,31 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151851
153183
|
log.warn("export-hap: failed to re-attach mapper on boot", { meta: { error: errMsg(err) } });
|
|
151852
153184
|
}
|
|
151853
153185
|
}
|
|
153186
|
+
this.actionExports = new ActionExports({
|
|
153187
|
+
api: this.ctx.api,
|
|
153188
|
+
logger: this.ctx.logger,
|
|
153189
|
+
publish: async (accessory) => {
|
|
153190
|
+
if (this.bridgeHost !== null && await this.bridgeHost.add(accessory)) return;
|
|
153191
|
+
await publishStandalone(accessory, {
|
|
153192
|
+
pincode: this.pincode,
|
|
153193
|
+
port: 0,
|
|
153194
|
+
bind: this.bind,
|
|
153195
|
+
logger: this.ctx.logger
|
|
153196
|
+
});
|
|
153197
|
+
},
|
|
153198
|
+
unpublish: async (accessory) => {
|
|
153199
|
+
if (this.bridgeHost?.holds(accessory) === true) {
|
|
153200
|
+
this.bridgeHost.remove(accessory);
|
|
153201
|
+
return;
|
|
153202
|
+
}
|
|
153203
|
+
await unpublishAccessory(accessory, this.ctx.logger);
|
|
153204
|
+
},
|
|
153205
|
+
persist: (entries) => this.updateGlobalSettings({ exposedActions: [...entries] })
|
|
153206
|
+
}, this.config.exposedActions ?? []);
|
|
153207
|
+
await this.actionExports.attachAll();
|
|
153208
|
+
await this.actionExports.reconcile();
|
|
151854
153209
|
this.ctx.addDisposer(async () => {
|
|
153210
|
+
await this.actionExports?.dispose();
|
|
151855
153211
|
await this.detachAll();
|
|
151856
153212
|
await this.bridgeHost?.dispose();
|
|
151857
153213
|
});
|
|
@@ -151882,6 +153238,27 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
151882
153238
|
}),
|
|
151883
153239
|
exposeDevice: async ({ deviceId, capabilities }) => this.exposeDevice(deviceId, capabilities),
|
|
151884
153240
|
unexposeDevice: async ({ deviceId }) => this.unexposeDevice(deviceId),
|
|
153241
|
+
listSupportedEntityKinds: async () => ["device", "action"],
|
|
153242
|
+
listExposedEntities: async () => {
|
|
153243
|
+
await this.actionExports?.reconcile();
|
|
153244
|
+
return [...Array.from(this.exposed.entries()).map(([deviceId, m]) => ({
|
|
153245
|
+
entity: {
|
|
153246
|
+
kind: "device",
|
|
153247
|
+
deviceId
|
|
153248
|
+
},
|
|
153249
|
+
exposedAs: m.accessory.displayName
|
|
153250
|
+
})), ...this.actionExports?.list() ?? []];
|
|
153251
|
+
},
|
|
153252
|
+
exposeEntity: async ({ entity }) => {
|
|
153253
|
+
if (entity.kind === "device") return this.exposeDevice(entity.deviceId);
|
|
153254
|
+
if (entity.kind === "action") return this.requireActionExports().expose(entity.actionId);
|
|
153255
|
+
throw new Error("export-hap: a notification target cannot be exported to HomeKit");
|
|
153256
|
+
},
|
|
153257
|
+
unexposeEntity: async ({ entity }) => {
|
|
153258
|
+
if (entity.kind === "device") return this.unexposeDevice(entity.deviceId);
|
|
153259
|
+
if (entity.kind === "action") return this.requireActionExports().unexpose(entity.actionId);
|
|
153260
|
+
throw new Error("export-hap: a notification target cannot be exported to HomeKit");
|
|
153261
|
+
},
|
|
151885
153262
|
getDeviceSettingsContribution: (input) => this.buildDeviceSettingsContribution(input.deviceId),
|
|
151886
153263
|
getDeviceLiveContribution: async () => null,
|
|
151887
153264
|
applyDeviceSettingsPatch: (input) => this.applyDeviceSettingsPatch(input.deviceId, input.patch)
|
|
@@ -152087,6 +153464,10 @@ var ExportHapAddon = class extends BaseAddon {
|
|
|
152087
153464
|
this.ctx.logger.withTags({ deviceId: Number.parseInt(deviceId, 10) }).warn("export-hap: mapper dispose failed", { meta: { error: errMsg(err) } });
|
|
152088
153465
|
});
|
|
152089
153466
|
}
|
|
153467
|
+
requireActionExports() {
|
|
153468
|
+
if (this.actionExports === null) throw new Error("export-hap: addon is not initialised");
|
|
153469
|
+
return this.actionExports;
|
|
153470
|
+
}
|
|
152090
153471
|
async detachAll() {
|
|
152091
153472
|
const ids = Array.from(this.exposed.keys());
|
|
152092
153473
|
for (const id of ids) await this.detachMapper(id);
|