@camstack/types 1.2.554 → 1.2.556
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 +18 -4
- package/dist/addon.js +4 -3
- package/dist/addon.mjs +4 -3
- package/dist/audit/device-transition.d.ts +53 -0
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/ir-transmitter.cap.d.ts +47 -2
- package/dist/capabilities/notification-rules.cap.d.ts +237 -0
- package/dist/capabilities/osd-manager.cap.d.ts +96 -0
- package/dist/capabilities/remote.cap.d.ts +24 -0
- package/dist/client.js +76 -8
- package/dist/client.mjs +76 -8
- package/dist/device/hero/hero-row.d.ts +6 -1
- package/dist/enums/event-category.d.ts +9 -0
- package/dist/enums.js +1 -1
- package/dist/enums.mjs +1 -1
- package/dist/{event-category-78tcBemo.mjs → event-category-Dv-Gcv1f.mjs} +9 -0
- package/dist/{event-category-BC4RRerT.js → event-category-Ps2LC8dN.js} +9 -0
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/index.js +354 -24
- package/dist/index.mjs +343 -25
- package/dist/ir/fastlz.d.ts +7 -0
- package/dist/ir/index.d.ts +2 -0
- package/dist/ir/ir-error.d.ts +1 -1
- package/dist/ir/ir-payload.d.ts +7 -1
- package/dist/ir/native.d.ts +24 -0
- package/dist/ir/tuya.d.ts +5 -0
- package/dist/notification/system-event-families.d.ts +5 -0
- package/dist/notification/system-event-filters.d.ts +1 -1
- package/dist/remote/remote-config.d.ts +6 -0
- package/dist/remote/remote-sources.d.ts +12 -0
- package/dist/{sleep-dcR4vBFG.js → sleep-BRGFFgr9.js} +46 -2
- package/dist/{sleep-D0roI_CZ.mjs → sleep-Czv-4wFH.mjs} +41 -3
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Plain data, zero Zod: a forked runner must not import the schema barrel
|
|
12
12
|
* (~144MB RSS per runner — D28).
|
|
13
13
|
*
|
|
14
|
-
* Coverage:
|
|
14
|
+
* Coverage: 34 caps, 85 methods with defaults.
|
|
15
15
|
*/
|
|
16
16
|
export declare const CAP_INPUT_DEFAULTS: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, unknown>>>>>>;
|
|
17
17
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 1484 method paths across 205 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { MethodRole } from '../auth/viewer-access.js';
|
|
12
12
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* system-scope cap that takes a deviceId was previously never device-filtered
|
|
7
7
|
* — see the generator header).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 614 methods carry a device reference, of which
|
|
10
10
|
* 195 are on SYSTEM-scope caps.
|
|
11
11
|
*
|
|
12
12
|
* Top-level fields, number arrays, and one-level arrays of objects carrying
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
3
|
-
const require_event_category = require("./event-category-
|
|
2
|
+
const require_sleep = require("./sleep-BRGFFgr9.js");
|
|
3
|
+
const require_event_category = require("./event-category-Ps2LC8dN.js");
|
|
4
4
|
const require_composed_stable_id = require("./composed-stable-id-CDNLq7Y8.js");
|
|
5
5
|
const require_implemented_methods = require("./implemented-methods-Cj65uy2F.js");
|
|
6
6
|
const require_node_color = require("./node-color.js");
|
|
@@ -46059,16 +46059,193 @@ function decodePronto(code) {
|
|
|
46059
46059
|
};
|
|
46060
46060
|
}
|
|
46061
46061
|
//#endregion
|
|
46062
|
+
//#region src/ir/fastlz.ts
|
|
46063
|
+
/**
|
|
46064
|
+
* FastLZ level 1: a byte-oriented LZ77 stream. A control byte below 32 starts a
|
|
46065
|
+
* literal run of `ctrl + 1` bytes; otherwise it is a back-reference whose length
|
|
46066
|
+
* is `ctrl >> 5` (extended by one byte when 7) and whose distance is split
|
|
46067
|
+
* between the low 5 bits and the next byte.
|
|
46068
|
+
*/
|
|
46069
|
+
var MAX_DISTANCE = 8192;
|
|
46070
|
+
var MAX_LITERAL_RUN = 32;
|
|
46071
|
+
var MIN_MATCH = 3;
|
|
46072
|
+
var MAX_MATCH = 264;
|
|
46073
|
+
/**
|
|
46074
|
+
* Most bytes a decoded IR code may hold: two bytes per timing. A level-1 stream
|
|
46075
|
+
* can expand ~130x, so the decoder checks this bound before every write.
|
|
46076
|
+
*/
|
|
46077
|
+
var IR_DECOMPRESSED_MAX = IR_TIMINGS_MAX * 2;
|
|
46078
|
+
function fastlzDecompress(input) {
|
|
46079
|
+
const out = [];
|
|
46080
|
+
let ip = 0;
|
|
46081
|
+
const room = (count) => {
|
|
46082
|
+
if (out.length + count > IR_DECOMPRESSED_MAX) throw new IrCodecError("tuya-malformed", "decompressed code is larger than any IR train");
|
|
46083
|
+
};
|
|
46084
|
+
const next = () => {
|
|
46085
|
+
const byte = input[ip++];
|
|
46086
|
+
if (byte === void 0) throw new IrCodecError("tuya-malformed", "compressed stream is truncated");
|
|
46087
|
+
return byte;
|
|
46088
|
+
};
|
|
46089
|
+
while (ip < input.length) {
|
|
46090
|
+
const ctrl = next();
|
|
46091
|
+
if (ctrl < 32) {
|
|
46092
|
+
room(ctrl + 1);
|
|
46093
|
+
for (let i = 0; i <= ctrl; i++) out.push(next());
|
|
46094
|
+
continue;
|
|
46095
|
+
}
|
|
46096
|
+
let len = (ctrl >> 5) - 1;
|
|
46097
|
+
if (len === 6) len += next();
|
|
46098
|
+
const distance = ((ctrl & 31) << 8) + next() + 1;
|
|
46099
|
+
const start = out.length - distance;
|
|
46100
|
+
if (start < 0) throw new IrCodecError("tuya-malformed", "back-reference points before the stream");
|
|
46101
|
+
room(len + 3);
|
|
46102
|
+
for (let i = 0; i < len + 3; i++) {
|
|
46103
|
+
const byte = out[start + i];
|
|
46104
|
+
if (byte === void 0) throw new IrCodecError("tuya-malformed", "back-reference is invalid");
|
|
46105
|
+
out.push(byte);
|
|
46106
|
+
}
|
|
46107
|
+
}
|
|
46108
|
+
return Uint8Array.from(out);
|
|
46109
|
+
}
|
|
46110
|
+
function fastlzCompress(input) {
|
|
46111
|
+
const out = [];
|
|
46112
|
+
const lastSeen = /* @__PURE__ */ new Map();
|
|
46113
|
+
let literalStart = 0;
|
|
46114
|
+
const flushLiterals = (end) => {
|
|
46115
|
+
for (let from = literalStart; from < end; from += MAX_LITERAL_RUN) {
|
|
46116
|
+
const to = Math.min(from + MAX_LITERAL_RUN, end);
|
|
46117
|
+
out.push(to - from - 1);
|
|
46118
|
+
for (let i = from; i < to; i++) out.push(input[i] ?? 0);
|
|
46119
|
+
}
|
|
46120
|
+
};
|
|
46121
|
+
let pos = 0;
|
|
46122
|
+
while (pos < input.length) {
|
|
46123
|
+
let matchLen = 0;
|
|
46124
|
+
let matchDistance = 0;
|
|
46125
|
+
if (pos + MIN_MATCH <= input.length) {
|
|
46126
|
+
const key = (input[pos] ?? 0) << 16 | (input[pos + 1] ?? 0) << 8 | (input[pos + 2] ?? 0);
|
|
46127
|
+
const candidate = lastSeen.get(key);
|
|
46128
|
+
lastSeen.set(key, pos);
|
|
46129
|
+
if (candidate !== void 0 && pos - candidate <= MAX_DISTANCE) {
|
|
46130
|
+
let len = 0;
|
|
46131
|
+
while (pos + len < input.length && len < MAX_MATCH && input[candidate + len] === input[pos + len]) len++;
|
|
46132
|
+
if (len >= MIN_MATCH) {
|
|
46133
|
+
matchLen = len;
|
|
46134
|
+
matchDistance = pos - candidate - 1;
|
|
46135
|
+
}
|
|
46136
|
+
}
|
|
46137
|
+
}
|
|
46138
|
+
if (matchLen === 0) {
|
|
46139
|
+
pos++;
|
|
46140
|
+
continue;
|
|
46141
|
+
}
|
|
46142
|
+
flushLiterals(pos);
|
|
46143
|
+
const enc = matchLen - 2;
|
|
46144
|
+
if (enc < 7) out.push(enc << 5 | matchDistance >> 8);
|
|
46145
|
+
else out.push(224 | matchDistance >> 8, enc - 7);
|
|
46146
|
+
out.push(matchDistance & 255);
|
|
46147
|
+
pos += matchLen;
|
|
46148
|
+
literalStart = pos;
|
|
46149
|
+
}
|
|
46150
|
+
flushLiterals(input.length);
|
|
46151
|
+
return Uint8Array.from(out);
|
|
46152
|
+
}
|
|
46153
|
+
//#endregion
|
|
46154
|
+
//#region src/ir/tuya.ts
|
|
46155
|
+
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
46156
|
+
var MAX_DURATION_US = 65535;
|
|
46157
|
+
function toBase64(bytes) {
|
|
46158
|
+
let out = "";
|
|
46159
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
46160
|
+
const a = bytes[i] ?? 0;
|
|
46161
|
+
const b = bytes[i + 1] ?? 0;
|
|
46162
|
+
const c = bytes[i + 2] ?? 0;
|
|
46163
|
+
const word = a << 16 | b << 8 | c;
|
|
46164
|
+
out += ALPHABET[word >> 18 & 63];
|
|
46165
|
+
out += ALPHABET[word >> 12 & 63];
|
|
46166
|
+
out += i + 1 < bytes.length ? ALPHABET[word >> 6 & 63] : "=";
|
|
46167
|
+
out += i + 2 < bytes.length ? ALPHABET[word & 63] : "=";
|
|
46168
|
+
}
|
|
46169
|
+
return out;
|
|
46170
|
+
}
|
|
46171
|
+
function fromBase64(text) {
|
|
46172
|
+
const clean = text.trim().replace(/=+$/, "");
|
|
46173
|
+
if (clean.length === 0 || clean.length % 4 === 1) throw new IrCodecError("tuya-malformed", "not a base64 string");
|
|
46174
|
+
const out = [];
|
|
46175
|
+
let bits = 0;
|
|
46176
|
+
let acc = 0;
|
|
46177
|
+
for (const ch of clean) {
|
|
46178
|
+
const value = ALPHABET.indexOf(ch);
|
|
46179
|
+
if (value < 0) throw new IrCodecError("tuya-malformed", "not a base64 string");
|
|
46180
|
+
acc = acc << 6 | value;
|
|
46181
|
+
bits += 6;
|
|
46182
|
+
if (bits >= 8) {
|
|
46183
|
+
bits -= 8;
|
|
46184
|
+
out.push(acc >> bits & 255);
|
|
46185
|
+
}
|
|
46186
|
+
}
|
|
46187
|
+
return Uint8Array.from(out);
|
|
46188
|
+
}
|
|
46189
|
+
/** Signed pulse train to a Tuya IR code: base64(FastLZ(uint16 LE durations)). */
|
|
46190
|
+
function encodeTuya(timings) {
|
|
46191
|
+
const bytes = new Uint8Array(timings.length * 2);
|
|
46192
|
+
timings.forEach((value, index) => {
|
|
46193
|
+
const duration = Math.abs(value);
|
|
46194
|
+
if (duration === 0 || duration > MAX_DURATION_US) throw new IrCodecError("invalid-timings", `timing ${index} does not fit 16 bits`);
|
|
46195
|
+
bytes[index * 2] = duration & 255;
|
|
46196
|
+
bytes[index * 2 + 1] = duration >> 8;
|
|
46197
|
+
});
|
|
46198
|
+
return toBase64(fastlzCompress(bytes));
|
|
46199
|
+
}
|
|
46200
|
+
/** A Tuya IR code to a signed pulse train (mark first). Throws `IrCodecError`. */
|
|
46201
|
+
function decodeTuya(code) {
|
|
46202
|
+
const bytes = fastlzDecompress(fromBase64(code));
|
|
46203
|
+
if (bytes.length === 0 || bytes.length % 2 !== 0) throw new IrCodecError("tuya-malformed", "payload is not a list of 16-bit durations");
|
|
46204
|
+
const timings = [];
|
|
46205
|
+
for (let i = 0; i < bytes.length; i += 2) {
|
|
46206
|
+
const duration = (bytes[i] ?? 0) | (bytes[i + 1] ?? 0) << 8;
|
|
46207
|
+
timings.push(i / 2 % 2 === 0 ? duration : -duration);
|
|
46208
|
+
}
|
|
46209
|
+
const checked = IrTimingsSchema.safeParse(timings);
|
|
46210
|
+
if (!checked.success) throw new IrCodecError("tuya-malformed", checked.error.message);
|
|
46211
|
+
return checked.data;
|
|
46212
|
+
}
|
|
46213
|
+
//#endregion
|
|
46214
|
+
//#region src/ir/native.ts
|
|
46215
|
+
/** Device-native IR code formats a transmitter can replay verbatim. */
|
|
46216
|
+
var IrNativeFormatSchema = zod.z.enum(["tuya"]);
|
|
46217
|
+
/**
|
|
46218
|
+
* Longest native code accepted: base64 of the worst-case compressed stream
|
|
46219
|
+
* (every decoded byte as a literal, plus one control byte per 32), with margin.
|
|
46220
|
+
*/
|
|
46221
|
+
var IR_NATIVE_CODE_MAX_CHARS = Math.ceil((IR_DECOMPRESSED_MAX + Math.ceil(IR_DECOMPRESSED_MAX / 32)) / 3) * 4 + 256;
|
|
46222
|
+
var IrNativeCodeSchema = zod.z.object({
|
|
46223
|
+
format: IrNativeFormatSchema,
|
|
46224
|
+
code: zod.z.string().min(1).max(IR_NATIVE_CODE_MAX_CHARS)
|
|
46225
|
+
});
|
|
46226
|
+
var IR_NATIVE_CODECS = { tuya: {
|
|
46227
|
+
encode: encodeTuya,
|
|
46228
|
+
decode: decodeTuya
|
|
46229
|
+
} };
|
|
46230
|
+
//#endregion
|
|
46062
46231
|
//#region src/ir/ir-payload.ts
|
|
46063
|
-
/** What a remote command stores: a raw pulse train,
|
|
46064
|
-
var IrPayloadSchema = zod.z.discriminatedUnion("kind", [
|
|
46065
|
-
|
|
46066
|
-
|
|
46067
|
-
|
|
46068
|
-
|
|
46069
|
-
|
|
46070
|
-
|
|
46071
|
-
|
|
46232
|
+
/** What a remote command stores: a raw pulse train, a learned Pronto code, or a device-native code. */
|
|
46233
|
+
var IrPayloadSchema = zod.z.discriminatedUnion("kind", [
|
|
46234
|
+
zod.z.object({
|
|
46235
|
+
kind: zod.z.literal("raw"),
|
|
46236
|
+
timings: zod.z.array(zod.z.number().int()),
|
|
46237
|
+
settings: TransmitSettingsSchema.optional()
|
|
46238
|
+
}),
|
|
46239
|
+
zod.z.object({
|
|
46240
|
+
kind: zod.z.literal("pronto"),
|
|
46241
|
+
code: zod.z.string()
|
|
46242
|
+
}),
|
|
46243
|
+
zod.z.object({
|
|
46244
|
+
kind: zod.z.literal("native"),
|
|
46245
|
+
format: IrNativeFormatSchema,
|
|
46246
|
+
code: zod.z.string()
|
|
46247
|
+
})
|
|
46248
|
+
]);
|
|
46072
46249
|
/** Resolve a payload to what `ir-transmitter.send` takes. Throws `IrCodecError`. */
|
|
46073
46250
|
function toTimings(payload) {
|
|
46074
46251
|
if (payload.kind === "pronto") {
|
|
@@ -46078,6 +46255,10 @@ function toTimings(payload) {
|
|
|
46078
46255
|
settings: { carrierHz: decoded.carrierHz }
|
|
46079
46256
|
};
|
|
46080
46257
|
}
|
|
46258
|
+
if (payload.kind === "native") return {
|
|
46259
|
+
timings: IR_NATIVE_CODECS[payload.format].decode(payload.code),
|
|
46260
|
+
settings: {}
|
|
46261
|
+
};
|
|
46081
46262
|
const checked = IrTimingsSchema.safeParse(payload.timings);
|
|
46082
46263
|
if (!checked.success) throw new IrCodecError("invalid-timings", checked.error.message);
|
|
46083
46264
|
return {
|
|
@@ -60291,18 +60472,32 @@ var HeroRowModelSchema = zod.z.object({
|
|
|
60291
60472
|
extras: zod.z.array(HeroControlSchema).max(2).optional(),
|
|
60292
60473
|
trailing: HeroFactSchema.nullable()
|
|
60293
60474
|
});
|
|
60294
|
-
/**
|
|
60475
|
+
/**
|
|
60476
|
+
* A measurement that IS the headline. The row trails it so a client that paints only
|
|
60477
|
+
* `trailing` still shows the reading. Power, battery and consumables stay ahead of these.
|
|
60478
|
+
*/
|
|
60479
|
+
var ROW_READING_FACT_IDS = [
|
|
60480
|
+
"temperature",
|
|
60481
|
+
"humidity",
|
|
60482
|
+
"pressure",
|
|
60483
|
+
"illuminance",
|
|
60484
|
+
"reading",
|
|
60485
|
+
"air-quality",
|
|
60486
|
+
"valve"
|
|
60487
|
+
];
|
|
60488
|
+
/** The trailing fact, in order of preference. A reading joins only when it repeats the headline. */
|
|
60295
60489
|
var TRAILING_ORDER = [
|
|
60296
60490
|
"power",
|
|
60297
60491
|
"battery",
|
|
60298
60492
|
"consumables"
|
|
60299
60493
|
];
|
|
60300
|
-
|
|
60494
|
+
var READING_FACT_IDS = new Set(ROW_READING_FACT_IDS);
|
|
60495
|
+
function trailingOf(model) {
|
|
60301
60496
|
for (const id of TRAILING_ORDER) {
|
|
60302
|
-
const found = facts.find((f) => f.id === id);
|
|
60497
|
+
const found = model.facts.find((f) => f.id === id);
|
|
60303
60498
|
if (found !== void 0) return found;
|
|
60304
60499
|
}
|
|
60305
|
-
return null;
|
|
60500
|
+
return model.facts.find((f) => READING_FACT_IDS.has(f.id) && f.text.en === model.title.en) ?? null;
|
|
60306
60501
|
}
|
|
60307
60502
|
/**
|
|
60308
60503
|
* A type whose primary is a named control, not its power: a climate row is the mode
|
|
@@ -60397,7 +60592,7 @@ function timedRunOf(model) {
|
|
|
60397
60592
|
};
|
|
60398
60593
|
}
|
|
60399
60594
|
function projectDeviceRow(model) {
|
|
60400
|
-
const trailing = trailingOf(model
|
|
60595
|
+
const trailing = trailingOf(model);
|
|
60401
60596
|
const primary = primaryOf(model);
|
|
60402
60597
|
return {
|
|
60403
60598
|
deviceId: model.deviceId,
|
|
@@ -61558,7 +61753,19 @@ var IrSendResultSchema = zod.z.object({
|
|
|
61558
61753
|
var IrTransmitterInfoSchema = zod.z.object({
|
|
61559
61754
|
media: zod.z.array(IrMediumSchema),
|
|
61560
61755
|
settable: zod.z.array(TransmitSettingKeySchema),
|
|
61561
|
-
maxTimings: zod.z.number().int().positive()
|
|
61756
|
+
maxTimings: zod.z.number().int().positive(),
|
|
61757
|
+
/** The transmitter can learn a code (`learn`). */
|
|
61758
|
+
learn: zod.z.boolean().default(false),
|
|
61759
|
+
/** Native code formats the transmitter replays verbatim (`send.native`). */
|
|
61760
|
+
formats: zod.z.array(IrNativeFormatSchema).default([])
|
|
61761
|
+
});
|
|
61762
|
+
var IR_LEARN_TIMEOUT_DEFAULT_MS = 2e4;
|
|
61763
|
+
var IR_LEARN_TIMEOUT_MAX_MS = 6e4;
|
|
61764
|
+
var IrLearnResultSchema = zod.z.object({
|
|
61765
|
+
/** The code in the device's own format, when it reports one. */
|
|
61766
|
+
native: IrNativeCodeSchema.nullable(),
|
|
61767
|
+
timings: IrTimingsSchema,
|
|
61768
|
+
carrierHz: zod.z.number().int().positive().nullable()
|
|
61562
61769
|
});
|
|
61563
61770
|
/**
|
|
61564
61771
|
* ir-transmitter — emit a pulse train (infrared or RF) with settings. One cap
|
|
@@ -61569,7 +61776,12 @@ var IrTransmitterInfoSchema = zod.z.object({
|
|
|
61569
61776
|
* transmitter cannot be reached) and `ir-transmitter.too-long` (more pulses
|
|
61570
61777
|
* than the transmitter's `maxTimings`). A setting the transmitter cannot apply
|
|
61571
61778
|
* is NOT a refusal: the train is sent and the key comes back in
|
|
61572
|
-
* `ignoredSettings`.
|
|
61779
|
+
* `ignoredSettings`. `send` takes exactly one of `timings` or `native` (a code
|
|
61780
|
+
* in a format listed in `getInfo.formats`).
|
|
61781
|
+
*
|
|
61782
|
+
* `learn` waits for the user to point a remote at the transmitter and refuses
|
|
61783
|
+
* with `ir-transmitter.learn-unsupported`, `ir-transmitter.learn-timeout` or
|
|
61784
|
+
* `ir-transmitter.learn-undecodable`.
|
|
61573
61785
|
*/
|
|
61574
61786
|
var irTransmitterCapability = {
|
|
61575
61787
|
name: "ir-transmitter",
|
|
@@ -61580,9 +61792,17 @@ var irTransmitterCapability = {
|
|
|
61580
61792
|
methods: {
|
|
61581
61793
|
send: require_sleep.method(zod.z.object({
|
|
61582
61794
|
deviceId: zod.z.number().int().nonnegative(),
|
|
61583
|
-
timings: IrTimingsSchema,
|
|
61795
|
+
timings: IrTimingsSchema.optional(),
|
|
61796
|
+
native: IrNativeCodeSchema.optional(),
|
|
61584
61797
|
settings: TransmitSettingsSchema.optional()
|
|
61585
|
-
}), IrSendResultSchema, {
|
|
61798
|
+
}).refine((input) => input.timings === void 0 !== (input.native === void 0), { message: "send takes exactly one of timings or native" }), IrSendResultSchema, {
|
|
61799
|
+
kind: "mutation",
|
|
61800
|
+
auth: "protected"
|
|
61801
|
+
}),
|
|
61802
|
+
learn: require_sleep.method(zod.z.object({
|
|
61803
|
+
deviceId: zod.z.number().int().nonnegative(),
|
|
61804
|
+
timeoutMs: zod.z.number().int().positive().max(IR_LEARN_TIMEOUT_MAX_MS).default(IR_LEARN_TIMEOUT_DEFAULT_MS)
|
|
61805
|
+
}), IrLearnResultSchema, {
|
|
61586
61806
|
kind: "mutation",
|
|
61587
61807
|
auth: "protected"
|
|
61588
61808
|
}),
|
|
@@ -74999,6 +75219,7 @@ var NcSystemEventKindSchema = zod.z.enum([
|
|
|
74999
75219
|
"recording-degraded",
|
|
75000
75220
|
"device-attention-required",
|
|
75001
75221
|
"device-attention-resolved",
|
|
75222
|
+
"device-command",
|
|
75002
75223
|
"storage-location-low",
|
|
75003
75224
|
"storage-location-critical",
|
|
75004
75225
|
"storage-location-ok",
|
|
@@ -75105,6 +75326,22 @@ var NC_CONSUMABLE_LOW_PERCENT_MAX = 95;
|
|
|
75105
75326
|
* gate; the remaining lists are optional narrowing filters relevant to the
|
|
75106
75327
|
* selected kinds.
|
|
75107
75328
|
*/
|
|
75329
|
+
/** How a settled command can be filtered (D1022): a device's own change is not a command. */
|
|
75330
|
+
var NC_COMMAND_OUTCOMES = [
|
|
75331
|
+
"confirmed",
|
|
75332
|
+
"already",
|
|
75333
|
+
"unconfirmed",
|
|
75334
|
+
"failed"
|
|
75335
|
+
];
|
|
75336
|
+
/** Who gave a command, as the transition audit names the actor (D1022). */
|
|
75337
|
+
var NC_COMMAND_ACTOR_KINDS = [
|
|
75338
|
+
"user",
|
|
75339
|
+
"addon",
|
|
75340
|
+
"action",
|
|
75341
|
+
"scheduler",
|
|
75342
|
+
"composition",
|
|
75343
|
+
"node"
|
|
75344
|
+
];
|
|
75108
75345
|
var NcSystemEventConditionSchema = zod.z.object({
|
|
75109
75346
|
kinds: zod.z.array(NcSystemEventKindSchema).min(1),
|
|
75110
75347
|
deviceIds: zod.z.array(zod.z.number().int()).min(1).optional(),
|
|
@@ -75136,6 +75373,16 @@ var NcSystemEventConditionSchema = zod.z.object({
|
|
|
75136
75373
|
nodeIds: zod.z.array(zod.z.string().min(1)).min(1).optional(),
|
|
75137
75374
|
packageNames: zod.z.array(zod.z.string().min(1)).min(1).optional(),
|
|
75138
75375
|
/**
|
|
75376
|
+
* `device-command` only: the vocabulary ACTION IDS (D983, `powerSource.forceRestart`)
|
|
75377
|
+
* this rule speaks about - the same dictionary the automation action blocks
|
|
75378
|
+
* pick from. The hub refuses an id the action index does not know.
|
|
75379
|
+
*/
|
|
75380
|
+
commandActions: zod.z.array(zod.z.string().min(1)).min(1).optional(),
|
|
75381
|
+
/** `device-command` only: how the command settled. A device's own change is not a command. */
|
|
75382
|
+
commandOutcomes: zod.z.array(zod.z.enum(NC_COMMAND_OUTCOMES)).min(1).optional(),
|
|
75383
|
+
/** `device-command` only: who asked (`user`, `addon`, `action`, `scheduler`, `composition`, `node`). */
|
|
75384
|
+
commandActorKinds: zod.z.array(zod.z.enum(NC_COMMAND_ACTOR_KINDS)).min(1).optional(),
|
|
75385
|
+
/**
|
|
75139
75386
|
* At or below this remaining-life %, a consumable is LOW for THIS rule
|
|
75140
75387
|
* (D642). Absent = {@link NC_CONSUMABLE_LOW_PERCENT_DEFAULT}; at most
|
|
75141
75388
|
* {@link NC_CONSUMABLE_LOW_PERCENT_MAX}, so every episode can recover. Scoped to the
|
|
@@ -76721,6 +76968,10 @@ var NC_CONDITION_CATALOG = [
|
|
|
76721
76968
|
value: "device-attention-resolved",
|
|
76722
76969
|
label: "Device attention resolved"
|
|
76723
76970
|
},
|
|
76971
|
+
{
|
|
76972
|
+
value: "device-command",
|
|
76973
|
+
label: "Command given to a device"
|
|
76974
|
+
},
|
|
76724
76975
|
{
|
|
76725
76976
|
value: "storage-location-low",
|
|
76726
76977
|
label: "Storage location low"
|
|
@@ -108873,7 +109124,8 @@ function buildHeroModel(input) {
|
|
|
108873
109124
|
label: require_sleep.t(integration, integration)
|
|
108874
109125
|
}], ...fragments.flatMap((f) => f.badges ?? [])];
|
|
108875
109126
|
const headline = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.title !== void 0)?.title;
|
|
108876
|
-
const
|
|
109127
|
+
const readingIds = new Set(ROW_READING_FACT_IDS);
|
|
109128
|
+
const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en || readingIds.has(f.id));
|
|
108877
109129
|
const sideTiles = {
|
|
108878
109130
|
left: tilesOf(fragments, "left"),
|
|
108879
109131
|
right: tilesOf(fragments, "right")
|
|
@@ -112900,6 +113152,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
112900
113152
|
access: "view",
|
|
112901
113153
|
role: "viewer"
|
|
112902
113154
|
},
|
|
113155
|
+
"irTransmitter.learn": {
|
|
113156
|
+
capName: "ir-transmitter",
|
|
113157
|
+
capScope: "device",
|
|
113158
|
+
addonId: null,
|
|
113159
|
+
access: "create",
|
|
113160
|
+
role: "viewer"
|
|
113161
|
+
},
|
|
112903
113162
|
"irTransmitter.send": {
|
|
112904
113163
|
capName: "ir-transmitter",
|
|
112905
113164
|
capScope: "device",
|
|
@@ -123187,6 +123446,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
|
|
|
123187
123446
|
form: "single",
|
|
123188
123447
|
optional: false
|
|
123189
123448
|
}],
|
|
123449
|
+
"irTransmitter.learn": [{
|
|
123450
|
+
name: "deviceId",
|
|
123451
|
+
form: "single",
|
|
123452
|
+
optional: false
|
|
123453
|
+
}],
|
|
123190
123454
|
"irTransmitter.send": [{
|
|
123191
123455
|
name: "deviceId",
|
|
123192
123456
|
form: "single",
|
|
@@ -128111,7 +128375,10 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
|
|
|
128111
128375
|
"deviceTypes",
|
|
128112
128376
|
"nodeIds",
|
|
128113
128377
|
"packageNames",
|
|
128114
|
-
"consumableLowPercent"
|
|
128378
|
+
"consumableLowPercent",
|
|
128379
|
+
"commandActions",
|
|
128380
|
+
"commandOutcomes",
|
|
128381
|
+
"commandActorKinds"
|
|
128115
128382
|
];
|
|
128116
128383
|
/**
|
|
128117
128384
|
* Does `filter` say anything about `kind`?
|
|
@@ -128127,6 +128394,9 @@ function systemEventFilterApplies(kind, filter) {
|
|
|
128127
128394
|
case "nodeIds": return kind.startsWith("node-") || kind === "addon-crash-loop" || kind === "addon-update-available" || kind === "addon-updated" || kind === "server-update-available" || kind === "wrapper-update-available" || kind === "server-updated" || kind.startsWith("storage-location-") || kind.startsWith("alert-");
|
|
128128
128395
|
case "packageNames": return kind.endsWith("update-available") || kind === "addon-updated" || kind === "node-updating" || kind === "server-updated";
|
|
128129
128396
|
case "consumableLowPercent": return NC_CONSUMABLE_SYSTEM_EVENT_KINDS.includes(kind);
|
|
128397
|
+
case "commandActions":
|
|
128398
|
+
case "commandOutcomes":
|
|
128399
|
+
case "commandActorKinds": return kind === "device-command";
|
|
128130
128400
|
}
|
|
128131
128401
|
}
|
|
128132
128402
|
/**
|
|
@@ -128187,6 +128457,7 @@ var NC_SYSTEM_EVENT_FAMILY = {
|
|
|
128187
128457
|
"recording-degraded": "device-events",
|
|
128188
128458
|
"device-attention-required": "device-events",
|
|
128189
128459
|
"device-attention-resolved": "device-events",
|
|
128460
|
+
"device-command": "device-events",
|
|
128190
128461
|
"node-online": "system",
|
|
128191
128462
|
"node-offline": "system",
|
|
128192
128463
|
"node-restarting": "system",
|
|
@@ -128236,7 +128507,10 @@ var NC_SYSTEM_EVENT_FAMILY_FILTERS = {
|
|
|
128236
128507
|
"deviceIds",
|
|
128237
128508
|
"excludeDeviceIds",
|
|
128238
128509
|
"deviceTypes",
|
|
128239
|
-
"consumableLowPercent"
|
|
128510
|
+
"consumableLowPercent",
|
|
128511
|
+
"commandActions",
|
|
128512
|
+
"commandOutcomes",
|
|
128513
|
+
"commandActorKinds"
|
|
128240
128514
|
],
|
|
128241
128515
|
system: ["nodeIds", "packageNames"],
|
|
128242
128516
|
alarm: ["deviceIds"]
|
|
@@ -128305,6 +128579,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
128305
128579
|
label: "Needs attention",
|
|
128306
128580
|
kinds: ["device-attention-required", "device-attention-resolved"]
|
|
128307
128581
|
},
|
|
128582
|
+
{
|
|
128583
|
+
id: "device-command",
|
|
128584
|
+
family: "device-events",
|
|
128585
|
+
label: "Commands given to devices",
|
|
128586
|
+
kinds: ["device-command"]
|
|
128587
|
+
},
|
|
128308
128588
|
{
|
|
128309
128589
|
id: "nodes",
|
|
128310
128590
|
family: "system",
|
|
@@ -128429,6 +128709,10 @@ function systemEventFamilyProblems(condition) {
|
|
|
128429
128709
|
code: "mixed-families",
|
|
128430
128710
|
families
|
|
128431
128711
|
});
|
|
128712
|
+
for (const action of condition.commandActions ?? []) if (require_sleep.findVocabAction(action) === void 0) problems.push({
|
|
128713
|
+
code: "unknown-command-action",
|
|
128714
|
+
action
|
|
128715
|
+
});
|
|
128432
128716
|
const [family] = families;
|
|
128433
128717
|
if (families.length !== 1 || family === void 0) return problems;
|
|
128434
128718
|
const allowed = NC_SYSTEM_EVENT_FAMILY_FILTERS[family];
|
|
@@ -128445,6 +128729,7 @@ function describeSystemEventFamilyProblem(problem) {
|
|
|
128445
128729
|
case "legacy-kind": return `'${problem.kind}' is a legacy kind and cannot be authored`;
|
|
128446
128730
|
case "mixed-families": return `event kinds span ${problem.families.join(" + ")} — one rule per family`;
|
|
128447
128731
|
case "filter-outside-family": return `filter '${problem.filter}' is not allowed on a ${problem.family} rule`;
|
|
128732
|
+
case "unknown-command-action": return `'${problem.action}' is not a vocabulary action id`;
|
|
128448
128733
|
}
|
|
128449
128734
|
}
|
|
128450
128735
|
//#endregion
|
|
@@ -130357,6 +130642,7 @@ var DEVICE_EVENTS = [
|
|
|
130357
130642
|
"recording-healthy",
|
|
130358
130643
|
"recording-degraded",
|
|
130359
130644
|
...DEVICE_ATTENTION,
|
|
130645
|
+
"device-command",
|
|
130360
130646
|
...ALARM
|
|
130361
130647
|
];
|
|
130362
130648
|
/** Every kind a summary may speak about — the two summarisable families. */
|
|
@@ -130813,6 +131099,37 @@ var NC_TEMPLATE_VARS = [
|
|
|
130813
131099
|
kinds: ["system"],
|
|
130814
131100
|
systemEventKinds: [...DEVICE_EVENTS]
|
|
130815
131101
|
},
|
|
131102
|
+
{
|
|
131103
|
+
name: "actionLabel",
|
|
131104
|
+
label: "Command",
|
|
131105
|
+
example: "Force restart",
|
|
131106
|
+
group: "system",
|
|
131107
|
+
families: ["rule"],
|
|
131108
|
+
fields: [...RULE_TEXT],
|
|
131109
|
+
kinds: ["system"],
|
|
131110
|
+
systemEventKinds: ["device-command"]
|
|
131111
|
+
},
|
|
131112
|
+
{
|
|
131113
|
+
name: "actorLabel",
|
|
131114
|
+
label: "Who asked",
|
|
131115
|
+
example: "velux",
|
|
131116
|
+
group: "system",
|
|
131117
|
+
families: ["rule"],
|
|
131118
|
+
fields: [...RULE_TEXT],
|
|
131119
|
+
kinds: ["system"],
|
|
131120
|
+
systemEventKinds: ["device-command"]
|
|
131121
|
+
},
|
|
131122
|
+
{
|
|
131123
|
+
name: "deviceLabel",
|
|
131124
|
+
label: "Device with type",
|
|
131125
|
+
description: "The device name with its type in parentheses. {{deviceName}} stays the bare name.",
|
|
131126
|
+
example: "Front door (Camera)",
|
|
131127
|
+
group: "system",
|
|
131128
|
+
families: ["rule"],
|
|
131129
|
+
fields: [...RULE_TEXT],
|
|
131130
|
+
kinds: ["system"],
|
|
131131
|
+
systemEventKinds: [...DEVICE_EVENTS]
|
|
131132
|
+
},
|
|
130816
131133
|
{
|
|
130817
131134
|
name: "locations",
|
|
130818
131135
|
label: "Intrusion locations",
|
|
@@ -131533,7 +131850,8 @@ var NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS = [
|
|
|
131533
131850
|
"rule-broken",
|
|
131534
131851
|
"rule-repaired",
|
|
131535
131852
|
"package-llm-silent",
|
|
131536
|
-
"package-llm-answered"
|
|
131853
|
+
"package-llm-answered",
|
|
131854
|
+
"device-command"
|
|
131537
131855
|
];
|
|
131538
131856
|
/**
|
|
131539
131857
|
* The catalog as `getTemplateCatalog` SERVES it: every descriptor, with the
|
|
@@ -139573,6 +139891,7 @@ exports.DeviceCertificateSettingsSchema = DeviceCertificateSettingsSchema;
|
|
|
139573
139891
|
exports.DeviceChallengeResultSchema = DeviceChallengeResultSchema;
|
|
139574
139892
|
exports.DeviceChallengeSchema = DeviceChallengeSchema;
|
|
139575
139893
|
exports.DeviceCodeSeveritySchema = DeviceCodeSeveritySchema;
|
|
139894
|
+
exports.DeviceCommandSettledEventSchema = require_sleep.DeviceCommandSettledEventSchema;
|
|
139576
139895
|
exports.DeviceConfig = DeviceConfig;
|
|
139577
139896
|
exports.DeviceCredentialSchema = DeviceCredentialSchema;
|
|
139578
139897
|
exports.DeviceCredentialStatusSchema = DeviceCredentialStatusSchema;
|
|
@@ -139943,6 +140262,10 @@ exports.INITIAL_SPAN = INITIAL_SPAN;
|
|
|
139943
140262
|
exports.INTEGRAL_OUTPUTS = require_implemented_methods.INTEGRAL_OUTPUTS;
|
|
139944
140263
|
exports.INTERNAL_ACTION_PREFIX = INTERNAL_ACTION_PREFIX;
|
|
139945
140264
|
exports.INVERTIBLE_CAPS = INVERTIBLE_CAPS;
|
|
140265
|
+
exports.IR_LEARN_TIMEOUT_DEFAULT_MS = IR_LEARN_TIMEOUT_DEFAULT_MS;
|
|
140266
|
+
exports.IR_LEARN_TIMEOUT_MAX_MS = IR_LEARN_TIMEOUT_MAX_MS;
|
|
140267
|
+
exports.IR_NATIVE_CODECS = IR_NATIVE_CODECS;
|
|
140268
|
+
exports.IR_NATIVE_CODE_MAX_CHARS = IR_NATIVE_CODE_MAX_CHARS;
|
|
139946
140269
|
exports.IR_TIMINGS_MAX = IR_TIMINGS_MAX;
|
|
139947
140270
|
exports.IconKeySchema = IconKeySchema;
|
|
139948
140271
|
exports.ImageContractSchema = ImageContractSchema;
|
|
@@ -139978,7 +140301,10 @@ exports.IntercomAbilitySchema = IntercomAbilitySchema;
|
|
|
139978
140301
|
exports.IntercomStatusSchema = IntercomStatusSchema;
|
|
139979
140302
|
exports.InvalidRecordError = require_sleep.InvalidRecordError;
|
|
139980
140303
|
exports.IrCodecError = IrCodecError;
|
|
140304
|
+
exports.IrLearnResultSchema = IrLearnResultSchema;
|
|
139981
140305
|
exports.IrMediumSchema = IrMediumSchema;
|
|
140306
|
+
exports.IrNativeCodeSchema = IrNativeCodeSchema;
|
|
140307
|
+
exports.IrNativeFormatSchema = IrNativeFormatSchema;
|
|
139982
140308
|
exports.IrPayloadSchema = IrPayloadSchema;
|
|
139983
140309
|
exports.IrSendResultSchema = IrSendResultSchema;
|
|
139984
140310
|
exports.IrTimingsSchema = IrTimingsSchema;
|
|
@@ -140320,6 +140646,8 @@ exports.NC_CAMERA_SCOPE_CAP_NAME = NC_CAMERA_SCOPE_CAP_NAME;
|
|
|
140320
140646
|
exports.NC_CLIP_POST_ROLL_DEFAULT_SEC = NC_CLIP_POST_ROLL_DEFAULT_SEC;
|
|
140321
140647
|
exports.NC_CLIP_PRE_ROLL_DEFAULT_SEC = NC_CLIP_PRE_ROLL_DEFAULT_SEC;
|
|
140322
140648
|
exports.NC_CLIP_RETENTION_MAX_SEC = NC_CLIP_RETENTION_MAX_SEC;
|
|
140649
|
+
exports.NC_COMMAND_ACTOR_KINDS = NC_COMMAND_ACTOR_KINDS;
|
|
140650
|
+
exports.NC_COMMAND_OUTCOMES = NC_COMMAND_OUTCOMES;
|
|
140323
140651
|
exports.NC_CONDITION_CATALOG = NC_CONDITION_CATALOG;
|
|
140324
140652
|
exports.NC_CONFIRM_DEFAULT_MAX_IMAGE_PX = NC_CONFIRM_DEFAULT_MAX_IMAGE_PX;
|
|
140325
140653
|
exports.NC_CONFIRM_DEFAULT_TIMEOUT_MS = NC_CONFIRM_DEFAULT_TIMEOUT_MS;
|
|
@@ -141783,6 +142111,7 @@ exports.decodeKeyedArrayOverride = decodeKeyedArrayOverride;
|
|
|
141783
142111
|
exports.decodePronto = decodePronto;
|
|
141784
142112
|
exports.decodePulseOverride = decodePulseOverride;
|
|
141785
142113
|
exports.decodeScalarOverride = decodeScalarOverride;
|
|
142114
|
+
exports.decodeTuya = decodeTuya;
|
|
141786
142115
|
exports.decodeVectorBase64 = decodeVectorBase64;
|
|
141787
142116
|
exports.decoderCapability = decoderCapability;
|
|
141788
142117
|
exports.defaultDeliveryForSection = defaultDeliveryForSection;
|
|
@@ -141888,6 +142217,7 @@ exports.encodeCardsToComposition = encodeCardsToComposition;
|
|
|
141888
142217
|
exports.encodeFlipperParsed = encodeFlipperParsed;
|
|
141889
142218
|
exports.encodeProfileFromStreamShape = encodeProfileFromStreamShape;
|
|
141890
142219
|
exports.encodeSamsung = encodeSamsung;
|
|
142220
|
+
exports.encodeTuya = encodeTuya;
|
|
141891
142221
|
exports.encodeVectorBase64 = encodeVectorBase64;
|
|
141892
142222
|
exports.ensureAlarmProfiles = ensureAlarmProfiles;
|
|
141893
142223
|
exports.entryBody = require_sleep.entryBody;
|