@camstack/sdk 0.1.55 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend-router.d.ts +1 -1
- package/dist/camera.d.ts +4 -4
- package/dist/detection.d.ts +1 -1
- package/dist/devices.d.ts +6 -6
- package/dist/features.d.ts +3 -3
- package/dist/index.cjs +1788 -1857
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1789 -1905
- package/dist/nvr.d.ts +8 -8
- package/dist/timeline.d.ts +4 -4
- package/dist/types.d.ts +2 -2
- package/package.json +10 -4
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/superjson/dist/double-indexed-kv.js","../../../node_modules/superjson/dist/registry.js","../../../node_modules/superjson/dist/class-registry.js","../../../node_modules/superjson/dist/util.js","../../../node_modules/superjson/dist/custom-transformer-registry.js","../../../node_modules/superjson/dist/is.js","../../../node_modules/superjson/dist/pathstringifier.js","../../../node_modules/superjson/dist/transformer.js","../../../node_modules/superjson/dist/accessDeep.js","../../../node_modules/superjson/dist/plainer.js","../../../node_modules/is-what/dist/getType.js","../../../node_modules/is-what/dist/isArray.js","../../../node_modules/is-what/dist/isPlainObject.js","../../../node_modules/copy-anything/dist/index.js","../../../node_modules/superjson/dist/index.js","../src/system.ts","../src/detection.ts","../src/devices.ts","../src/features.ts"],"sourcesContent":["export class DoubleIndexedKV {\n constructor() {\n this.keyToValue = new Map();\n this.valueToKey = new Map();\n }\n set(key, value) {\n this.keyToValue.set(key, value);\n this.valueToKey.set(value, key);\n }\n getByKey(key) {\n return this.keyToValue.get(key);\n }\n getByValue(value) {\n return this.valueToKey.get(value);\n }\n clear() {\n this.keyToValue.clear();\n this.valueToKey.clear();\n }\n}\n//# sourceMappingURL=double-indexed-kv.js.map","import { DoubleIndexedKV } from './double-indexed-kv.js';\nexport class Registry {\n constructor(generateIdentifier) {\n this.generateIdentifier = generateIdentifier;\n this.kv = new DoubleIndexedKV();\n }\n register(value, identifier) {\n if (this.kv.getByValue(value)) {\n return;\n }\n if (!identifier) {\n identifier = this.generateIdentifier(value);\n }\n this.kv.set(identifier, value);\n }\n clear() {\n this.kv.clear();\n }\n getIdentifier(value) {\n return this.kv.getByValue(value);\n }\n getValue(identifier) {\n return this.kv.getByKey(identifier);\n }\n}\n//# sourceMappingURL=registry.js.map","import { Registry } from './registry.js';\nexport class ClassRegistry extends Registry {\n constructor() {\n super(c => c.name);\n this.classToAllowedProps = new Map();\n }\n register(value, options) {\n if (typeof options === 'object') {\n if (options.allowProps) {\n this.classToAllowedProps.set(value, options.allowProps);\n }\n super.register(value, options.identifier);\n }\n else {\n super.register(value, options);\n }\n }\n getAllowedProps(value) {\n return this.classToAllowedProps.get(value);\n }\n}\n//# sourceMappingURL=class-registry.js.map","function valuesOfObj(record) {\n if ('values' in Object) {\n // eslint-disable-next-line es5/no-es6-methods\n return Object.values(record);\n }\n const values = [];\n // eslint-disable-next-line no-restricted-syntax\n for (const key in record) {\n if (record.hasOwnProperty(key)) {\n values.push(record[key]);\n }\n }\n return values;\n}\nexport function find(record, predicate) {\n const values = valuesOfObj(record);\n if ('find' in values) {\n // eslint-disable-next-line es5/no-es6-methods\n return values.find(predicate);\n }\n const valuesNotNever = values;\n for (let i = 0; i < valuesNotNever.length; i++) {\n const value = valuesNotNever[i];\n if (predicate(value)) {\n return value;\n }\n }\n return undefined;\n}\nexport function forEach(record, run) {\n Object.entries(record).forEach(([key, value]) => run(value, key));\n}\nexport function includes(arr, value) {\n return arr.indexOf(value) !== -1;\n}\nexport function findArr(record, predicate) {\n for (let i = 0; i < record.length; i++) {\n const value = record[i];\n if (predicate(value)) {\n return value;\n }\n }\n return undefined;\n}\n//# sourceMappingURL=util.js.map","import { find } from './util.js';\nexport class CustomTransformerRegistry {\n constructor() {\n this.transfomers = {};\n }\n register(transformer) {\n this.transfomers[transformer.name] = transformer;\n }\n findApplicable(v) {\n return find(this.transfomers, transformer => transformer.isApplicable(v));\n }\n findByName(name) {\n return this.transfomers[name];\n }\n}\n//# sourceMappingURL=custom-transformer-registry.js.map","const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);\nexport const isUndefined = (payload) => typeof payload === 'undefined';\nexport const isNull = (payload) => payload === null;\nexport const isPlainObject = (payload) => {\n if (typeof payload !== 'object' || payload === null)\n return false;\n if (payload === Object.prototype)\n return false;\n if (Object.getPrototypeOf(payload) === null)\n return true;\n return Object.getPrototypeOf(payload) === Object.prototype;\n};\nexport const isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;\nexport const isArray = (payload) => Array.isArray(payload);\nexport const isString = (payload) => typeof payload === 'string';\nexport const isNumber = (payload) => typeof payload === 'number' && !isNaN(payload);\nexport const isBoolean = (payload) => typeof payload === 'boolean';\nexport const isRegExp = (payload) => payload instanceof RegExp;\nexport const isMap = (payload) => payload instanceof Map;\nexport const isSet = (payload) => payload instanceof Set;\nexport const isSymbol = (payload) => getType(payload) === 'Symbol';\nexport const isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());\nexport const isError = (payload) => payload instanceof Error;\nexport const isNaNValue = (payload) => typeof payload === 'number' && isNaN(payload);\nexport const isPrimitive = (payload) => isBoolean(payload) ||\n isNull(payload) ||\n isUndefined(payload) ||\n isNumber(payload) ||\n isString(payload) ||\n isSymbol(payload);\nexport const isBigint = (payload) => typeof payload === 'bigint';\nexport const isInfinite = (payload) => payload === Infinity || payload === -Infinity;\nexport const isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);\nexport const isURL = (payload) => payload instanceof URL;\n//# sourceMappingURL=is.js.map","export const escapeKey = (key) => key.replace(/\\\\/g, '\\\\\\\\').replace(/\\./g, '\\\\.');\nexport const stringifyPath = (path) => path\n .map(String)\n .map(escapeKey)\n .join('.');\nexport const parsePath = (string, legacyPaths) => {\n const result = [];\n let segment = '';\n for (let i = 0; i < string.length; i++) {\n let char = string.charAt(i);\n if (!legacyPaths && char === '\\\\') {\n const escaped = string.charAt(i + 1);\n if (escaped === '\\\\') {\n segment += '\\\\';\n i++;\n continue;\n }\n else if (escaped !== '.') {\n throw Error('invalid path');\n }\n }\n const isEscapedDot = char === '\\\\' && string.charAt(i + 1) === '.';\n if (isEscapedDot) {\n segment += '.';\n i++;\n continue;\n }\n const isEndOfSegment = char === '.';\n if (isEndOfSegment) {\n result.push(segment);\n segment = '';\n continue;\n }\n segment += char;\n }\n const lastSegment = segment;\n result.push(lastSegment);\n return result;\n};\n//# sourceMappingURL=pathstringifier.js.map","import { isBigint, isDate, isInfinite, isMap, isNaNValue, isRegExp, isSet, isUndefined, isSymbol, isArray, isError, isTypedArray, isURL, } from './is.js';\nimport { findArr } from './util.js';\nfunction simpleTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable,\n annotation,\n transform,\n untransform,\n };\n}\nconst simpleRules = [\n simpleTransformation(isUndefined, 'undefined', () => null, () => undefined),\n simpleTransformation(isBigint, 'bigint', v => v.toString(), v => {\n if (typeof BigInt !== 'undefined') {\n return BigInt(v);\n }\n console.error('Please add a BigInt polyfill.');\n return v;\n }),\n simpleTransformation(isDate, 'Date', v => v.toISOString(), v => new Date(v)),\n simpleTransformation(isError, 'Error', (v, superJson) => {\n const baseError = {\n name: v.name,\n message: v.message,\n };\n if ('cause' in v) {\n baseError.cause = v.cause;\n }\n superJson.allowedErrorProps.forEach(prop => {\n baseError[prop] = v[prop];\n });\n return baseError;\n }, (v, superJson) => {\n const e = new Error(v.message, { cause: v.cause });\n e.name = v.name;\n e.stack = v.stack;\n superJson.allowedErrorProps.forEach(prop => {\n e[prop] = v[prop];\n });\n return e;\n }),\n simpleTransformation(isRegExp, 'regexp', v => '' + v, regex => {\n const body = regex.slice(1, regex.lastIndexOf('/'));\n const flags = regex.slice(regex.lastIndexOf('/') + 1);\n return new RegExp(body, flags);\n }),\n simpleTransformation(isSet, 'set', \n // (sets only exist in es6+)\n // eslint-disable-next-line es5/no-es6-methods\n v => [...v.values()], v => new Set(v)),\n simpleTransformation(isMap, 'map', v => [...v.entries()], v => new Map(v)),\n simpleTransformation((v) => isNaNValue(v) || isInfinite(v), 'number', v => {\n if (isNaNValue(v)) {\n return 'NaN';\n }\n if (v > 0) {\n return 'Infinity';\n }\n else {\n return '-Infinity';\n }\n }, Number),\n simpleTransformation((v) => v === 0 && 1 / v === -Infinity, 'number', () => {\n return '-0';\n }, Number),\n simpleTransformation(isURL, 'URL', v => v.toString(), v => new URL(v)),\n];\nfunction compositeTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable,\n annotation,\n transform,\n untransform,\n };\n}\nconst symbolRule = compositeTransformation((s, superJson) => {\n if (isSymbol(s)) {\n const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);\n return isRegistered;\n }\n return false;\n}, (s, superJson) => {\n const identifier = superJson.symbolRegistry.getIdentifier(s);\n return ['symbol', identifier];\n}, v => v.description, (_, a, superJson) => {\n const value = superJson.symbolRegistry.getValue(a[1]);\n if (!value) {\n throw new Error('Trying to deserialize unknown symbol');\n }\n return value;\n});\nconst constructorToName = [\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Uint8ClampedArray,\n].reduce((obj, ctor) => {\n obj[ctor.name] = ctor;\n return obj;\n}, {});\nconst typedArrayRule = compositeTransformation(isTypedArray, v => ['typed-array', v.constructor.name], v => [...v], (v, a) => {\n const ctor = constructorToName[a[1]];\n if (!ctor) {\n throw new Error('Trying to deserialize unknown typed array');\n }\n return new ctor(v);\n});\nexport function isInstanceOfRegisteredClass(potentialClass, superJson) {\n if (potentialClass?.constructor) {\n const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);\n return isRegistered;\n }\n return false;\n}\nconst classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {\n const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);\n return ['class', identifier];\n}, (clazz, superJson) => {\n const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);\n if (!allowedProps) {\n return { ...clazz };\n }\n const result = {};\n allowedProps.forEach(prop => {\n result[prop] = clazz[prop];\n });\n return result;\n}, (v, a, superJson) => {\n const clazz = superJson.classRegistry.getValue(a[1]);\n if (!clazz) {\n throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);\n }\n return Object.assign(Object.create(clazz.prototype), v);\n});\nconst customRule = compositeTransformation((value, superJson) => {\n return !!superJson.customTransformerRegistry.findApplicable(value);\n}, (value, superJson) => {\n const transformer = superJson.customTransformerRegistry.findApplicable(value);\n return ['custom', transformer.name];\n}, (value, superJson) => {\n const transformer = superJson.customTransformerRegistry.findApplicable(value);\n return transformer.serialize(value);\n}, (v, a, superJson) => {\n const transformer = superJson.customTransformerRegistry.findByName(a[1]);\n if (!transformer) {\n throw new Error('Trying to deserialize unknown custom value');\n }\n return transformer.deserialize(v);\n});\nconst compositeRules = [classRule, symbolRule, customRule, typedArrayRule];\nexport const transformValue = (value, superJson) => {\n const applicableCompositeRule = findArr(compositeRules, rule => rule.isApplicable(value, superJson));\n if (applicableCompositeRule) {\n return {\n value: applicableCompositeRule.transform(value, superJson),\n type: applicableCompositeRule.annotation(value, superJson),\n };\n }\n const applicableSimpleRule = findArr(simpleRules, rule => rule.isApplicable(value, superJson));\n if (applicableSimpleRule) {\n return {\n value: applicableSimpleRule.transform(value, superJson),\n type: applicableSimpleRule.annotation,\n };\n }\n return undefined;\n};\nconst simpleRulesByAnnotation = {};\nsimpleRules.forEach(rule => {\n simpleRulesByAnnotation[rule.annotation] = rule;\n});\nexport const untransformValue = (json, type, superJson) => {\n if (isArray(type)) {\n switch (type[0]) {\n case 'symbol':\n return symbolRule.untransform(json, type, superJson);\n case 'class':\n return classRule.untransform(json, type, superJson);\n case 'custom':\n return customRule.untransform(json, type, superJson);\n case 'typed-array':\n return typedArrayRule.untransform(json, type, superJson);\n default:\n throw new Error('Unknown transformation: ' + type);\n }\n }\n else {\n const transformation = simpleRulesByAnnotation[type];\n if (!transformation) {\n throw new Error('Unknown transformation: ' + type);\n }\n return transformation.untransform(json, superJson);\n }\n};\n//# sourceMappingURL=transformer.js.map","import { isMap, isArray, isPlainObject, isSet } from './is.js';\nimport { includes } from './util.js';\nconst getNthKey = (value, n) => {\n if (n > value.size)\n throw new Error('index out of bounds');\n const keys = value.keys();\n while (n > 0) {\n keys.next();\n n--;\n }\n return keys.next().value;\n};\nfunction validatePath(path) {\n if (includes(path, '__proto__')) {\n throw new Error('__proto__ is not allowed as a property');\n }\n if (includes(path, 'prototype')) {\n throw new Error('prototype is not allowed as a property');\n }\n if (includes(path, 'constructor')) {\n throw new Error('constructor is not allowed as a property');\n }\n}\nexport const getDeep = (object, path) => {\n validatePath(path);\n for (let i = 0; i < path.length; i++) {\n const key = path[i];\n if (isSet(object)) {\n object = getNthKey(object, +key);\n }\n else if (isMap(object)) {\n const row = +key;\n const type = +path[++i] === 0 ? 'key' : 'value';\n const keyOfRow = getNthKey(object, row);\n switch (type) {\n case 'key':\n object = keyOfRow;\n break;\n case 'value':\n object = object.get(keyOfRow);\n break;\n }\n }\n else {\n object = object[key];\n }\n }\n return object;\n};\nexport const setDeep = (object, path, mapper) => {\n validatePath(path);\n if (path.length === 0) {\n return mapper(object);\n }\n let parent = object;\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i];\n if (isArray(parent)) {\n const index = +key;\n parent = parent[index];\n }\n else if (isPlainObject(parent)) {\n parent = parent[key];\n }\n else if (isSet(parent)) {\n const row = +key;\n parent = getNthKey(parent, row);\n }\n else if (isMap(parent)) {\n const isEnd = i === path.length - 2;\n if (isEnd) {\n break;\n }\n const row = +key;\n const type = +path[++i] === 0 ? 'key' : 'value';\n const keyOfRow = getNthKey(parent, row);\n switch (type) {\n case 'key':\n parent = keyOfRow;\n break;\n case 'value':\n parent = parent.get(keyOfRow);\n break;\n }\n }\n }\n const lastKey = path[path.length - 1];\n if (isArray(parent)) {\n parent[+lastKey] = mapper(parent[+lastKey]);\n }\n else if (isPlainObject(parent)) {\n parent[lastKey] = mapper(parent[lastKey]);\n }\n if (isSet(parent)) {\n const oldValue = getNthKey(parent, +lastKey);\n const newValue = mapper(oldValue);\n if (oldValue !== newValue) {\n parent.delete(oldValue);\n parent.add(newValue);\n }\n }\n if (isMap(parent)) {\n const row = +path[path.length - 2];\n const keyToRow = getNthKey(parent, row);\n const type = +lastKey === 0 ? 'key' : 'value';\n switch (type) {\n case 'key': {\n const newKey = mapper(keyToRow);\n parent.set(newKey, parent.get(keyToRow));\n if (newKey !== keyToRow) {\n parent.delete(keyToRow);\n }\n break;\n }\n case 'value': {\n parent.set(keyToRow, mapper(parent.get(keyToRow)));\n break;\n }\n }\n }\n return object;\n};\n//# sourceMappingURL=accessDeep.js.map","import { isArray, isEmptyObject, isError, isMap, isPlainObject, isPrimitive, isSet, } from './is.js';\nimport { escapeKey, stringifyPath } from './pathstringifier.js';\nimport { isInstanceOfRegisteredClass, transformValue, untransformValue, } from './transformer.js';\nimport { includes, forEach } from './util.js';\nimport { parsePath } from './pathstringifier.js';\nimport { getDeep, setDeep } from './accessDeep.js';\nconst enableLegacyPaths = (version) => version < 1;\nfunction traverse(tree, walker, version, origin = []) {\n if (!tree) {\n return;\n }\n const legacyPaths = enableLegacyPaths(version);\n if (!isArray(tree)) {\n forEach(tree, (subtree, key) => traverse(subtree, walker, version, [\n ...origin,\n ...parsePath(key, legacyPaths),\n ]));\n return;\n }\n const [nodeValue, children] = tree;\n if (children) {\n forEach(children, (child, key) => {\n traverse(child, walker, version, [\n ...origin,\n ...parsePath(key, legacyPaths),\n ]);\n });\n }\n walker(nodeValue, origin);\n}\nexport function applyValueAnnotations(plain, annotations, version, superJson) {\n traverse(annotations, (type, path) => {\n plain = setDeep(plain, path, v => untransformValue(v, type, superJson));\n }, version);\n return plain;\n}\nexport function applyReferentialEqualityAnnotations(plain, annotations, version) {\n const legacyPaths = enableLegacyPaths(version);\n function apply(identicalPaths, path) {\n const object = getDeep(plain, parsePath(path, legacyPaths));\n identicalPaths\n .map(path => parsePath(path, legacyPaths))\n .forEach(identicalObjectPath => {\n plain = setDeep(plain, identicalObjectPath, () => object);\n });\n }\n if (isArray(annotations)) {\n const [root, other] = annotations;\n root.forEach(identicalPath => {\n plain = setDeep(plain, parsePath(identicalPath, legacyPaths), () => plain);\n });\n if (other) {\n forEach(other, apply);\n }\n }\n else {\n forEach(annotations, apply);\n }\n return plain;\n}\nconst isDeep = (object, superJson) => isPlainObject(object) ||\n isArray(object) ||\n isMap(object) ||\n isSet(object) ||\n isError(object) ||\n isInstanceOfRegisteredClass(object, superJson);\nfunction addIdentity(object, path, identities) {\n const existingSet = identities.get(object);\n if (existingSet) {\n existingSet.push(path);\n }\n else {\n identities.set(object, [path]);\n }\n}\nexport function generateReferentialEqualityAnnotations(identitites, dedupe) {\n const result = {};\n let rootEqualityPaths = undefined;\n identitites.forEach(paths => {\n if (paths.length <= 1) {\n return;\n }\n // if we're not deduping, all of these objects continue existing.\n // putting the shortest path first makes it easier to parse for humans\n // if we're deduping though, only the first entry will still exist, so we can't do this optimisation.\n if (!dedupe) {\n paths = paths\n .map(path => path.map(String))\n .sort((a, b) => a.length - b.length);\n }\n const [representativePath, ...identicalPaths] = paths;\n if (representativePath.length === 0) {\n rootEqualityPaths = identicalPaths.map(stringifyPath);\n }\n else {\n result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);\n }\n });\n if (rootEqualityPaths) {\n if (isEmptyObject(result)) {\n return [rootEqualityPaths];\n }\n else {\n return [rootEqualityPaths, result];\n }\n }\n else {\n return isEmptyObject(result) ? undefined : result;\n }\n}\nexport const walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = new Map()) => {\n const primitive = isPrimitive(object);\n if (!primitive) {\n addIdentity(object, path, identities);\n const seen = seenObjects.get(object);\n if (seen) {\n // short-circuit result if we've seen this object before\n return dedupe\n ? {\n transformedValue: null,\n }\n : seen;\n }\n }\n if (!isDeep(object, superJson)) {\n const transformed = transformValue(object, superJson);\n const result = transformed\n ? {\n transformedValue: transformed.value,\n annotations: [transformed.type],\n }\n : {\n transformedValue: object,\n };\n if (!primitive) {\n seenObjects.set(object, result);\n }\n return result;\n }\n if (includes(objectsInThisPath, object)) {\n // prevent circular references\n return {\n transformedValue: null,\n };\n }\n const transformationResult = transformValue(object, superJson);\n const transformed = transformationResult?.value ?? object;\n const transformedValue = isArray(transformed) ? [] : {};\n const innerAnnotations = {};\n forEach(transformed, (value, index) => {\n if (index === '__proto__' ||\n index === 'constructor' ||\n index === 'prototype') {\n throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);\n }\n const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);\n transformedValue[index] = recursiveResult.transformedValue;\n if (isArray(recursiveResult.annotations)) {\n innerAnnotations[escapeKey(index)] = recursiveResult.annotations;\n }\n else if (isPlainObject(recursiveResult.annotations)) {\n forEach(recursiveResult.annotations, (tree, key) => {\n innerAnnotations[escapeKey(index) + '.' + key] = tree;\n });\n }\n });\n const result = isEmptyObject(innerAnnotations)\n ? {\n transformedValue,\n annotations: !!transformationResult\n ? [transformationResult.type]\n : undefined,\n }\n : {\n transformedValue,\n annotations: !!transformationResult\n ? [transformationResult.type, innerAnnotations]\n : innerAnnotations,\n };\n if (!primitive) {\n seenObjects.set(object, result);\n }\n return result;\n};\n//# sourceMappingURL=plainer.js.map","/** Returns the object type of the given payload */\nexport function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n","import { getType } from './getType.js';\n/** Returns whether the payload is an array */\nexport function isArray(payload) {\n return getType(payload) === 'Array';\n}\n","import { getType } from './getType.js';\n/**\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects\n * with other prototypes)\n */\nexport function isPlainObject(payload) {\n if (getType(payload) !== 'Object')\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\n","import { isArray, isPlainObject } from 'is-what';\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\n const propType = {}.propertyIsEnumerable.call(originalObject, key)\n ? 'enumerable'\n : 'nonenumerable';\n if (propType === 'enumerable')\n carry[key] = newVal;\n if (includeNonenumerable && propType === 'nonenumerable') {\n Object.defineProperty(carry, key, {\n value: newVal,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n }\n}\n/**\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the\n * original object. Arrays are also cloned, however objects inside arrays are still linked.\n *\n * @param target Target can be anything\n * @param [options={}] See type {@link Options} for more details.\n *\n * - `{ props: ['key1'] }` will only copy the `key1` property. When using this you will need to cast\n * the return type manually (in order to keep the TS implementation in here simple I didn't\n * built a complex auto resolved type for those few cases people want to use this option)\n * - `{ nonenumerable: true }` will copy all non-enumerable properties. Default is `{}`\n *\n * @returns The target with replaced values\n */\nexport function copy(target, options = {}) {\n if (isArray(target)) {\n return target.map((item) => copy(item, options));\n }\n if (!isPlainObject(target)) {\n return target;\n }\n const props = Object.getOwnPropertyNames(target);\n const symbols = Object.getOwnPropertySymbols(target);\n return [...props, ...symbols].reduce((carry, key) => {\n // Skip __proto__ properties to prevent prototype pollution\n if (key === '__proto__')\n return carry;\n if (isArray(options.props) && !options.props.includes(key)) {\n return carry;\n }\n const val = target[key];\n const newVal = copy(val, options);\n assignProp(carry, key, newVal, target, options.nonenumerable);\n return carry;\n }, {});\n}\n","import { ClassRegistry } from './class-registry.js';\nimport { Registry } from './registry.js';\nimport { CustomTransformerRegistry, } from './custom-transformer-registry.js';\nimport { applyReferentialEqualityAnnotations, applyValueAnnotations, generateReferentialEqualityAnnotations, walker, } from './plainer.js';\nimport { copy } from 'copy-anything';\nclass SuperJSON {\n /**\n * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.\n */\n constructor({ dedupe = false, } = {}) {\n this.classRegistry = new ClassRegistry();\n this.symbolRegistry = new Registry(s => s.description ?? '');\n this.customTransformerRegistry = new CustomTransformerRegistry();\n this.allowedErrorProps = [];\n this.dedupe = dedupe;\n }\n serialize(object) {\n const identities = new Map();\n const output = walker(object, identities, this, this.dedupe);\n const res = {\n json: output.transformedValue,\n };\n if (output.annotations) {\n res.meta = {\n ...res.meta,\n values: output.annotations,\n };\n }\n const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);\n if (equalityAnnotations) {\n res.meta = {\n ...res.meta,\n referentialEqualities: equalityAnnotations,\n };\n }\n if (res.meta)\n res.meta.v = 1;\n return res;\n }\n deserialize(payload, options) {\n const { json, meta } = payload;\n let result = options?.inPlace ? json : copy(json);\n if (meta?.values) {\n result = applyValueAnnotations(result, meta.values, meta.v ?? 0, this);\n }\n if (meta?.referentialEqualities) {\n result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities, meta.v ?? 0);\n }\n return result;\n }\n stringify(object) {\n return JSON.stringify(this.serialize(object));\n }\n parse(string) {\n return this.deserialize(JSON.parse(string), { inPlace: true });\n }\n registerClass(v, options) {\n this.classRegistry.register(v, options);\n }\n registerSymbol(v, identifier) {\n this.symbolRegistry.register(v, identifier);\n }\n registerCustom(transformer, name) {\n this.customTransformerRegistry.register({\n name,\n ...transformer,\n });\n }\n allowErrorProps(...props) {\n this.allowedErrorProps.push(...props);\n }\n}\nSuperJSON.defaultInstance = new SuperJSON();\nSuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);\nSuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);\nSuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);\nSuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);\nSuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);\nSuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);\nSuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);\nSuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);\nexport default SuperJSON;\nexport { SuperJSON };\nexport const serialize = SuperJSON.serialize;\nexport const deserialize = SuperJSON.deserialize;\nexport const stringify = SuperJSON.stringify;\nexport const parse = SuperJSON.parse;\nexport const registerClass = SuperJSON.registerClass;\nexport const registerCustom = SuperJSON.registerCustom;\nexport const registerSymbol = SuperJSON.registerSymbol;\nexport const allowErrorProps = SuperJSON.allowErrorProps;\n//# sourceMappingURL=index.js.map","/**\n * System — single, unified entry point for the camstack client API.\n *\n * Devices are returned as typed `DeviceProxy` objects (auto-injecting\n * `deviceId` + `nodeId`), system caps are exposed as typed namespaces\n * (`system.userManagement`, `system.storage`, etc.), and live events\n * flow through a single `subscribeEvent` helper.\n *\n * The escape hatches (`trpcClient`, `wsClient`) are still public so the\n * ui-library Provider can seed React Query with the same WS connection\n * — a future phase will narrow the surface further.\n */\n\nimport {\n createTRPCClient,\n createWSClient,\n wsLink,\n httpLink,\n type TRPCClient,\n} from '@trpc/client'\nimport superjson from 'superjson'\nimport {\n SystemMirror,\n createSystemProxy,\n} from '@camstack/types'\nimport type {\n DeviceBinding,\n DeviceProxy,\n DeviceInfo,\n DeviceQueryFilters,\n DeviceLifecycleListener,\n SystemMirrorApi,\n SystemProxy,\n AddonApi,\n} from '@camstack/types'\nimport type { BackendAppRouter } from './backend-router.js'\nimport type { BackendConnectionState } from './types.js'\n\n// ─── Types ──────────────────────────────────────────────────────────\n\n/**\n * Canonical user-info shape returned by `getMe()`. Mirrors the server's\n * `auth.me` output — kept narrow so SDK consumers don't need the full\n * tRPC inference chain to type a login flow.\n */\nexport interface UserInfo {\n readonly id: string\n readonly username: string\n readonly isAdmin: boolean\n readonly permissions?: {\n readonly allowedAddons?: ReadonlyArray<string> | '*'\n readonly allowedDevices?: Readonly<Record<string, ReadonlyArray<string> | '*'>>\n }\n}\n\nexport interface SystemConfig {\n /** Backend server URL (e.g. \"http://localhost:4443\"). */\n readonly serverUrl: string\n /** JWT token for authentication. */\n readonly token?: string\n /** Use WebSocket transport (default: true in browser, false in Node). */\n readonly useWebSocket?: boolean\n /** Optional per-event connection-state callback. */\n readonly onConnectionChange?: (state: BackendConnectionState) => void\n /** Initial WS reconnect delay in ms (default 2000, capped via maxRetryDelayMs). */\n readonly retryDelayMs?: number\n /** Max WS reconnect delay in ms (default 30_000). */\n readonly maxRetryDelayMs?: number\n}\n\ntype ConnectionListener = (state: BackendConnectionState, version: number) => void\n\n// Dispatch shape for the live.onEvent subscription callback. The\n// underlying tRPC procedure pushes `{ id, timestamp, source, category,\n// data }` per event. Consumers usually only care about `data` typed\n// per-category; the SDK exposes the raw envelope so categories with\n// custom routing fields stay accessible.\nexport interface SystemLiveEvent<TData = unknown> {\n readonly id: string\n readonly timestamp: Date | string\n readonly source: { readonly type: string; readonly id: string | number }\n readonly category: string\n readonly data: TData\n}\n\nexport type SystemLiveEventListener<TData = unknown> = (event: SystemLiveEvent<TData>) => void\n\n// ─── Constants ──────────────────────────────────────────────────────\n\nconst WS_KEEP_ALIVE_INTERVAL_MS = 10_000\n// 6s (was 3s): a 3s pong window tripped \"server unreachable\" on any brief hub\n// event-loop hiccup under load. 6s tolerates a transient stall while still\n// detecting a real disconnect well within one keepalive interval.\nconst WS_KEEP_ALIVE_PONG_TIMEOUT_MS = 6_000\nconst WS_RECONNECT_RETRY_DELAY_MS = 2_000\nconst WS_RECONNECT_MAX_RETRY_DELAY_MS = 30_000\n\n// ─── Class ──────────────────────────────────────────────────────────\n\ntype TrpcClient = TRPCClient<BackendAppRouter>\ntype TrpcWsClient = ReturnType<typeof createWSClient>\n\nexport class System {\n /** Active server base URL. Mutable via `switchServerUrl()` so the\n * endpoint-race helper can pivot the transport onto a LAN candidate\n * after the initial public-URL bootstrap. */\n private _serverUrl: string\n private readonly useWs: boolean\n private readonly baseRetryMs: number\n private readonly maxRetryMs: number\n private readonly onConnectionChange: ((state: BackendConnectionState) => void) | undefined\n\n private token: string | undefined\n private _trpcClient: TrpcClient\n private _wsClient: TrpcWsClient | null = null\n\n // Mirror — owns binding cache + state mirror + lifecycle listeners.\n // Lazily initialised on `init()`. Subsequent `reconnect()` disposes\n // the old mirror and rebuilds against the new tRPC client.\n private mirror: SystemMirror | null = null\n private mirrorInit: Promise<void> | null = null\n\n // Transport-readiness probe state. `connected` flips true the first\n // time `auth.me` succeeds against the current tRPC client; resets\n // on every `reconnect()` / `close()` so the next consumer waits for\n // a fresh handshake before issuing queries.\n private connected = false\n private connectedPromise: Promise<void> | null = null\n\n // System-cap namespaces — populated in the constructor from\n // `createSystemProxy(api)`. Each namespace is a `Pick<InferProvider<typeof cap>, …>`\n // shape generated by `scripts/generate-system-proxy.ts`.\n private _systemProxy: SystemProxy\n\n // Connection-version + listener bookkeeping for the admin UI's\n // reconnect watchdog.\n private _connectionVersion = 0\n private readonly connectionListeners = new Set<ConnectionListener>()\n\n constructor(config: SystemConfig) {\n this._serverUrl = config.serverUrl.replace(/\\/+$/, '')\n this.token = config.token\n\n const isBrowser = typeof window !== 'undefined'\n this.useWs = config.useWebSocket ?? isBrowser\n this.onConnectionChange = config.onConnectionChange\n this.baseRetryMs = config.retryDelayMs ?? WS_RECONNECT_RETRY_DELAY_MS\n this.maxRetryMs = config.maxRetryDelayMs ?? WS_RECONNECT_MAX_RETRY_DELAY_MS\n\n this._trpcClient = this.buildTrpcClient()\n this._systemProxy = createSystemProxy(this._trpcClient as unknown as AddonApi)\n }\n\n // ── Connection state ─────────────────────────────────────────────\n\n /** Active server base URL (no trailing slash). */\n get serverUrl(): string {\n return this._serverUrl\n }\n\n get connectionVersion(): number {\n return this._connectionVersion\n }\n\n /**\n * Subscribe to connection-state transitions. Called with `('connected'\n * | 'disconnected' | 'connecting', version)` whenever the SDK opens,\n * closes, or starts a manual reconnect. Listener errors are swallowed\n * so a misbehaving consumer cannot break the SDK's event loop.\n */\n subscribeConnectionEvents(cb: ConnectionListener): () => void {\n this.connectionListeners.add(cb)\n return () => {\n this.connectionListeners.delete(cb)\n }\n }\n\n private emitConnectionEvent(state: BackendConnectionState): void {\n try {\n this.onConnectionChange?.(state)\n } catch {\n /* swallow caller errors */\n }\n for (const l of this.connectionListeners) {\n try {\n l(state, this._connectionVersion)\n } catch {\n /* swallow listener errors */\n }\n }\n }\n\n // ── Lifecycle ────────────────────────────────────────────────────\n\n /**\n * Wait until the underlying tRPC transport is connected AND the\n * server has responded to a cheap auth round-trip (`auth.me`). This\n * is the canonical \"ready to issue queries\" gate.\n *\n * Why a probe, not just `ws.readyState === OPEN`?\n * The WS handshake completes asynchronously: tRPC's `wsLink`\n * queues outgoing messages and only flushes them after `open()`\n * resolves (post `connectionParams` send). On the server, the\n * tRPC context is created lazily once the connectionParams\n * message is received. A query fired between WS-open and\n * connection-params-processed is technically queued by tRPC, but\n * the auth context for that query is only resolved once the\n * handshake message is decoded server-side. A probe round-trip is\n * the safest way to confirm both sides have agreed on the auth\n * identity before the React tree starts firing parallel queries\n * (which can otherwise land before any addon-side service\n * discovery has settled, returning empty results that get cached).\n *\n * Idempotent — concurrent callers await the same in-flight Promise.\n * Bounded by `timeoutMs` (default 15s) — beyond which a\n * `Error('System.awaitConnected: probe timed out after Xms')` is\n * thrown so the host can render a clear error state instead of\n * hanging on a bricked socket.\n */\n async awaitConnected(timeoutMs?: number): Promise<void> {\n if (this.connected) return\n if (this.connectedPromise) return this.connectedPromise\n const effectiveTimeoutMs = timeoutMs ?? 15_000\n this.connectedPromise = (async () => {\n const probe = this._trpcClient.auth.me.query()\n if (!Number.isFinite(effectiveTimeoutMs)) {\n await probe\n } else {\n await new Promise<void>((resolve, reject) => {\n const timer = setTimeout(\n () => reject(new Error(`System.awaitConnected: probe timed out after ${effectiveTimeoutMs}ms`)),\n effectiveTimeoutMs,\n )\n probe.then(\n () => { clearTimeout(timer); resolve() },\n (err: unknown) => { clearTimeout(timer); reject(err instanceof Error ? err : new Error(String(err))) },\n )\n })\n }\n this.connected = true\n })()\n try {\n await this.connectedPromise\n } finally {\n this.connectedPromise = null\n }\n }\n\n /**\n * Warm-boot the device mirror. Awaits the transport probe first\n * (`awaitConnected`) so the three mirror round-trips\n * (`getAllBindings` + `getAllSnapshots` + `listAll`) cannot race\n * against the WS auth handshake. Subsequent `getDevice(id)` calls\n * are sync; live `device.*` event subscriptions keep the caches\n * fresh.\n *\n * Idempotent — concurrent callers await the same in-flight Promise.\n */\n async init(timeoutMs?: number): Promise<void> {\n if (this.mirror?.isReady()) return\n if (this.mirrorInit) return this.mirrorInit\n const m = new SystemMirror(this._trpcClient as unknown as SystemMirrorApi)\n this.mirror = m\n this.mirrorInit = (async () => {\n await this.awaitConnected(timeoutMs)\n await m.init(timeoutMs)\n })().finally(() => {\n this.mirrorInit = null\n })\n return this.mirrorInit\n }\n\n /** Promise that resolves once `init()` has completed. */\n async awaitReady(): Promise<void> {\n if (this.mirror?.isReady()) return\n if (this.mirrorInit) return this.mirrorInit\n return this.init()\n }\n\n /** True after `init()` resolves. */\n isReady(): boolean {\n return this.mirror?.isReady() ?? false\n }\n\n /** True after the transport probe has succeeded at least once. */\n isConnected(): boolean {\n return this.connected\n }\n\n /**\n * Force a fresh WebSocket handshake. Tears down the wsClient + tRPC\n * client + mirror (the mirror captures the tRPC reference at\n * construction time and would otherwise dispatch through a closed\n * client) and rebuilds them. No-op for HTTP transport.\n */\n reconnect(): void {\n if (!this.useWs) return\n this.emitConnectionEvent('connecting')\n this._wsClient?.close()\n this.disposeMirror()\n this.connected = false\n this.connectedPromise = null\n this._trpcClient = this.buildTrpcClient()\n this._systemProxy = createSystemProxy(this._trpcClient as unknown as AddonApi)\n }\n\n /**\n * Pivot the underlying tRPC transport onto a different base URL.\n * Used by the endpoint-race flow: the SDK opens against the public\n * URL the operator provided, calls `localNetwork.getConnectionEndpoints`\n * to discover LAN candidates, races them, and (when a faster one wins)\n * calls `switchServerUrl(winner)` to migrate every subsequent query\n * onto the LAN path without losing auth state.\n *\n * Keeps the auth token. Tears down the WS + mirror and rebuilds them\n * against the new URL — same machinery as `reconnect()` but with a\n * different target.\n */\n switchServerUrl(nextUrl: string): void {\n const normalized = nextUrl.replace(/\\/+$/, '')\n if (normalized === this._serverUrl) return\n this._serverUrl = normalized\n this.reconnect()\n }\n\n /**\n * Race the candidate base URLs reported by the hub's `local-network`\n * cap, pick the fastest one that responds, and (if it's different\n * from the current URL) pivot the transport onto it.\n *\n * Flow:\n * 1. Query `localNetwork.getConnectionEndpoints({ port })` over the\n * already-authenticated tRPC channel — the cap is auth-gated,\n * so the LAN IPs never leak to anonymous callers.\n * 2. For each candidate, fire a HEAD on `{baseUrl}/trpc/health`\n * with a short timeout (default 1500ms). The first 2xx wins.\n * 3. If the winner differs from `this.serverUrl`, call\n * `switchServerUrl(winner)` and return it. Otherwise return\n * the current URL unchanged.\n *\n * Bounded — if every candidate times out we keep the current URL.\n * Idempotent — safe to call on every connect / reconnect / network\n * change event.\n */\n async raceConnectionEndpoints(options?: {\n /** Per-candidate probe timeout. Default 1500ms. */\n readonly perCandidateTimeoutMs?: number\n /** Skip IPv6 candidates. Default `false`. */\n readonly ipv4Only?: boolean\n }): Promise<{ winner: string; switched: boolean }> {\n const timeoutMs = options?.perCandidateTimeoutMs ?? 1500\n // Derive the port + scheme the SDK is currently using. Passing the\n // scheme to the cap means LAN URLs come back in the same scheme as\n // the page, sidestepping browser mixed-content blocks (HTTPS page\n // can't probe `http://` URLs).\n const url = (() => {\n try { return new URL(this._serverUrl) } catch { return null }\n })()\n const port = url?.port\n ? Number(url.port)\n : url?.protocol === 'https:' ? 443 : 80\n const scheme: 'http' | 'https' = url?.protocol === 'https:' ? 'https' : 'http'\n\n const proxy = this._trpcClient as unknown as {\n localNetwork?: { getConnectionEndpoints: { query: (input: { port: number; ipv4Only?: boolean; scheme?: 'http' | 'https' }) => Promise<{ endpoints: ReadonlyArray<{ baseUrl: string; priority: number; kind: string; label: string }> }> } }\n }\n const cap = proxy.localNetwork?.getConnectionEndpoints\n if (!cap) {\n return { winner: this._serverUrl, switched: false }\n }\n\n let endpoints: ReadonlyArray<{ baseUrl: string; priority: number; kind: string; label: string }>\n try {\n const res = await cap.query({ port, ipv4Only: options?.ipv4Only, scheme })\n endpoints = res.endpoints\n } catch {\n // Cap unavailable (older hub, network blip) — keep current URL.\n return { winner: this._serverUrl, switched: false }\n }\n\n if (endpoints.length === 0) {\n return { winner: this._serverUrl, switched: false }\n }\n\n const winner = await raceFastestEndpoint(endpoints.map((e) => e.baseUrl), timeoutMs)\n if (!winner || winner === this._serverUrl) {\n return { winner: winner ?? this._serverUrl, switched: false }\n }\n this.switchServerUrl(winner)\n return { winner, switched: true }\n }\n\n /** Tear down WS connection + mirror. The instance is unusable afterwards. */\n close(): void {\n this.disposeMirror()\n this.connected = false\n this.connectedPromise = null\n this._wsClient?.close()\n }\n\n private disposeMirror(): void {\n this.mirror?.dispose()\n this.mirror = null\n this.mirrorInit = null\n }\n\n // ── Auth ──────────────────────────────────────────────────────────\n\n async login(username: string, password: string): Promise<{ token: string; requiresTotp?: boolean }> {\n const result = await this._trpcClient.auth.login.mutate({ username, password })\n if (typeof result === 'object' && result !== null && 'token' in result) {\n const r = result as { token?: unknown; requiresTotp?: unknown }\n const token = r.token\n // Only persist when the server granted a real session. The\n // 2FA challenge token is short-lived bridge state and must\n // NOT be set as the active auth header — the second leg\n // (`loginVerifyTotp`) doesn't need auth, and a stray challenge\n // would expire while sitting in localStorage.\n if (typeof token === 'string' && r.requiresTotp !== true) this.setToken(token)\n }\n return result as { token: string; requiresTotp?: boolean }\n }\n\n /**\n * Second leg of the 2FA login. The caller passes the challenge\n * token returned by `login` (when `requiresTotp: true`) plus the\n * 6-digit code from the user's authenticator app. On success the\n * server mints the real session JWT, which we set as the active\n * token on this client.\n */\n async loginVerifyTotp(challengeToken: string, code: string): Promise<{ token: string }> {\n const result = await this._trpcClient.auth.loginVerifyTotp.mutate({ challengeToken, code })\n if (typeof result === 'object' && result !== null && 'token' in result) {\n const token = (result as { token?: unknown }).token\n if (typeof token === 'string') this.setToken(token)\n }\n return result as { token: string }\n }\n\n async logout(): Promise<void> {\n await this._trpcClient.auth.logout.mutate()\n }\n\n async getMe(): Promise<UserInfo> {\n const me = await this._trpcClient.auth.me.query()\n return me as UserInfo\n }\n\n // ── Self-service auth (the signed-in user acting on themselves) ─────\n //\n // The hand-written `auth.*` router exposes 5 procedures that operate\n // on `ctx.user` (the JWT-bound identity), distinct from the admin\n // `user-management` cap that operates on arbitrary userIds. They live\n // on `System` rather than as codegen'd hooks because `auth.*` is a\n // legacy core router, not a `.cap.ts` — see the no-restricted-imports\n // rule in `eslint.config.mjs` for the canonical entry-point design.\n\n async changeOwnPassword(input: { currentPassword: string; newPassword: string }): Promise<{ success: true }> {\n const result = await this._trpcClient.auth.changeOwnPassword.mutate(input)\n return result as { success: true }\n }\n\n async setupOwnTotp(): Promise<{ secret: string; otpauthUrl: string }> {\n const result = await this._trpcClient.auth.setupOwnTotp.mutate()\n return result as { secret: string; otpauthUrl: string }\n }\n\n async confirmOwnTotp(input: { code: string }): Promise<{ success: true }> {\n const result = await this._trpcClient.auth.confirmOwnTotp.mutate(input)\n return result as { success: true }\n }\n\n async disableOwnTotp(): Promise<{ success: true }> {\n const result = await this._trpcClient.auth.disableOwnTotp.mutate()\n return result as { success: true }\n }\n\n async getOwnTotpStatus(): Promise<{ enabled: boolean; confirmedAt: number | null }> {\n const result = await this._trpcClient.auth.getOwnTotpStatus.query()\n return result as { enabled: boolean; confirmedAt: number | null }\n }\n\n /** Update the auth token (e.g. after login or token refresh). */\n setToken(token: string): void {\n this.token = token\n }\n\n // ── Devices ──────────────────────────────────────────────────────\n\n /**\n * Synchronous snapshot of every device matching the optional filters.\n * Backed by the `SystemMirror` warm-boot cache — call `init()` first\n * (or `awaitReady()`) before invoking. Returns an empty array if the\n * mirror has not yet been booted.\n *\n * Each returned proxy has `binding` populated from the mirror's\n * binding cache (Phase 5 dedup), so consumers no longer need to\n * make a separate `deviceManager.getBindings` round-trip.\n */\n listDevices(filters?: DeviceQueryFilters): readonly DeviceProxy[] {\n if (!this.mirror) return []\n const proxies = filters ? this.mirror.query(filters) : this.mirror.getAllDevices()\n return proxies.map((p) => this.attachBinding(p))\n }\n\n /**\n * Sync `DeviceInfo` snapshot (name, canonical type, online, …) for one device\n * from the warm-boot mirror — `null` if the mirror isn't booted or the device\n * is unknown. Unlike a `DeviceProxy` (cap accessors only), this carries the\n * display identity the UI needs to render a device on first paint.\n */\n getDeviceInfo(deviceId: number): DeviceInfo | null {\n return this.mirror?.getDeviceInfo(deviceId) ?? null\n }\n\n /**\n * The `DeviceInfo` snapshots for the current device set (the warm-boot cache),\n * honouring the same `filters` as {@link listDevices}. Lets a UI render a named\n * device list immediately without waiting for per-device lifecycle events.\n */\n listDeviceInfos(filters?: DeviceQueryFilters): readonly DeviceInfo[] {\n const mirror = this.mirror\n if (!mirror) return []\n const proxies = filters ? mirror.query(filters) : mirror.getAllDevices()\n const out: DeviceInfo[] = []\n for (const p of proxies) {\n const info = mirror.getDeviceInfo(p.deviceId)\n if (info) out.push(info)\n }\n return out\n }\n\n /**\n * Sync lookup by numeric id. `null` if the mirror has not been booted\n * or the device is unknown.\n */\n getDevice(deviceId: number): DeviceProxy | null {\n const proxy = this.mirror?.getDeviceById(deviceId) ?? null\n return proxy ? this.attachBinding(proxy) : null\n }\n\n /** Sync lookup by display name (exact match). */\n getDeviceByName(name: string): DeviceProxy | null {\n const proxy = this.mirror?.getDeviceByName(name) ?? null\n return proxy ? this.attachBinding(proxy) : null\n }\n\n /** Sync lookup by stableId. */\n getDeviceByStableId(stableId: string): DeviceProxy | null {\n const proxy = this.mirror?.getDeviceByStableId(stableId) ?? null\n return proxy ? this.attachBinding(proxy) : null\n }\n\n /**\n * Resolve when a device with `deviceId` becomes available. Resolves\n * immediately if already known; rejects with a timeout error\n * otherwise (default 30s).\n */\n async waitForDevice(deviceId: number, timeoutMs?: number): Promise<DeviceProxy> {\n if (!this.mirror) await this.init()\n const proxy = await this.mirror!.waitForDevice(deviceId, timeoutMs ?? 30_000)\n return this.attachBinding(proxy)\n }\n\n /** Subscribe to `device.registered` events. */\n onDeviceAdded(cb: DeviceLifecycleListener): () => void {\n if (!this.mirror) {\n // Mirror not ready yet — buffer the listener until init() runs.\n // The cleanest path is to require init() first; throw a clear\n // error so callers don't silently miss the first events.\n throw new Error('System.onDeviceAdded: call init() before subscribing')\n }\n return this.mirror.onDeviceAdded(cb)\n }\n\n /** Subscribe to `device.unregistered` events. */\n onDeviceRemoved(cb: DeviceLifecycleListener): () => void {\n if (!this.mirror) {\n throw new Error('System.onDeviceRemoved: call init() before subscribing')\n }\n return this.mirror.onDeviceRemoved(cb)\n }\n\n /**\n * Patch the proxy's `binding` field from the mirror's cache. The\n * generated `createDeviceProxy()` already sets `binding` to the\n * binding it was constructed with — this is a defensive overwrite\n * that uses the latest cached entry in case a `binding-changed`\n * event landed between proxy creation and access.\n */\n private attachBinding(proxy: DeviceProxy): DeviceProxy {\n const binding = this.lookupBinding(proxy.deviceId)\n if (binding === proxy.binding) return proxy\n const writable = proxy as { binding: DeviceBinding | null }\n writable.binding = binding\n return proxy\n }\n\n /** Fetch the latest cached binding from the mirror, or `null`. */\n private lookupBinding(deviceId: number): DeviceBinding | null {\n if (!this.mirror) return null\n // Mirror exposes bindings via the proxy itself — read it back\n // through `getDeviceById` so we don't have to widen the public\n // SystemMirror surface just for the cache lookup.\n const proxy = this.mirror.getDeviceById(deviceId)\n return proxy?.binding ?? null\n }\n\n // ── System caps ──────────────────────────────────────────────────\n //\n // One getter per `scope: 'system'` capability. The actual surface\n // comes from `createSystemProxy(api)` (codegen). Adding a new\n // system cap regenerates the proxy and the new namespace surfaces\n // automatically via `system.<newCap>.<method>(input)`.\n\n get addonPages(): SystemProxy['addonPages'] { return this._systemProxy.addonPages }\n get addonSettings(): SystemProxy['addonSettings'] { return this._systemProxy.addonSettings }\n get alerts(): SystemProxy['alerts'] { return this._systemProxy.alerts }\n get audioAnalyzer(): SystemProxy['audioAnalyzer'] { return this._systemProxy.audioAnalyzer }\n get audioCodec(): SystemProxy['audioCodec'] { return this._systemProxy.audioCodec }\n get backup(): SystemProxy['backup'] { return this._systemProxy.backup }\n get decoder(): SystemProxy['decoder'] { return this._systemProxy.decoder }\n get deviceManager(): SystemProxy['deviceManager'] { return this._systemProxy.deviceManager }\n get deviceProvider(): SystemProxy['deviceProvider'] { return this._systemProxy.deviceProvider }\n get deviceState(): SystemProxy['deviceState'] { return this._systemProxy.deviceState }\n get metricsProvider(): SystemProxy['metricsProvider'] { return this._systemProxy.metricsProvider }\n get notificationOutput(): SystemProxy['notificationOutput'] { return this._systemProxy.notificationOutput }\n get pipelineExecutor(): SystemProxy['pipelineExecutor'] { return this._systemProxy.pipelineExecutor }\n get pipelineOrchestrator(): SystemProxy['pipelineOrchestrator'] { return this._systemProxy.pipelineOrchestrator }\n get pipelineRunner(): SystemProxy['pipelineRunner'] { return this._systemProxy.pipelineRunner }\n // `platform-probe` is infra (addon-to-addon via `api.platformProbe`), not a\n // client-facing system cap — it isn't on SystemProxy, so no getter here.\n get settingsStore(): SystemProxy['settingsStore'] { return this._systemProxy.settingsStore }\n get storage(): SystemProxy['storage'] { return this._systemProxy.storage }\n get streamBroker(): SystemProxy['streamBroker'] { return this._systemProxy.streamBroker }\n get turnProvider(): SystemProxy['turnProvider'] { return this._systemProxy.turnProvider }\n get userManagement(): SystemProxy['userManagement'] { return this._systemProxy.userManagement }\n\n // ── Live events ──────────────────────────────────────────────────\n\n /**\n * Subscribe to a single event category. Returns an unsubscribe\n * handle. Errors thrown by the listener are swallowed so a single\n * misbehaving consumer cannot tear down the WS subscription.\n *\n * Categories should be values from the `EventCategory` enum\n * (`@camstack/types`) — passing a raw string works for forward-compat\n * but loses type safety. The SDK forwards the value verbatim to the\n * server's `live.onEvent` subscription.\n */\n subscribeEvent<TData = unknown>(\n category: string,\n cb: SystemLiveEventListener<TData>,\n ): () => void {\n const sub = this._trpcClient.live.onEvent.subscribe(\n { category },\n {\n onData: (event) => {\n try {\n cb(event as unknown as SystemLiveEvent<TData>)\n } catch {\n /* swallow listener errors */\n }\n },\n },\n )\n return () => {\n try {\n sub.unsubscribe()\n } catch {\n /* swallow — already unsubscribed */\n }\n }\n }\n\n // ── Escape hatches ───────────────────────────────────────────────\n //\n // Kept public so the ui-library `<TrpcProvider>` can seed React\n // Query with the same WebSocket connection during Phase 2. Phase 4\n // is expected to revisit whether either field can be hidden.\n\n /** Direct tRPC client. Read once per call; rebuilt on `reconnect()`. */\n get trpcClient(): TrpcClient {\n return this._trpcClient\n }\n\n /**\n * Underlying WSClient (or `null` for HTTP transport). Used by\n * advanced consumers that need direct access to the WebSocket\n * (e.g. for keep-alive metrics). Rebuilt on `reconnect()`.\n */\n get wsClient(): TrpcWsClient | null {\n return this._wsClient\n }\n\n // ── Internals ────────────────────────────────────────────────────\n\n private buildTrpcClient(): TrpcClient {\n const headers = (): Record<string, string> => {\n const h: Record<string, string> = {}\n if (this.token) h['Authorization'] = `Bearer ${this.token}`\n return h\n }\n\n if (this.useWs) {\n const wsUrl = this._serverUrl.replace(/^http/, 'ws') + '/trpc'\n const baseRetryMs = this.baseRetryMs\n const maxRetryMs = this.maxRetryMs\n this._wsClient = createWSClient({\n url: wsUrl,\n connectionParams: () => ({ token: this.token }),\n retryDelayMs: (attemptIndex: number) =>\n Math.min(baseRetryMs * Math.pow(2, attemptIndex), maxRetryMs),\n keepAlive: {\n enabled: true,\n intervalMs: WS_KEEP_ALIVE_INTERVAL_MS,\n pongTimeoutMs: WS_KEEP_ALIVE_PONG_TIMEOUT_MS,\n },\n onOpen: () => {\n this._connectionVersion += 1\n this.emitConnectionEvent('connected')\n },\n onClose: () => {\n this.emitConnectionEvent('disconnected')\n },\n })\n\n return createTRPCClient<BackendAppRouter>({\n links: [wsLink({ client: this._wsClient, transformer: superjson })],\n })\n }\n\n this._wsClient = null\n return createTRPCClient<BackendAppRouter>({\n links: [httpLink({ url: `${this._serverUrl}/trpc`, headers, transformer: superjson })],\n })\n }\n}\n\n/** Create a `System` instance. Convenience factory. */\nexport function createSystem(config: SystemConfig): System {\n return new System(config)\n}\n\n/**\n * Race a list of candidate base URLs and return the first one that\n * responds to `GET {baseUrl}/trpc/health` with a 2xx within\n * `timeoutMs`. Returns `null` if every candidate fails / times out.\n *\n * Implementation notes:\n * - Uses `fetch` with `AbortController` for per-candidate cutoff so a\n * stalled candidate doesn't pin the wallclock for the whole race.\n * - Cancels every still-pending probe as soon as the first one\n * succeeds — no wasted bandwidth on the loser candidates.\n * - `/trpc/health` is the only endpoint guaranteed to respond on every\n * CamStack deployment (registered alongside the tRPC plugin). It is\n * intentionally NOT auth-gated since it's used by load balancers /\n * uptime probes — same surface every reverse proxy already monitors.\n * - HEAD would be nicer but Cloudflare Tunnel + some browsers\n * mishandle HEAD on the ingress path; GET is safer.\n *\n * Exported so non-System callers (CLI helpers, tests) can race their\n * own candidate lists without instantiating a full System.\n */\nexport async function raceFastestEndpoint(\n candidates: ReadonlyArray<string>,\n timeoutMs: number,\n): Promise<string | null> {\n if (candidates.length === 0) return null\n if (typeof fetch !== 'function') return candidates[0] ?? null\n\n // Defense in depth: when running in a browser loaded over HTTPS, the\n // browser blocks every `http://` request as mixed content. Filter\n // those out before probing so we don't waste timeouts on candidates\n // that would have been rejected anyway. The cap is supposed to emit\n // matching-scheme URLs given `scheme: 'https'` — this guard catches\n // any leftover http candidates from older hubs / misconfigured\n // proxies.\n const pageIsHttps = typeof window !== 'undefined'\n && typeof window.location !== 'undefined'\n && window.location.protocol === 'https:'\n const reachable = pageIsHttps\n ? candidates.filter((u) => u.toLowerCase().startsWith('https://'))\n : candidates\n if (reachable.length === 0) return null\n\n const controllers = reachable.map(() => new AbortController())\n const probes = reachable.map(async (baseUrl, i) => {\n const ctrl = controllers[i]!\n const timer = setTimeout(() => ctrl.abort(), timeoutMs)\n try {\n const res = await fetch(`${baseUrl.replace(/\\/+$/, '')}/trpc/health`, {\n method: 'GET',\n signal: ctrl.signal,\n // Cross-origin probes from a browser sandbox are fine — the\n // /trpc/health response is open-CORS by the Fastify default.\n // No credentials needed (this is a transport-quality probe,\n // not an auth round-trip).\n credentials: 'omit',\n })\n if (!res.ok) throw new Error(`${res.status}`)\n return baseUrl\n } finally {\n clearTimeout(timer)\n }\n })\n\n // `Promise.any` returns the first fulfilled — exactly what we want.\n try {\n const winner = await Promise.any(probes)\n // Cancel every other in-flight probe.\n for (const c of controllers) {\n try { c.abort() } catch { /* already settled */ }\n }\n return winner\n } catch {\n return null\n }\n}\n","/**\n * Detection classes — shared between CamStack app and proxy.\n * Aligned with scrypted-advanced-notifier/src/detectionClasses.ts.\n */\n\n// ---------------------------------------------------------------------------\n// Enum — matches the plugin enum exactly\n// ---------------------------------------------------------------------------\n\nexport enum DetectionClass {\n Motion = \"motion\",\n Person = \"person\",\n Vehicle = \"vehicle\",\n Animal = \"animal\",\n Audio = \"audio\",\n Face = \"face\",\n Plate = \"plate\",\n Package = \"package\",\n Doorbell = \"doorbell\",\n Sensor = \"sensor\",\n}\n\n// ---------------------------------------------------------------------------\n// Sub-class arrays (for classname → parent mapping)\n// ---------------------------------------------------------------------------\n\nexport const animalClasses = [\n DetectionClass.Animal,\n \"dog_cat\", \"dog\", \"cat\", \"horse\", \"sheep\", \"cow\", \"elephant\", \"bear\",\n \"zebra\", \"giraffe\", \"mouse\", \"rabbit\", \"deer\", \"lion\", \"tiger\",\n \"bird\", \"eagle\", \"owl\", \"pigeon\",\n \"fish\", \"whale\", \"dolphin\",\n \"snake\", \"turtle\", \"lizard\",\n];\n\nexport const personClasses = [\n DetectionClass.Person,\n \"people\", \"pedestrian\", \"rider\", \"driver\", \"cyclist\", \"skier\", \"skateboarder\",\n \"face\", \"hand\", \"head\", \"body\",\n];\n\nexport const vehicleClasses = [\n DetectionClass.Vehicle,\n \"car\", \"truck\", \"bus\", \"motorcycle\", \"bicycle\", \"van\",\n \"ambulance\", \"police_car\", \"fire_truck\",\n \"train\", \"subway\", \"tram\",\n \"airplane\", \"boat\", \"ship\", \"helicopter\",\n];\n\nexport const faceClasses = [\n DetectionClass.Face,\n \"eyes\", \"nose\", \"mouth\", \"ears\", \"eyebrows\",\n \"left_eye\", \"right_eye\", \"pupil\", \"iris\", \"eyelid\", \"eye_corner\",\n \"upper_lip\", \"lower_lip\", \"teeth\",\n \"chin\", \"cheek\", \"forehead\", \"jaw\",\n \"glasses\", \"sunglasses\", \"facial_hair\", \"beard\", \"mustache\",\n \"facial_landmark\", \"facial_keypoint\",\n];\n\nexport const licensePlateClasses = [\n DetectionClass.Plate,\n \"license_plate\", \"front_plate\", \"rear_plate\", \"motorcycle_plate\",\n \"temporary_plate\", \"dealer_plate\", \"licensePlate\",\n \"plate_number\", \"plate_character\", \"plate_digit\", \"plate_letter\",\n \"plate_symbol\", \"plate_region\", \"plate_country_identifier\",\n \"plate_frame\", \"plate_bolt\", \"plate_sticker\", \"plate_validation_tag\",\n \"damaged_plate\", \"obscured_plate\", \"dirty_plate\",\n];\n\nexport const motionClasses = [DetectionClass.Motion, \"movement\", \"other\"];\n\nexport const packageClasses = [DetectionClass.Package, \"packet\"];\n\nexport const audioClasses: string[] = [DetectionClass.Audio];\n\n/** Common YAMNet audio labels (advanced-notifier). Parent: Audio. */\nexport const audioLabelClasses = [\n \"speech\", \"scream\", \"babbling\", \"yell\", \"bellow\", \"whoop\", \"whispering\", \"laughter\", \"snicker\",\n \"crying\", \"cry\", \"sigh\", \"singing\", \"choir\", \"chant\", \"mantra\", \"child_singing\", \"rapping\", \"humming\",\n \"groan\", \"grunt\", \"whistling\", \"breathing\", \"wheeze\", \"snoring\", \"gasp\", \"pant\", \"snort\", \"cough\",\n \"throat_clearing\", \"sneeze\", \"sniff\", \"cheering\", \"applause\", \"chatter\", \"crowd\", \"children_playing\",\n \"bark\", \"yip\", \"howl\", \"bow-wow\", \"growling\", \"whimper_dog\", \"purr\", \"meow\", \"hiss\", \"caterwaul\",\n \"pets\", \"livestock\", \"doorbell\", \"ding-dong\", \"door\", \"slam\", \"knock\", \"alarm\", \"telephone\",\n \"music\", \"dog\", \"dogs\",\n];\n\nexport const doorbellClasses = [DetectionClass.Doorbell, \"ring\"];\n\n/** Sensor types (advanced-notifier SupportedSensorType). Parent: Sensor. */\nexport const sensorLabelClasses = [\n \"lock\", \"binary\", \"flood\", \"entry\",\n \"door\", \"leak\", \"door_open\", \"flooded\", \"entry_open\",\n];\n\n// ---------------------------------------------------------------------------\n// Classname → parent DetectionClass map\n// ---------------------------------------------------------------------------\n\nexport const detectionClassesDefaultMap: Record<string, DetectionClass> = {\n ...animalClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Animal }), {}),\n ...personClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Person }), {}),\n ...vehicleClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Vehicle }), {}),\n ...motionClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Motion }), {}),\n ...packageClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Package }), {}),\n ...faceClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Face }), {}),\n ...licensePlateClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Plate }), {}),\n ...audioClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Audio }), {}),\n ...audioLabelClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Audio }), {}),\n ...doorbellClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Doorbell }), {}),\n ...sensorLabelClasses.reduce<Record<string, DetectionClass>>((tot, curr) => ({ ...tot, [curr]: DetectionClass.Sensor }), {}),\n};\n\n// ---------------------------------------------------------------------------\n// Classifier helpers\n// ---------------------------------------------------------------------------\n\nexport const isFaceClassname = (c: string) => faceClasses.includes(c);\nexport const isPlateClassname = (c: string) => licensePlateClasses.includes(c);\nexport const isAnimalClassname = (c: string) => animalClasses.includes(c);\nexport const isPersonClassname = (c: string) => personClasses.includes(c);\nexport const isVehicleClassname = (c: string) => vehicleClasses.includes(c);\nexport const isMotionClassname = (c: string) => motionClasses.includes(c);\nexport const isDoorbellClassname = (c: string) => doorbellClasses.includes(c);\nexport const isPackageClassname = (c: string) => packageClasses.includes(c);\nexport const isAudioClassname = (c: string) =>\n audioClasses.includes(c) || audioLabelClasses.includes(c);\nexport const isSensorLabelClassname = (c: string) => sensorLabelClasses.includes(c);\nexport const isLabelDetection = (c: string) => isFaceClassname(c) || isPlateClassname(c);\n\nexport const getParentClass = (className: string): DetectionClass | undefined =>\n detectionClassesDefaultMap[className];\n\nexport const getParentDetectionClass = (det: { label?: string; className: string }) => {\n const { className } = det;\n const baseMap: Record<string, DetectionClass> = {\n [DetectionClass.Face]: DetectionClass.Person,\n [DetectionClass.Plate]: DetectionClass.Vehicle,\n };\n const parentGroup = detectionClassesDefaultMap[className];\n if (parentGroup && parentGroup !== className) return parentGroup;\n return baseMap[className];\n};\n\n// ---------------------------------------------------------------------------\n// All detection classes (enum values) used in filter UI\n// ---------------------------------------------------------------------------\n\nexport const defaultDetectionClasses = Object.values(DetectionClass);\n\n/** Default enabled classes: all except Motion. */\nexport const DEFAULT_ENABLED_CLASSES = defaultDetectionClasses.filter(\n (c) => c !== DetectionClass.Motion,\n);\n\n// ---------------------------------------------------------------------------\n// Timeline event presets (by severity)\n// ---------------------------------------------------------------------------\n\nexport type TimelineEventPreset = \"all\" | \"important\" | \"critical\" | \"custom\";\n\n/** Classes for \"critical\" preset: security-relevant only (person, doorbell, package). */\nexport const TIMELINE_PRESET_CRITICAL: string[] = [\n DetectionClass.Person,\n DetectionClass.Doorbell,\n DetectionClass.Package,\n];\n\n/** Classes for \"important\" preset: critical + vehicle, animal, audio, face, plate. */\nexport const TIMELINE_PRESET_IMPORTANT: string[] = [\n ...TIMELINE_PRESET_CRITICAL,\n DetectionClass.Vehicle,\n DetectionClass.Animal,\n DetectionClass.Audio,\n DetectionClass.Face,\n DetectionClass.Plate,\n];\n\n/** Classes for \"all\" preset: same as DEFAULT_ENABLED_CLASSES. */\nexport const TIMELINE_PRESET_ALL: string[] = [...DEFAULT_ENABLED_CLASSES];\n\n/** Get enabled classes for a preset. For \"custom\", pass customClasses. */\nexport function getClassesForTimelinePreset(\n preset: TimelineEventPreset,\n customClasses?: string[]\n): string[] {\n switch (preset) {\n case \"critical\":\n return TIMELINE_PRESET_CRITICAL;\n case \"important\":\n return TIMELINE_PRESET_IMPORTANT;\n case \"all\":\n return TIMELINE_PRESET_ALL;\n case \"custom\":\n return customClasses?.length ? customClasses : DEFAULT_ENABLED_CLASSES;\n default:\n return DEFAULT_ENABLED_CLASSES;\n }\n}\n","/**\n * Device types, mappings, and filtering constants — shared between CamStack app and proxy.\n *\n * Covers:\n * - Canonical device type normalization (Scrypted PascalCase + HA domains → canonical)\n * - Eligible device type lists for Scrypted and Home Assistant\n * - Unified Device / DeviceCommand / CommandResult interfaces\n * - AssociatedDeviceState shape\n */\n\n// ---------------------------------------------------------------------------\n// Canonical device type\n// ---------------------------------------------------------------------------\n\nexport type CanonicalDeviceType =\n | \"light\"\n | \"switch\"\n | \"cover\"\n | \"lock\"\n | \"alarm\"\n | \"button\"\n | \"select\"\n | \"siren\"\n | \"sensor\"\n | \"entry\"\n | \"media_player\"\n | \"script\";\n\n// ---------------------------------------------------------------------------\n// Raw type → canonical mapping (Scrypted + Home Assistant)\n// ---------------------------------------------------------------------------\n\n/**\n * Maps raw device types from Scrypted (PascalCase) and Home Assistant (lowercase domains)\n * to canonical CamStack device types.\n */\nexport const RAW_TO_CANONICAL: Record<string, CanonicalDeviceType> = {\n // Scrypted PascalCase\n Light: \"light\",\n Switch: \"switch\",\n WindowCovering: \"cover\",\n Lock: \"lock\",\n SecuritySystem: \"alarm\",\n Buttons: \"button\",\n Select: \"select\",\n Siren: \"siren\",\n Sensor: \"sensor\",\n Entry: \"entry\",\n Program: \"script\",\n MediaPlayer: \"media_player\",\n Outlet: \"switch\",\n // Home Assistant lowercase domains\n light: \"light\",\n switch: \"switch\",\n input_boolean: \"switch\",\n cover: \"cover\",\n lock: \"lock\",\n alarm_control_panel: \"alarm\",\n input_button: \"button\",\n button: \"button\",\n input_select: \"select\",\n select: \"select\",\n siren: \"siren\",\n sensor: \"sensor\",\n media_player: \"media_player\",\n script: \"script\",\n};\n\n/**\n * Extended HA domain → type map (includes non-eligible domains for display/categorization).\n * Superset of RAW_TO_CANONICAL for HA-specific domains.\n */\nexport const HA_DOMAIN_TYPE_MAP: Record<string, string> = {\n light: \"light\",\n switch: \"switch\",\n input_boolean: \"switch\",\n cover: \"cover\",\n lock: \"lock\",\n alarm_control_panel: \"alarm\",\n input_button: \"button\",\n button: \"button\",\n input_select: \"select\",\n select: \"select\",\n siren: \"siren\",\n sensor: \"sensor\",\n binary_sensor: \"sensor\",\n media_player: \"media_player\",\n script: \"script\",\n climate: \"climate\",\n camera: \"camera\",\n fan: \"fan\",\n vacuum: \"vacuum\",\n automation: \"automation\",\n scene: \"scene\",\n input_number: \"sensor\",\n person: \"person\",\n device_tracker: \"tracker\",\n weather: \"weather\",\n water_heater: \"climate\",\n};\n\n/**\n * Extended Scrypted type → canonical map (includes non-eligible types for display).\n * Superset of RAW_TO_CANONICAL for Scrypted-specific types.\n */\nexport const SCRYPTED_TYPE_TO_CANONICAL: Record<string, string> = {\n Light: \"light\",\n Switch: \"switch\",\n WindowCovering: \"cover\",\n Lock: \"lock\",\n SecuritySystem: \"alarm\",\n Buttons: \"button\",\n Select: \"select\",\n Siren: \"siren\",\n Sensor: \"sensor\",\n Entry: \"entry\",\n Program: \"script\",\n MediaPlayer: \"media_player\",\n Camera: \"camera\",\n Doorbell: \"doorbell\",\n Fan: \"fan\",\n Outlet: \"switch\",\n};\n\n/** Normalize raw type (Scrypted or HA) to canonical key for filtering and display. */\nexport function getCanonicalDeviceType(rawType: string): CanonicalDeviceType | null {\n const canonical = RAW_TO_CANONICAL[rawType];\n if (canonical) return canonical;\n const lower = rawType.toLowerCase();\n return RAW_TO_CANONICAL[lower] ?? null;\n}\n\n// ---------------------------------------------------------------------------\n// Eligible device types (filter lists)\n// ---------------------------------------------------------------------------\n\n/** Scrypted device types eligible for device control in CamStack. PascalCase. */\nexport const ELIGIBLE_SCRYPTED_DEVICE_TYPES = [\n \"Entry\",\n \"Light\",\n \"Switch\",\n \"Lock\",\n \"SecuritySystem\",\n \"Buttons\",\n \"WindowCovering\",\n \"Siren\",\n \"Sensor\",\n \"Select\",\n \"Program\",\n] as const;\n\n/** Set version for O(1) lookup. */\nexport const ELIGIBLE_SCRYPTED_DEVICE_TYPES_SET = new Set<string>(ELIGIBLE_SCRYPTED_DEVICE_TYPES);\n\n/** Home Assistant domains eligible for device control in CamStack. */\nexport const ELIGIBLE_HA_DOMAINS = [\n \"light\",\n \"switch\",\n \"input_boolean\",\n \"cover\",\n \"lock\",\n \"alarm_control_panel\",\n \"input_button\",\n \"button\",\n \"input_select\",\n \"select\",\n \"siren\",\n \"media_player\",\n \"script\",\n] as const;\n\n/** Set version for O(1) lookup. */\nexport const ELIGIBLE_HA_DOMAINS_SET = new Set<string>(ELIGIBLE_HA_DOMAINS);\n\n// ---------------------------------------------------------------------------\n// Device command action type\n// ---------------------------------------------------------------------------\n\n/** All device command actions supported by CamStack. */\nexport type DeviceCommandAction =\n | \"turnOn\"\n | \"turnOff\"\n | \"openEntry\"\n | \"closeEntry\"\n | \"stopEntry\"\n | \"lock\"\n | \"unlock\"\n | \"disarm\"\n | \"arm\"\n | \"pressButton\"\n | \"selectOption\"\n | \"volumeUp\"\n | \"volumeDown\"\n | \"volumeMute\";\n\n// ---------------------------------------------------------------------------\n// Associated device state (unified shape)\n// ---------------------------------------------------------------------------\n\n/**\n * State snapshot shape for an associated device.\n * Used by both app (AssociatedDeviceStateSnapshot) and proxy (Device.state).\n */\nexport interface AssociatedDeviceState {\n name?: string;\n type?: string;\n interfaces?: string[];\n on?: boolean;\n hasBrightnessControl?: boolean;\n brightness?: number;\n lockState?: string;\n securitySystemState?: { mode?: string; supportedModes?: string[] };\n buttons?: string[];\n entryOpen?: boolean | \"jammed\";\n value?: string;\n options?: string[];\n volumeLevel?: number;\n isVolumeMuted?: boolean;\n coverSupportsStop?: boolean;\n coverPosition?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Device interfaces (from proxy integrations/types.ts)\n// ---------------------------------------------------------------------------\n\n/** A device from an automation system (Scrypted, Home Assistant, etc.). */\nexport interface Device {\n id: string;\n name: string;\n /**\n * Canonical device type (lowercase): \"light\", \"switch\", \"cover\", \"lock\",\n * \"alarm\", \"button\", \"select\", \"siren\", \"sensor\", \"entry\", \"media_player\",\n * \"script\", \"camera\", \"nvr\".\n */\n type: string;\n /** Original type from the source system (e.g. Scrypted \"WindowCovering\", HA domain \"cover\"). */\n rawType?: string;\n /** Provider that owns this device. */\n providerId?: string;\n model?: string;\n manufacturer?: string;\n firmware?: string;\n online: boolean;\n interfaces: string[];\n /** Current state (key-value pairs, device-type-dependent). See AssociatedDeviceState. */\n state: Record<string, unknown>;\n /** Available actions for this device (defined by the provider). */\n actions?: DeviceAction[];\n /** Child devices (e.g. NVR → camera channels). */\n children?: Device[];\n}\n\n/** A command to send to a device. */\nexport interface DeviceCommand {\n deviceId: string;\n command: string;\n params?: Record<string, unknown>;\n}\n\n/** Result of a command execution. */\nexport interface CommandResult {\n success: boolean;\n error?: string;\n state?: Record<string, unknown>;\n}\n\n/** Device source type (integration that provides the device). */\nexport type AssociatedDeviceSource = \"scrypted\" | \"ha\";\n\n/** Eligible device summary (for device picker UI). */\nexport interface EligibleDevice {\n id: string;\n name: string;\n type: string;\n source: AssociatedDeviceSource;\n}\n\n// ─── Device Actions (provider-defined) ──────────────────────────\n\n/**\n * An action that can be performed on a device.\n * Actions are declared by the provider and rendered dynamically in the UI.\n */\nexport interface DeviceAction {\n /** Unique action ID (e.g. \"toggle\", \"setBrightness\", \"ptzMove\", \"reboot\"). */\n id: string;\n /** Display label (e.g. \"Toggle\", \"Set Brightness\", \"Move Camera\"). */\n label: string;\n /** Action category for UI grouping. */\n category?: \"power\" | \"control\" | \"ptz\" | \"media\" | \"system\" | \"custom\";\n /** Icon hint (lucide icon name or emoji). */\n icon?: string;\n /** Parameters this action accepts. */\n params?: DeviceActionParam[];\n /** Whether this action is destructive (shown with warning). */\n destructive?: boolean;\n}\n\n/** A parameter for a device action. */\nexport interface DeviceActionParam {\n /** Parameter key. */\n key: string;\n /** Display label. */\n label: string;\n /** Type for UI rendering. */\n type: \"boolean\" | \"number\" | \"string\" | \"select\" | \"slider\";\n /** Default value. */\n default?: unknown;\n /** For select type: available options. */\n options?: { value: string; label: string }[];\n /** For slider/number: min/max/step. */\n min?: number;\n max?: number;\n step?: number;\n}\n","/**\n * Feature capability matrix — shared between CamStack app and proxy.\n *\n * Maps each app feature to:\n * - Which source types (Frigate, Scrypted, RTSP) support it\n * - Which platforms (iOS, Android, Web, Scrypted embed) it works on\n * - Whether the camstack-server backend is required\n * - The ICameraSource method that enables the feature\n */\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type FeatureId =\n | \"liveStream\"\n | \"multiResolution\"\n | \"motion\"\n | \"objectDetection\"\n | \"audioVolume\"\n | \"audioVolumes\"\n | \"ptz\"\n | \"intercom\"\n | \"deviceStatus\"\n | \"timeline\"\n | \"clusteredTimeline\"\n | \"detectionClasses\"\n | \"videoClips\"\n | \"nvrPlayback\"\n | \"nvrScrub\"\n | \"recordingThumbnail\"\n | \"nvrSeekToLive\";\n\nexport type PlatformId = \"ios\" | \"android\" | \"web\" | \"scryptedEmbed\";\n\nexport type SourceType = \"frigate\" | \"scrypted\" | \"rtsp\";\n\nexport interface FeatureEntry {\n id: FeatureId;\n label: string;\n /** Which source types support this feature. */\n sources: Partial<Record<SourceType, boolean>>;\n /** Platform availability overrides. When omitted, all platforms are supported. */\n platforms?: Partial<Record<PlatformId, boolean>>;\n /** True when this feature needs the camstack-server backend. */\n requiresBackend?: boolean;\n /** The ICameraSource method name that enables this feature at runtime. */\n adapterMethod?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Matrix\n// ---------------------------------------------------------------------------\n\nexport const FEATURE_MATRIX: FeatureEntry[] = [\n {\n id: \"liveStream\",\n label: \"Live Stream\",\n sources: { frigate: true, scrypted: true, rtsp: true },\n adapterMethod: \"getLiveStream\",\n },\n {\n id: \"multiResolution\",\n label: \"Multi-Resolution\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n adapterMethod: \"getResolutions\",\n },\n {\n id: \"motion\",\n label: \"Motion Detection\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getMotion\",\n },\n {\n id: \"objectDetection\",\n label: \"Object Detection\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getObjectDetections\",\n },\n {\n id: \"audioVolume\",\n label: \"Audio Level\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getAudioVolume\",\n },\n {\n id: \"audioVolumes\",\n label: \"Audio Volumes (dBFS)\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getAudioVolumes\",\n },\n {\n id: \"ptz\",\n label: \"PTZ Control\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getPTZ\",\n },\n {\n id: \"intercom\",\n label: \"Intercom (Mic)\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getIntercomSupport\",\n },\n {\n id: \"deviceStatus\",\n label: \"Device Status\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"getStatus\",\n },\n {\n id: \"timeline\",\n label: \"Detection Timeline\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n adapterMethod: \"getCameraDayData\",\n },\n {\n id: \"clusteredTimeline\",\n label: \"Clustered Timeline\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n requiresBackend: true,\n adapterMethod: \"getClusteredDayData\",\n },\n {\n id: \"detectionClasses\",\n label: \"Detection Classes\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n adapterMethod: \"getDetectionClasses\",\n },\n {\n id: \"videoClips\",\n label: \"Video Clips\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n adapterMethod: \"getVideoClips\",\n },\n {\n id: \"nvrPlayback\",\n label: \"NVR Playback\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n adapterMethod: \"getNvrPlaybackSupported\",\n },\n {\n id: \"nvrScrub\",\n label: \"NVR Scrub/Seek\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"seekRecordingStream\",\n },\n {\n id: \"recordingThumbnail\",\n label: \"Recording Thumbnails\",\n sources: { frigate: true, scrypted: true, rtsp: false },\n adapterMethod: \"getRecordingStreamThumbnail\",\n },\n {\n id: \"nvrSeekToLive\",\n label: \"Seek to Live\",\n sources: { frigate: false, scrypted: true, rtsp: false },\n adapterMethod: \"seekNvrToLive\",\n },\n];\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Check if a feature is available for a given source type and platform. */\nexport function isFeatureAvailable(\n featureId: FeatureId,\n source: SourceType,\n platform: PlatformId,\n): boolean {\n const entry = FEATURE_MATRIX.find((f) => f.id === featureId);\n if (!entry) return false;\n if (!entry.sources[source]) return false;\n if (entry.platforms && entry.platforms[platform] === false) return false;\n return true;\n}\n\n/** Get all features supported by a source type. */\nexport function getSourceFeatures(source: SourceType): FeatureEntry[] {\n return FEATURE_MATRIX.filter((f) => f.sources[source]);\n}\n\n/** Get all features that require the backend proxy. */\nexport function getBackendRequiredFeatures(): FeatureEntry[] {\n return FEATURE_MATRIX.filter((f) => f.requiresBackend);\n}\n"],"names":["getType","isPlainObject","isArray","walker","path","transformed","result","superjson","DetectionClass"],"mappings":";;AAAO,MAAM,gBAAgB;AAAA,EACzB,cAAc;AACV,SAAK,aAAa,oBAAI,IAAG;AACzB,SAAK,aAAa,oBAAI,IAAG;AAAA,EAC7B;AAAA,EACA,IAAI,KAAK,OAAO;AACZ,SAAK,WAAW,IAAI,KAAK,KAAK;AAC9B,SAAK,WAAW,IAAI,OAAO,GAAG;AAAA,EAClC;AAAA,EACA,SAAS,KAAK;AACV,WAAO,KAAK,WAAW,IAAI,GAAG;AAAA,EAClC;AAAA,EACA,WAAW,OAAO;AACd,WAAO,KAAK,WAAW,IAAI,KAAK;AAAA,EACpC;AAAA,EACA,QAAQ;AACJ,SAAK,WAAW,MAAK;AACrB,SAAK,WAAW,MAAK;AAAA,EACzB;AACJ;AClBO,MAAM,SAAS;AAAA,EAClB,YAAY,oBAAoB;AAC5B,SAAK,qBAAqB;AAC1B,SAAK,KAAK,IAAI,gBAAe;AAAA,EACjC;AAAA,EACA,SAAS,OAAO,YAAY;AACxB,QAAI,KAAK,GAAG,WAAW,KAAK,GAAG;AAC3B;AAAA,IACJ;AACA,QAAI,CAAC,YAAY;AACb,mBAAa,KAAK,mBAAmB,KAAK;AAAA,IAC9C;AACA,SAAK,GAAG,IAAI,YAAY,KAAK;AAAA,EACjC;AAAA,EACA,QAAQ;AACJ,SAAK,GAAG,MAAK;AAAA,EACjB;AAAA,EACA,cAAc,OAAO;AACjB,WAAO,KAAK,GAAG,WAAW,KAAK;AAAA,EACnC;AAAA,EACA,SAAS,YAAY;AACjB,WAAO,KAAK,GAAG,SAAS,UAAU;AAAA,EACtC;AACJ;ACvBO,MAAM,sBAAsB,SAAS;AAAA,EACxC,cAAc;AACV,UAAM,OAAK,EAAE,IAAI;AACjB,SAAK,sBAAsB,oBAAI,IAAG;AAAA,EACtC;AAAA,EACA,SAAS,OAAO,SAAS;AACrB,QAAI,OAAO,YAAY,UAAU;AAC7B,UAAI,QAAQ,YAAY;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