@camstack/server 1.2.877 → 1.2.879
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/api/trpc/generated-cap-mounts.js +2 -1
- package/dist/api/trpc/generated-cap-routers.js +308 -256
- package/package.json +8 -9
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +4 -4
- package/system/dist/builtins/composer/composer.addon.mjs +4 -4
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/actions-store.d.ts +2 -0
- package/system/dist/builtins/core-blocks/core-block-store.d.ts +6 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +3 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +410 -9
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +410 -9
- package/system/dist/builtins/core-blocks/record-kinds.d.ts +11 -1
- package/system/dist/builtins/core-blocks/scheduler/scheduler-store.d.ts +6 -0
- package/system/dist/builtins/core-blocks/tags-service.d.ts +50 -0
- package/system/dist/builtins/core-blocks/tags-wiring.d.ts +16 -0
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +59 -5
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +59 -5
- package/system/dist/builtins/device-manager/device-meta-actions.d.ts +6 -0
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +2 -0
- package/system/dist/builtins/device-manager/device-row-store.d.ts +1 -0
- package/system/dist/builtins/device-manager/device-template/template-grammar.d.ts +15 -1
- package/system/dist/builtins/device-manager/device-template/template-protocol.d.ts +8 -0
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-2V8c4s3c.js → capture-engine-DAGmlBmJ.js} +1 -1
- package/system/dist/{capture-engine-DQTpQ2x7.mjs → capture-engine-vlouhBCY.mjs} +1 -1
- package/system/dist/{composition-sources-De2-fnz1.js → composition-sources-Rm8xDXjA.js} +1 -1
- package/system/dist/{composition-sources-DjQfZJXB.mjs → composition-sources-TeHa4THk.mjs} +1 -1
- package/system/dist/{constants-CXQ72oX8.mjs → constants-Bq1Xl_Ku.mjs} +1 -1
- package/system/dist/{constants-BpNC8zLo.js → constants-DnUpXvIY.js} +1 -1
- package/system/dist/{device-ca-pvid0fx9.js → device-ca-DMudhY-2.js} +1 -1
- package/system/dist/{device-ca-DnZEQKUX.mjs → device-ca-yHLgyutP.mjs} +1 -1
- package/system/dist/device-template-worker.js +26 -3
- package/system/dist/device-template-worker.mjs +26 -3
- package/system/dist/{dist-BghIT0F5.js → dist-Bh5JIimH.js} +1700 -1178
- package/system/dist/{dist-CcfanEqn.mjs → dist-DemZNuSJ.mjs} +1647 -1179
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-B5pg6urK.mjs → hub-identity-BxaJKDQk.mjs} +1 -1
- package/system/dist/{hub-identity-B74cag6Q.js → hub-identity-YfGdAaBm.js} +1 -1
- package/system/dist/{hub-mdns-ciao-8bwCOLeJ.js → hub-mdns-ciao-BkWOmG6H.js} +2 -2
- package/system/dist/{hub-mdns-ciao-Db9RuUVf.mjs → hub-mdns-ciao-aIsTpo0F.mjs} +2 -2
- package/system/dist/index.js +8 -8
- package/system/dist/index.mjs +8 -8
- package/system/dist/{legacy-integration-rows-door-DlZ8ad2x.js → legacy-integration-rows-door-C9PZZiKH.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-XBECnCQb.mjs → legacy-integration-rows-door-DrfZZHWq.mjs} +1 -1
- package/system/dist/{rename-composition-block-BWGfsb6q.mjs → rename-composition-block-C2KFIOMP.mjs} +1 -1
- package/system/dist/{rename-composition-block-CQnWc7-b.js → rename-composition-block-Qp1dW4FP.js} +1 -1
- package/system/dist/{restore-archive-CI7Ejrq9.js → restore-archive-DGgj7aqA.js} +1 -1
- package/system/dist/{restore-archive-DsfZbucU.mjs → restore-archive-waz532L0.mjs} +82 -82
- package/system/dist/{template-protocol-DRZ4cm95.js → template-protocol-D5ogm1rj.js} +8 -44
- package/system/dist/{template-protocol-D_6uVHKs.mjs → template-protocol-SgPDx3Hw.mjs} +8 -44
- package/system/dist/{wal-maintenance-Dl4QOdNz.mjs → wal-maintenance-BuiSFfF2.mjs} +0 -0
- package/system/dist/{wal-maintenance-WAuRngNc.js → wal-maintenance-DD8mfRDn.js} +0 -0
- package/system/package.json +4 -1
|
@@ -1274,7 +1274,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1274
1274
|
*/
|
|
1275
1275
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
1276
1276
|
//#endregion
|
|
1277
|
-
//#region ../types/dist/sleep-
|
|
1277
|
+
//#region ../types/dist/sleep-C9EWTQr9.mjs
|
|
1278
1278
|
/**
|
|
1279
1279
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1280
1280
|
* window to float samples (D455).
|
|
@@ -15580,6 +15580,10 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
15580
15580
|
scope: "system",
|
|
15581
15581
|
notOperatorFacing: "cluster administration — nodes, server package, metrics"
|
|
15582
15582
|
},
|
|
15583
|
+
"tags": {
|
|
15584
|
+
scope: "system",
|
|
15585
|
+
notOperatorFacing: "tags are managed from the tag picker and the tags manager, not actuated"
|
|
15586
|
+
},
|
|
15583
15587
|
"template": {
|
|
15584
15588
|
scope: "system",
|
|
15585
15589
|
notOperatorFacing: "operator-authored templates — edited in their own editor, never actuated"
|
|
@@ -16323,6 +16327,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
16323
16327
|
"stream-signals",
|
|
16324
16328
|
"switch",
|
|
16325
16329
|
"system",
|
|
16330
|
+
"tags",
|
|
16326
16331
|
"tamper",
|
|
16327
16332
|
"temperature-sensor",
|
|
16328
16333
|
"template",
|
|
@@ -21879,6 +21884,293 @@ function unitsForDimension(dimension) {
|
|
|
21879
21884
|
return out;
|
|
21880
21885
|
}
|
|
21881
21886
|
//#endregion
|
|
21887
|
+
//#region ../types/dist/device-template-catalogue.mjs
|
|
21888
|
+
/**
|
|
21889
|
+
* The one catalogue of what a device template may name (D1021, D1029).
|
|
21890
|
+
*
|
|
21891
|
+
* Filters, the `range` global and the reserved names (`now`, `camera`, the
|
|
21892
|
+
* caller's recognition values) are listed here. The grammar's allow-list and
|
|
21893
|
+
* argument caps are derived from this module; nothing else keeps a second list.
|
|
21894
|
+
* The renderer imports this module through the
|
|
21895
|
+
* `@camstack/types/device-template-catalogue` subpath, never the types barrel
|
|
21896
|
+
* (D453), and sends the derived caps to the worker. The worker does not import it.
|
|
21897
|
+
*/
|
|
21898
|
+
var DEVICE_TEMPLATE_CATALOGUE_KINDS = [
|
|
21899
|
+
"filter",
|
|
21900
|
+
"global",
|
|
21901
|
+
"variable"
|
|
21902
|
+
];
|
|
21903
|
+
var DEVICE_TEMPLATE_CATALOGUE_CATEGORIES = [
|
|
21904
|
+
"number",
|
|
21905
|
+
"unit",
|
|
21906
|
+
"text",
|
|
21907
|
+
"state",
|
|
21908
|
+
"time",
|
|
21909
|
+
"fallback",
|
|
21910
|
+
"loop",
|
|
21911
|
+
"variable"
|
|
21912
|
+
];
|
|
21913
|
+
var deviceTemplateParamSchema = z.object({
|
|
21914
|
+
name: z.string().min(1),
|
|
21915
|
+
type: z.enum([
|
|
21916
|
+
"string",
|
|
21917
|
+
"number",
|
|
21918
|
+
"boolean"
|
|
21919
|
+
]),
|
|
21920
|
+
optional: z.boolean(),
|
|
21921
|
+
default: z.union([
|
|
21922
|
+
z.string(),
|
|
21923
|
+
z.number(),
|
|
21924
|
+
z.boolean()
|
|
21925
|
+
]).optional()
|
|
21926
|
+
});
|
|
21927
|
+
z.object({
|
|
21928
|
+
name: z.string().min(1),
|
|
21929
|
+
kind: z.enum(DEVICE_TEMPLATE_CATALOGUE_KINDS),
|
|
21930
|
+
category: z.enum(DEVICE_TEMPLATE_CATALOGUE_CATEGORIES),
|
|
21931
|
+
params: z.array(deviceTemplateParamSchema),
|
|
21932
|
+
descriptionKey: z.string().min(1),
|
|
21933
|
+
exampleKey: z.string().min(1)
|
|
21934
|
+
});
|
|
21935
|
+
function param(name, type, optional, fallback) {
|
|
21936
|
+
return fallback === void 0 ? {
|
|
21937
|
+
name,
|
|
21938
|
+
type,
|
|
21939
|
+
optional
|
|
21940
|
+
} : {
|
|
21941
|
+
name,
|
|
21942
|
+
type,
|
|
21943
|
+
optional,
|
|
21944
|
+
default: fallback
|
|
21945
|
+
};
|
|
21946
|
+
}
|
|
21947
|
+
function entry(name, kind, category, params) {
|
|
21948
|
+
return {
|
|
21949
|
+
name,
|
|
21950
|
+
kind,
|
|
21951
|
+
category,
|
|
21952
|
+
params: [...params],
|
|
21953
|
+
descriptionKey: `uiLibrary.deviceTemplateCatalogue.${name}.description`,
|
|
21954
|
+
exampleKey: `uiLibrary.deviceTemplateCatalogue.${name}.example`
|
|
21955
|
+
};
|
|
21956
|
+
}
|
|
21957
|
+
var DIGITS = param("digits", "number", true, 0);
|
|
21958
|
+
var FALLBACK_TEXT = param("fallback", "string", false);
|
|
21959
|
+
var FALSY = param("falsy", "boolean", true, false);
|
|
21960
|
+
/** Every name the engine allows, in the order operators meet them. */
|
|
21961
|
+
var DEVICE_TEMPLATE_CATALOGUE = [
|
|
21962
|
+
entry("unit", "filter", "unit", [param("symbol", "string", false), param("from", "string", true)]),
|
|
21963
|
+
entry("round", "filter", "number", [DIGITS]),
|
|
21964
|
+
entry("trunc", "filter", "number", [DIGITS]),
|
|
21965
|
+
entry("onoff", "filter", "state", []),
|
|
21966
|
+
entry("default", "filter", "fallback", [FALLBACK_TEXT, FALSY]),
|
|
21967
|
+
entry("since", "filter", "time", []),
|
|
21968
|
+
entry("ago", "filter", "time", []),
|
|
21969
|
+
entry("format", "filter", "text", [param("pattern", "string", false)]),
|
|
21970
|
+
entry("upper", "filter", "text", []),
|
|
21971
|
+
entry("lower", "filter", "text", []),
|
|
21972
|
+
entry("title", "filter", "text", []),
|
|
21973
|
+
entry("capitalize", "filter", "text", []),
|
|
21974
|
+
entry("trim", "filter", "text", []),
|
|
21975
|
+
entry("abs", "filter", "number", []),
|
|
21976
|
+
entry("int", "filter", "number", [param("fallback", "number", true, 0)]),
|
|
21977
|
+
entry("float", "filter", "number", [param("fallback", "number", true, 0)]),
|
|
21978
|
+
entry("length", "filter", "text", []),
|
|
21979
|
+
entry("d", "filter", "fallback", [FALLBACK_TEXT, FALSY]),
|
|
21980
|
+
entry("join", "filter", "text", [param("separator", "string", true, "")]),
|
|
21981
|
+
entry("replace", "filter", "text", [
|
|
21982
|
+
param("old", "string", false),
|
|
21983
|
+
param("new", "string", false),
|
|
21984
|
+
param("count", "number", true)
|
|
21985
|
+
]),
|
|
21986
|
+
entry("first", "filter", "loop", []),
|
|
21987
|
+
entry("last", "filter", "loop", []),
|
|
21988
|
+
entry("sort", "filter", "loop", [param("reverse", "boolean", true, false), param("caseSensitive", "boolean", true, false)]),
|
|
21989
|
+
entry("reverse", "filter", "loop", []),
|
|
21990
|
+
entry("sum", "filter", "number", []),
|
|
21991
|
+
entry("string", "filter", "text", []),
|
|
21992
|
+
entry("list", "filter", "loop", []),
|
|
21993
|
+
entry("truncate", "filter", "text", [
|
|
21994
|
+
param("length", "number", false),
|
|
21995
|
+
param("killwords", "boolean", true, false),
|
|
21996
|
+
param("end", "string", true, "…")
|
|
21997
|
+
]),
|
|
21998
|
+
entry("time", "filter", "time", [param("pattern", "string", false)]),
|
|
21999
|
+
entry("range", "global", "loop", [
|
|
22000
|
+
param("stop", "number", false),
|
|
22001
|
+
param("start", "number", true, 0),
|
|
22002
|
+
param("step", "number", true, 1)
|
|
22003
|
+
]),
|
|
22004
|
+
entry("now", "variable", "time", []),
|
|
22005
|
+
entry("camera", "variable", "variable", []),
|
|
22006
|
+
entry("loop", "variable", "loop", []),
|
|
22007
|
+
entry("lastPerson", "variable", "variable", []),
|
|
22008
|
+
entry("lastPlate", "variable", "variable", [])
|
|
22009
|
+
];
|
|
22010
|
+
var COPY = {
|
|
22011
|
+
unit: {
|
|
22012
|
+
description: ["Converts a number from the field’s base unit and prints the symbol.", "Converte un numero dall’unità di base del campo e stampa il simbolo."],
|
|
22013
|
+
example: ["{{ garage.temperature | unit('°C') }}", "{{ garage.temperature | unit('°C') }}"]
|
|
22014
|
+
},
|
|
22015
|
+
round: {
|
|
22016
|
+
description: ["Rounds a number to the given decimals.", "Arrotonda un numero ai decimali indicati."],
|
|
22017
|
+
example: ["{{ garage.temperature | round(1) }}", "{{ garage.temperature | round(1) }}"]
|
|
22018
|
+
},
|
|
22019
|
+
trunc: {
|
|
22020
|
+
description: ["Cuts decimals toward zero, without rounding.", "Taglia i decimali verso zero, senza arrotondare."],
|
|
22021
|
+
example: ["{{ garage.temperature | trunc(1) }}", "{{ garage.temperature | trunc(1) }}"]
|
|
22022
|
+
},
|
|
22023
|
+
onoff: {
|
|
22024
|
+
description: ["Prints a boolean as ON or OFF.", "Stampa un sì/no come ON oppure OFF."],
|
|
22025
|
+
example: ["{{ garage.switch | onoff }}", "{{ garage.switch | onoff }}"]
|
|
22026
|
+
},
|
|
22027
|
+
default: {
|
|
22028
|
+
description: ["Replaces a missing value. The second argument also replaces a false or zero.", "Sostituisce un valore assente. Il secondo argomento sostituisce anche falso o zero."],
|
|
22029
|
+
example: ["{{ camera.lastPerson | default('') }}", "{{ camera.lastPerson | default('') }}"]
|
|
22030
|
+
},
|
|
22031
|
+
since: {
|
|
22032
|
+
description: ["How long ago a timestamp was, as “5 min”.", "Quanto tempo fa era un istante, come «5 min»."],
|
|
22033
|
+
example: ["{{ garage.updated | since }}", "{{ garage.updated | since }}"]
|
|
22034
|
+
},
|
|
22035
|
+
ago: {
|
|
22036
|
+
description: ["The same duration as since, followed by “ago”.", "La stessa durata di since, seguita da «ago»."],
|
|
22037
|
+
example: ["{{ garage.updated | ago }}", "{{ garage.updated | ago }}"]
|
|
22038
|
+
},
|
|
22039
|
+
format: {
|
|
22040
|
+
description: ["Prints one value with a single %s, %d or %.Nf placeholder.", "Stampa un valore con un solo segnaposto %s, %d o %.Nf."],
|
|
22041
|
+
example: ["{{ garage.temperature | format('%.1f') }}", "{{ garage.temperature | format('%.1f') }}"]
|
|
22042
|
+
},
|
|
22043
|
+
upper: {
|
|
22044
|
+
description: ["Uppercase text.", "Testo in maiuscolo."],
|
|
22045
|
+
example: ["{{ camera.lastPerson | upper }}", "{{ camera.lastPerson | upper }}"]
|
|
22046
|
+
},
|
|
22047
|
+
lower: {
|
|
22048
|
+
description: ["Lowercase text.", "Testo in minuscolo."],
|
|
22049
|
+
example: ["{{ camera.lastPlate | lower }}", "{{ camera.lastPlate | lower }}"]
|
|
22050
|
+
},
|
|
22051
|
+
title: {
|
|
22052
|
+
description: ["Capitalises each word.", "Mette la maiuscola a ogni parola."],
|
|
22053
|
+
example: ["{{ camera.lastPerson | title }}", "{{ camera.lastPerson | title }}"]
|
|
22054
|
+
},
|
|
22055
|
+
capitalize: {
|
|
22056
|
+
description: ["Capitalises the first letter.", "Mette la maiuscola alla prima lettera."],
|
|
22057
|
+
example: ["{{ camera.lastPerson | capitalize }}", "{{ camera.lastPerson | capitalize }}"]
|
|
22058
|
+
},
|
|
22059
|
+
trim: {
|
|
22060
|
+
description: ["Removes spaces at both ends.", "Toglie gli spazi alle estremità."],
|
|
22061
|
+
example: ["{{ camera.lastPerson | trim }}", "{{ camera.lastPerson | trim }}"]
|
|
22062
|
+
},
|
|
22063
|
+
abs: {
|
|
22064
|
+
description: ["The absolute value of a number.", "Il valore assoluto di un numero."],
|
|
22065
|
+
example: ["{{ garage.power | abs }}", "{{ garage.power | abs }}"]
|
|
22066
|
+
},
|
|
22067
|
+
int: {
|
|
22068
|
+
description: ["The whole part of a number.", "La parte intera di un numero."],
|
|
22069
|
+
example: ["{{ garage.temperature | int }}", "{{ garage.temperature | int }}"]
|
|
22070
|
+
},
|
|
22071
|
+
float: {
|
|
22072
|
+
description: ["Reads the value as a decimal number.", "Legge il valore come numero decimale."],
|
|
22073
|
+
example: ["{{ garage.temperature | float }}", "{{ garage.temperature | float }}"]
|
|
22074
|
+
},
|
|
22075
|
+
length: {
|
|
22076
|
+
description: ["How many characters or items.", "Quanti caratteri o elementi."],
|
|
22077
|
+
example: ["{{ camera.lastPerson | length }}", "{{ camera.lastPerson | length }}"]
|
|
22078
|
+
},
|
|
22079
|
+
d: {
|
|
22080
|
+
description: ["The short name of default.", "Il nome breve di default."],
|
|
22081
|
+
example: ["{{ camera.lastPerson | d('') }}", "{{ camera.lastPerson | d('') }}"]
|
|
22082
|
+
},
|
|
22083
|
+
join: {
|
|
22084
|
+
description: ["Joins a list with a separator.", "Unisce un elenco con un separatore."],
|
|
22085
|
+
example: ["{{ range(3) | join(', ') }}", "{{ range(3) | join(', ') }}"]
|
|
22086
|
+
},
|
|
22087
|
+
replace: {
|
|
22088
|
+
description: ["Replaces text, optionally only the first few times.", "Sostituisce del testo, volendo solo le prime volte."],
|
|
22089
|
+
example: ["{{ camera.lastPlate | replace(' ', '') }}", "{{ camera.lastPlate | replace(' ', '') }}"]
|
|
22090
|
+
},
|
|
22091
|
+
first: {
|
|
22092
|
+
description: ["The first item of a list.", "Il primo elemento di un elenco."],
|
|
22093
|
+
example: ["{{ range(3) | first }}", "{{ range(3) | first }}"]
|
|
22094
|
+
},
|
|
22095
|
+
last: {
|
|
22096
|
+
description: ["The last item of a list.", "L’ultimo elemento di un elenco."],
|
|
22097
|
+
example: ["{{ range(3) | last }}", "{{ range(3) | last }}"]
|
|
22098
|
+
},
|
|
22099
|
+
sort: {
|
|
22100
|
+
description: ["Sorts a list. The arguments reverse it or keep case.", "Ordina un elenco. Gli argomenti lo invertono o rispettano le maiuscole."],
|
|
22101
|
+
example: ["{{ range(3) | reverse | sort }}", "{{ range(3) | reverse | sort }}"]
|
|
22102
|
+
},
|
|
22103
|
+
reverse: {
|
|
22104
|
+
description: ["Reverses a list.", "Inverte un elenco."],
|
|
22105
|
+
example: ["{{ range(3) | reverse }}", "{{ range(3) | reverse }}"]
|
|
22106
|
+
},
|
|
22107
|
+
sum: {
|
|
22108
|
+
description: ["Adds the numbers in a list.", "Somma i numeri di un elenco."],
|
|
22109
|
+
example: ["{{ range(3) | sum }}", "{{ range(3) | sum }}"]
|
|
22110
|
+
},
|
|
22111
|
+
string: {
|
|
22112
|
+
description: ["Prints the value as text.", "Stampa il valore come testo."],
|
|
22113
|
+
example: ["{{ garage.temperature | string }}", "{{ garage.temperature | string }}"]
|
|
22114
|
+
},
|
|
22115
|
+
list: {
|
|
22116
|
+
description: ["Wraps the value in a list.", "Mette il valore in un elenco."],
|
|
22117
|
+
example: ["{{ garage.temperature | list }}", "{{ garage.temperature | list }}"]
|
|
22118
|
+
},
|
|
22119
|
+
truncate: {
|
|
22120
|
+
description: ["Shortens text to a length, with an ending.", "Accorcia il testo a una lunghezza, con una chiusura."],
|
|
22121
|
+
example: ["{{ camera.lastPerson | truncate(12) }}", "{{ camera.lastPerson | truncate(12) }}"]
|
|
22122
|
+
},
|
|
22123
|
+
time: {
|
|
22124
|
+
description: ["Prints a timestamp in the server’s time zone. Tokens: YYYY MM DD HH mm ss.", "Stampa un istante nel fuso del server. Segni: YYYY MM DD HH mm ss."],
|
|
22125
|
+
example: ["{{ now | time('HH:mm') }}", "{{ now | time('HH:mm') }}"]
|
|
22126
|
+
},
|
|
22127
|
+
range: {
|
|
22128
|
+
description: ["The integers up to stop, or from start to stop by step. At most 1000 items.", "Gli interi fino a stop, oppure da start a stop con step. Al massimo 1000 elementi."],
|
|
22129
|
+
example: ["{% for i in range(3) %}{{ i }}{% endfor %}", "{% for i in range(3) %}{{ i }}{% endfor %}"]
|
|
22130
|
+
},
|
|
22131
|
+
now: {
|
|
22132
|
+
description: ["The hub clock. A bare now prints ISO; time prints a pattern.", "L’orologio dell’hub. now da solo stampa ISO; time stampa un formato."],
|
|
22133
|
+
example: ["{{ now | time('HH:mm') }}", "{{ now | time('HH:mm') }}"]
|
|
22134
|
+
},
|
|
22135
|
+
camera: {
|
|
22136
|
+
description: ["The device this text is written for. It stays correct when the text is copied to another camera.", "Il dispositivo per cui è scritto il testo. Resta corretto se il testo viene copiato su un’altra telecamera."],
|
|
22137
|
+
example: ["{{ camera.temperature }}", "{{ camera.temperature }}"]
|
|
22138
|
+
},
|
|
22139
|
+
loop: {
|
|
22140
|
+
description: ["The for-loop counter (index, length) inside {% for %}.", "Il contatore del ciclo (index, length) dentro {% for %}."],
|
|
22141
|
+
example: ["{% for i in range(3) %}{{ loop.index }}{% endfor %}", "{% for i in range(3) %}{{ loop.index }}{% endfor %}"]
|
|
22142
|
+
},
|
|
22143
|
+
lastPerson: {
|
|
22144
|
+
description: ["The last person recognised on this camera, empty until there is one.", "L’ultima persona riconosciuta su questa telecamera, vuota finché non ce n’è una."],
|
|
22145
|
+
example: ["{{ camera.lastPerson }}", "{{ camera.lastPerson }}"]
|
|
22146
|
+
},
|
|
22147
|
+
lastPlate: {
|
|
22148
|
+
description: ["The last plate recognised on this camera, empty until there is one.", "L’ultima targa riconosciuta su questa telecamera, vuota finché non ce n’è una."],
|
|
22149
|
+
example: ["{{ camera.lastPlate }}", "{{ camera.lastPlate }}"]
|
|
22150
|
+
}
|
|
22151
|
+
};
|
|
22152
|
+
function buildText() {
|
|
22153
|
+
const out = {};
|
|
22154
|
+
for (const item of DEVICE_TEMPLATE_CATALOGUE) {
|
|
22155
|
+
const row = COPY[item.name];
|
|
22156
|
+
if (row === void 0) continue;
|
|
22157
|
+
out[item.descriptionKey] = {
|
|
22158
|
+
en: row.description[0],
|
|
22159
|
+
it: row.description[1]
|
|
22160
|
+
};
|
|
22161
|
+
out[item.exampleKey] = {
|
|
22162
|
+
en: row.example[0],
|
|
22163
|
+
it: row.example[1]
|
|
22164
|
+
};
|
|
22165
|
+
}
|
|
22166
|
+
return out;
|
|
22167
|
+
}
|
|
22168
|
+
buildText();
|
|
22169
|
+
/** Names a template may use after `|`. Order matches the catalogue. */
|
|
22170
|
+
function deviceTemplateFilterNames() {
|
|
22171
|
+
return DEVICE_TEMPLATE_CATALOGUE.filter((item) => item.kind === "filter").map((item) => item.name);
|
|
22172
|
+
}
|
|
22173
|
+
//#endregion
|
|
21882
22174
|
//#region ../types/dist/index.mjs
|
|
21883
22175
|
var SMTP_INBOUND_DEFAULT_PORT = 2525;
|
|
21884
22176
|
var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
|
|
@@ -26314,1074 +26606,6 @@ function reducePoints(points, bucketMs, origin) {
|
|
|
26314
26606
|
}
|
|
26315
26607
|
return [...buckets.values()].toSorted((a, b) => a.atMs - b.atMs);
|
|
26316
26608
|
}
|
|
26317
|
-
var ClipModelMetaSchema = z.object({
|
|
26318
|
-
/** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
|
|
26319
|
-
textModelId: z.string().min(1),
|
|
26320
|
-
/** Output dimension of BOTH towers. A vector of any other length is refused. */
|
|
26321
|
-
embeddingDim: z.number().int().positive(),
|
|
26322
|
-
/**
|
|
26323
|
-
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
26324
|
-
* per index: two models share an index only when their vectors are ranked
|
|
26325
|
-
* against each other, which for CLIP means never across families. Every
|
|
26326
|
-
* model gets its own.
|
|
26327
|
-
*/
|
|
26328
|
-
vectorIndex: z.string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
|
|
26329
|
-
/**
|
|
26330
|
-
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
26331
|
-
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
26332
|
-
* models directory, so two different tokenizers under the same name would
|
|
26333
|
-
* silently overwrite each other (whichever model downloaded last wins, and
|
|
26334
|
-
* the other one tokenises with the wrong vocabulary).
|
|
26335
|
-
*/
|
|
26336
|
-
tokenizerFile: z.string().min(1),
|
|
26337
|
-
/** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
|
|
26338
|
-
contextLength: z.number().int().positive(),
|
|
26339
|
-
/** Id the tokenizer pads with. */
|
|
26340
|
-
padId: z.number().int().nonnegative(),
|
|
26341
|
-
/**
|
|
26342
|
-
* The search cosine floor at `strictness: 'loose'` — calibrated per model,
|
|
26343
|
-
* because cosine bands are a property of the model: 0.2 keeps 96% of matched
|
|
26344
|
-
* COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
|
|
26345
|
-
*/
|
|
26346
|
-
searchMinScore: z.number().min(0).max(1)
|
|
26347
|
-
});
|
|
26348
|
-
var ClipSearchStrictnessSchema = z.enum([
|
|
26349
|
-
"loose",
|
|
26350
|
-
"balanced",
|
|
26351
|
-
"strict"
|
|
26352
|
-
]);
|
|
26353
|
-
/** Steps whose effect a root label can BE. */
|
|
26354
|
-
var LABEL_SUPPLY_STEP_IDS = [
|
|
26355
|
-
"animal-classifier",
|
|
26356
|
-
"vehicle-classifier",
|
|
26357
|
-
"package-detection"
|
|
26358
|
-
];
|
|
26359
|
-
/** Steps whose box a root detection can BE. */
|
|
26360
|
-
var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
|
|
26361
|
-
/**
|
|
26362
|
-
* Steps whose per-detection MASK a root detection can carry (D737). The live
|
|
26363
|
-
* mask step is `segmentation` — a frame-plane refiner that runs its own model
|
|
26364
|
-
* once per detection crop. (`instance-segmentation` is a dormant step id that
|
|
26365
|
-
* no camera tree carries.)
|
|
26366
|
-
*/
|
|
26367
|
-
var MASK_SUPPLY_STEP_IDS = ["segmentation"];
|
|
26368
|
-
[
|
|
26369
|
-
...LABEL_SUPPLY_STEP_IDS,
|
|
26370
|
-
...CROP_SUPPLY_STEP_IDS,
|
|
26371
|
-
...MASK_SUPPLY_STEP_IDS
|
|
26372
|
-
];
|
|
26373
|
-
/**
|
|
26374
|
-
* Multi-file format payload.
|
|
26375
|
-
*
|
|
26376
|
-
* - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
|
|
26377
|
-
* relative to the directory root — the downloader fetches each from
|
|
26378
|
-
* `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
|
|
26379
|
-
* HuggingFace API (slower).
|
|
26380
|
-
* - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
|
|
26381
|
-
* files fetched from the SAME remote directory as `url` and stored flat
|
|
26382
|
-
* alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
|
|
26383
|
-
* weights next to `camstack-yolov9t.xml`.
|
|
26384
|
-
*/
|
|
26385
|
-
var ModelFormatEntrySchema = z.object({
|
|
26386
|
-
url: z.string(),
|
|
26387
|
-
sizeMB: z.number(),
|
|
26388
|
-
/** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
|
|
26389
|
-
isDirectory: z.boolean().optional(),
|
|
26390
|
-
/** Multi-file payload (directory members or sibling files). */
|
|
26391
|
-
files: z.array(z.string()).readonly().optional(),
|
|
26392
|
-
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
26393
|
-
runtimes: z.array(z.enum(["python"])).readonly().optional(),
|
|
26394
|
-
/**
|
|
26395
|
-
* Content revision of the artefact, for one hosted OFF the CamStack mirror.
|
|
26396
|
-
* A format on the mirror leaves it unset: its revision (the sha256 of its
|
|
26397
|
-
* weight file) comes from the downloader's generated table, kept in step
|
|
26398
|
-
* with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
|
|
26399
|
-
* node records the revision it downloaded next to the file
|
|
26400
|
-
* (`<file>.revision`); a copy with no record or a different one is stale
|
|
26401
|
-
* unless its weight file hashes to the revision, and a stale copy is
|
|
26402
|
-
* downloaded again, the old one serving until the new one is complete. No
|
|
26403
|
-
* revision at all ⇒ a file on disk is current, whatever it holds (D743).
|
|
26404
|
-
*/
|
|
26405
|
-
revision: z.string().min(1).optional()
|
|
26406
|
-
});
|
|
26407
|
-
/**
|
|
26408
|
-
* What a node holds for one (model, format) (D746). `current` is a complete
|
|
26409
|
-
* copy at its catalog revision — exactly what `downloaded: true` means.
|
|
26410
|
-
* `stale` is bytes on disk that are not (yet) proven current under D743/D744:
|
|
26411
|
-
* no or a different revision record, or a missing sibling. `missing` is no
|
|
26412
|
-
* copy. `downloaded` alone folds `stale` into "not downloaded", which hid
|
|
26413
|
-
* reclaimable bytes and a copy about to be replaced.
|
|
26414
|
-
*/
|
|
26415
|
-
var ModelOnDiskStateSchema = z.enum([
|
|
26416
|
-
"current",
|
|
26417
|
-
"stale",
|
|
26418
|
-
"missing"
|
|
26419
|
-
]);
|
|
26420
|
-
/**
|
|
26421
|
-
* The numeric precision of one format's BUILD (D746) — reported only when the
|
|
26422
|
-
* build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
|
|
26423
|
-
* CamStack Core ML export). Absent means "not stated", never "fp32".
|
|
26424
|
-
*/
|
|
26425
|
-
var ModelFormatPrecisionSchema = z.enum([
|
|
26426
|
-
"fp32",
|
|
26427
|
-
"fp16",
|
|
26428
|
-
"int8"
|
|
26429
|
-
]);
|
|
26430
|
-
/**
|
|
26431
|
-
* One format of one model as a node's `pipelineExecutor.getSchema` reports it.
|
|
26432
|
-
* `onDisk` / `precision` are optional for version skew: a runner that predates
|
|
26433
|
-
* them omits them, and a reader falls back to `downloaded`.
|
|
26434
|
-
*/
|
|
26435
|
-
var PipelineModelFormatStatusSchema = z.object({
|
|
26436
|
-
downloaded: z.boolean(),
|
|
26437
|
-
sizeMB: z.number(),
|
|
26438
|
-
onDisk: ModelOnDiskStateSchema.optional(),
|
|
26439
|
-
precision: ModelFormatPrecisionSchema.optional()
|
|
26440
|
-
});
|
|
26441
|
-
/**
|
|
26442
|
-
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
26443
|
-
* The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
|
|
26444
|
-
*/
|
|
26445
|
-
var ModelExtraFileSchema = z.object({
|
|
26446
|
-
url: z.string(),
|
|
26447
|
-
filename: z.string(),
|
|
26448
|
-
sizeMB: z.number()
|
|
26449
|
-
});
|
|
26450
|
-
/**
|
|
26451
|
-
* Per-format payload map. Modelled as an explicit object (one optional key
|
|
26452
|
-
* per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
|
|
26453
|
-
* record requires every key, but a catalog entry only ships a subset of
|
|
26454
|
-
* formats.
|
|
26455
|
-
*/
|
|
26456
|
-
var ModelFormatsSchema = z.object({
|
|
26457
|
-
onnx: ModelFormatEntrySchema.optional(),
|
|
26458
|
-
coreml: ModelFormatEntrySchema.optional(),
|
|
26459
|
-
openvino: ModelFormatEntrySchema.optional(),
|
|
26460
|
-
tflite: ModelFormatEntrySchema.optional(),
|
|
26461
|
-
pt: ModelFormatEntrySchema.optional(),
|
|
26462
|
-
gguf: ModelFormatEntrySchema.optional()
|
|
26463
|
-
});
|
|
26464
|
-
/**
|
|
26465
|
-
* Variant-selector grouping axes. Shared by the full `ModelCatalogEntry` and by
|
|
26466
|
-
* the reduced `PipelineModelOption` returned in `pipeline.getSchema()` so the
|
|
26467
|
-
* grouped Family→Tier→Variant picker renders identically in the config UI and
|
|
26468
|
-
* in the pipeline/device steppers. The flat `id` stays the source of truth for
|
|
26469
|
-
* resolution/download/persistence; this is a presentation overlay resolved back
|
|
26470
|
-
* to an `id`.
|
|
26471
|
-
*/
|
|
26472
|
-
var ModelVariantGroupSchema = z.object({
|
|
26473
|
-
/** Top-level family, e.g. `yolo26` (later `d-fine`, `rf-detr`). */
|
|
26474
|
-
family: z.string(),
|
|
26475
|
-
/** Size within the family, e.g. `n` | `s` | `m` | `l`. */
|
|
26476
|
-
tier: z.string(),
|
|
26477
|
-
/** Quantization axis. Omit ⇒ the fp32 base build. */
|
|
26478
|
-
precision: z.enum(["fp32", "int8"]).optional(),
|
|
26479
|
-
/**
|
|
26480
|
-
* Training / latency-variant axis. Omit ⇒ the standard build. `test` marks
|
|
26481
|
-
* an alternate training of the same family (plugin catalog `relu_test`); chip
|
|
26482
|
-
* label is "Test".
|
|
26483
|
-
*/
|
|
26484
|
-
optimization: z.enum(["standard", "test"]).optional(),
|
|
26485
|
-
/**
|
|
26486
|
-
* Input-resolution axis (square input side, px). Omit ⇒ the family's native
|
|
26487
|
-
* resolution (640 for yolo26). Reduced-input builds (320 / 256) are a big,
|
|
26488
|
-
* cheap latency lever — especially on Apple ANE and the Intel N100 — at a
|
|
26489
|
-
* small-object accuracy cost. Mirrors the model's `inputSize` but lifted onto
|
|
26490
|
-
* the group so the selector can offer it as a variant axis.
|
|
26491
|
-
*/
|
|
26492
|
-
resolution: z.number().int().positive().optional()
|
|
26493
|
-
});
|
|
26494
|
-
var ModelProviderIdSchema = z.enum([
|
|
26495
|
-
"camstack",
|
|
26496
|
-
"frigate",
|
|
26497
|
-
"scrypted",
|
|
26498
|
-
"custom"
|
|
26499
|
-
]);
|
|
26500
|
-
var ModelLicenseRecordSchema = z.object({
|
|
26501
|
-
/** SPDX id of the WEIGHTS' terms, a `LicenseRef-*` for non-SPDX terms, or `UNKNOWN`. */
|
|
26502
|
-
weights: z.string().min(1),
|
|
26503
|
-
/** SPDX id of the upstream code that defines / trained the network. */
|
|
26504
|
-
code: z.string().min(1).optional(),
|
|
26505
|
-
/** Training data whose terms add obligations (attribution, non-commercial). */
|
|
26506
|
-
data: z.object({
|
|
26507
|
-
name: z.string().min(1),
|
|
26508
|
-
terms: z.string().min(1),
|
|
26509
|
-
url: z.string().url().optional()
|
|
26510
|
-
}).optional(),
|
|
26511
|
-
/** The project the weights come from. Required on built-in entries (guard). */
|
|
26512
|
-
upstream: z.object({
|
|
26513
|
-
name: z.string().min(1),
|
|
26514
|
-
url: z.string().url()
|
|
26515
|
-
}).optional(),
|
|
26516
|
-
/** Where the licence text governing the weights is published. */
|
|
26517
|
-
url: z.string().url().optional(),
|
|
26518
|
-
/** Attribution the licence REQUIRES, verbatim. */
|
|
26519
|
-
attribution: z.string().min(1).optional(),
|
|
26520
|
-
/** What CamStack changed. Required when `hosting` is `camstack-hf` (guard). */
|
|
26521
|
-
modifications: z.string().min(1).optional(),
|
|
26522
|
-
/** Who serves the file a node downloads. */
|
|
26523
|
-
hosting: z.enum([
|
|
26524
|
-
"camstack-hf",
|
|
26525
|
-
"third-party",
|
|
26526
|
-
"built-in"
|
|
26527
|
-
]).optional(),
|
|
26528
|
-
/** True when the weights or their data forbid commercial use. */
|
|
26529
|
-
nonCommercial: z.boolean().optional()
|
|
26530
|
-
});
|
|
26531
|
-
/**
|
|
26532
|
-
* The licence of a model, as a record rather than a bare SPDX string: a
|
|
26533
|
-
* permissive CODE licence routinely sits on top of restrictive WEIGHTS or
|
|
26534
|
-
* DATA, and the obligations (attribution, modification notices, source offers)
|
|
26535
|
-
* are per upstream. A persisted custom-model row written when this field was a
|
|
26536
|
-
* string still parses — the string is lifted into `{ weights }`.
|
|
26537
|
-
*
|
|
26538
|
-
* Every machine licence surface (`THIRD_PARTY_MODELS.md`, the Hugging Face
|
|
26539
|
-
* model table) is GENERATED from these records by
|
|
26540
|
-
* `scripts/gen-model-licenses.ts` (D661). Operator-facing docs live in
|
|
26541
|
-
* `camstack/docs` → `/docs/detection/models`.
|
|
26542
|
-
*/
|
|
26543
|
-
var ModelLicenseSchema = z.preprocess((value) => typeof value === "string" ? { weights: value } : value, ModelLicenseRecordSchema);
|
|
26544
|
-
/**
|
|
26545
|
-
* One step a ROOT detector can supply from its own output (D730) — see
|
|
26546
|
-
* `ModelCatalogEntry.suppliesSteps`.
|
|
26547
|
-
*
|
|
26548
|
-
* - `label`: the root's raw class IS the step's answer. `labelToEffect` maps
|
|
26549
|
-
* the root's label to the step's vocabulary; `uncovered` is the vocabulary
|
|
26550
|
-
* the root cannot produce (shown as unavailable, never a blocker).
|
|
26551
|
-
* - `crop`: the root draws the box the step would have found (`license_plate`
|
|
26552
|
-
* for plate-detection, `face` for face-detection). The box becomes a detail
|
|
26553
|
-
* child of the `parentMacro` detection that contains it — never a track.
|
|
26554
|
-
* - `mask`: the root's decode emits an instance mask with every detection (a
|
|
26555
|
-
* YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
|
|
26556
|
-
* detection in the shape that step produces. Derived from the model's
|
|
26557
|
-
* postprocessor on read, never stored by an import.
|
|
26558
|
-
*/
|
|
26559
|
-
var RootStepSupplySchema = z.discriminatedUnion("kind", [
|
|
26560
|
-
z.object({
|
|
26561
|
-
kind: z.literal("label"),
|
|
26562
|
-
stepId: z.enum(LABEL_SUPPLY_STEP_IDS),
|
|
26563
|
-
labelToEffect: z.record(z.string(), z.string()),
|
|
26564
|
-
uncovered: z.array(z.string()).readonly()
|
|
26565
|
-
}),
|
|
26566
|
-
z.object({
|
|
26567
|
-
kind: z.literal("crop"),
|
|
26568
|
-
stepId: z.enum(CROP_SUPPLY_STEP_IDS),
|
|
26569
|
-
rootLabels: z.array(z.string()).readonly(),
|
|
26570
|
-
parentMacro: z.enum(["vehicle", "person"]),
|
|
26571
|
-
childClass: z.enum(["plate", "face"]),
|
|
26572
|
-
/**
|
|
26573
|
-
* The root's smaller input side, stamped on read by `rootSuppliesOf` from
|
|
26574
|
-
* the model entry — what a step's `minRootInputPx` gate judges. Never
|
|
26575
|
-
* stored by an import.
|
|
26576
|
-
*/
|
|
26577
|
-
rootInputPx: z.number().int().positive().optional()
|
|
26578
|
-
}),
|
|
26579
|
-
z.object({
|
|
26580
|
-
kind: z.literal("mask"),
|
|
26581
|
-
stepId: z.enum(MASK_SUPPLY_STEP_IDS)
|
|
26582
|
-
})
|
|
26583
|
-
]);
|
|
26584
|
-
var ModelCatalogEntrySchema = z.object({
|
|
26585
|
-
id: z.string(),
|
|
26586
|
-
name: z.string(),
|
|
26587
|
-
description: z.string(),
|
|
26588
|
-
formats: ModelFormatsSchema,
|
|
26589
|
-
inputSize: z.object({
|
|
26590
|
-
width: z.number(),
|
|
26591
|
-
height: z.number()
|
|
26592
|
-
}),
|
|
26593
|
-
/**
|
|
26594
|
-
* Channel count of the model input tensor. Omit ⇒ 3 (RGB), the default for
|
|
26595
|
-
* every detector / classifier / embedder. Set to 1 for a grayscale CTC text
|
|
26596
|
-
* recognizer (EasyOCR VGG plate-OCR: input `[N,1,H,W]`) so the preprocess
|
|
26597
|
-
* feeds a single-channel, EasyOCR-normalized tensor instead of the default
|
|
26598
|
-
* 3-channel RGB one. Threaded through `PoolModelConfig.inputChannels` to the
|
|
26599
|
-
* Python inference pool.
|
|
26600
|
-
*/
|
|
26601
|
-
inputChannels: z.number().int().positive().optional(),
|
|
26602
|
-
labels: z.array(LabelDefinitionSchema).readonly(),
|
|
26603
|
-
inputLayout: z.enum(["nchw", "nhwc"]).optional(),
|
|
26604
|
-
/**
|
|
26605
|
-
* `'scrfd'` applies InsightFace's SCRFD input contract, `(x - 127.5) / 128`
|
|
26606
|
-
* (upstream `insightface/model_zoo/scrfd.py`), instead of the historical
|
|
26607
|
-
* plain `/255`. Measured against COCO GT: 188 → 196 faces found on the
|
|
26608
|
-
* `scrfd-2.5g` catalog entry (2026-09-26 model-replacement spike, §2.4-2).
|
|
26609
|
-
*/
|
|
26610
|
-
inputNormalization: z.enum([
|
|
26611
|
-
"zero-one",
|
|
26612
|
-
"imagenet",
|
|
26613
|
-
"none",
|
|
26614
|
-
"scrfd"
|
|
26615
|
-
]).optional(),
|
|
26616
|
-
/**
|
|
26617
|
-
* The model already applies softmax IN-GRAPH — its raw output is a
|
|
26618
|
-
* probability distribution, not logits. When set, the `softmax`
|
|
26619
|
-
* postprocessor must NOT re-apply softmax: re-softmaxing an already-normalised
|
|
26620
|
-
* probability vector collapses it toward uniform (top-1 score craters far
|
|
26621
|
-
* below its true value, making every confidence gate meaningless). Absent ⇒
|
|
26622
|
-
* the output is raw logits and the postprocessor applies softmax (the normal
|
|
26623
|
-
* case). Set on the Google AIY Birds `bird-classifier` (softmax baked into the
|
|
26624
|
-
* TF graph). Threaded to the Python pool via `PoolModelConfig.outputProbabilities`.
|
|
26625
|
-
*/
|
|
26626
|
-
outputProbabilities: z.boolean().optional(),
|
|
26627
|
-
preprocessMode: z.enum(["letterbox", "resize"]).optional(),
|
|
26628
|
-
/**
|
|
26629
|
-
* Per-MODEL postprocessor override. Absent ⇒ the step's own
|
|
26630
|
-
* `StepDefinition.postprocessor` applies (the normal case — every model in a
|
|
26631
|
-
* step shares its decode). Set it when a step hosts models with DIFFERENT raw
|
|
26632
|
-
* output layouts under one slot: e.g. object-detection is `'yolo'` by default,
|
|
26633
|
-
* but a Coral SSD MobileNet build emits the `TFLite_Detection_PostProcess`
|
|
26634
|
-
* 4-tensor layout and needs `'ssd'`. Threaded into `PoolModelConfig.postprocessor`
|
|
26635
|
-
* by the engine factory (`modelEntry.postprocessor ?? def.postprocessor`).
|
|
26636
|
-
*/
|
|
26637
|
-
postprocessor: z.custom().optional(),
|
|
26638
|
-
/**
|
|
26639
|
-
* Per-MODEL default confidence floor. Absent ⇒ the step's
|
|
26640
|
-
* `StepDefinition.defaultConfidence` applies. A score is a property of one
|
|
26641
|
-
* model's output scale, not of the step slot it sits in: YuNet's
|
|
26642
|
-
* `sqrt(cls·obj)` is not SCRFD's score, and inheriting SCRFD's 0.5 filled the
|
|
26643
|
-
* face gallery with wheels and hands (D662, amends D645). An operator's
|
|
26644
|
-
* explicit value still wins over it. Resolved in ONE place —
|
|
26645
|
-
* `addon-pipeline/.../registry/effective-confidence.ts`.
|
|
26646
|
-
*/
|
|
26647
|
-
defaultConfidence: z.number().min(0).max(1).optional(),
|
|
26648
|
-
/**
|
|
26649
|
-
* Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
|
|
26650
|
-
* on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
|
|
26651
|
-
* absent here runs at the step slider's global default. The same row shape
|
|
26652
|
-
* the floor measurement produces (`model-floors.json`: modelId → floors), so
|
|
26653
|
-
* a measured table is copied in as-is. An operator override is bound to the
|
|
26654
|
-
* model it was made for and does not survive a model change (D738). A custom
|
|
26655
|
-
* / imported model may declare it; without it, the global defaults apply.
|
|
26656
|
-
*/
|
|
26657
|
-
defaultClassFloors: z.record(z.string(), z.number().min(0).max(1)).optional(),
|
|
26658
|
-
/**
|
|
26659
|
-
* The inference precision this model's OpenVINO IR needs on an Intel GPU.
|
|
26660
|
-
* Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
|
|
26661
|
-
* that produces invalid output at f16 — measured 2026-10-07 for YOLO26
|
|
26662
|
-
* base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
|
|
26663
|
-
* scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
|
|
26664
|
-
* `PoolModelConfig.gpuInferencePrecision`; the pool sets
|
|
26665
|
-
* INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
|
|
26666
|
-
*/
|
|
26667
|
-
gpuInferencePrecision: z.enum(["f32", "f16"]).optional(),
|
|
26668
|
-
/**
|
|
26669
|
-
* ROOT detectors only: per supplied step (`animal-classifier`, …), the
|
|
26670
|
-
* minimum DETECTION score from which this root's own fine label (species,
|
|
26671
|
-
* vehicle type — D736 root supply) is taken (D741). Below it the detection
|
|
26672
|
-
* keeps its macro class without the fine label. `1` = never take it from
|
|
26673
|
-
* this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
|
|
26674
|
-
* `minConfidence` slider, bound to the ROOT model, overrides it.
|
|
26675
|
-
*/
|
|
26676
|
-
suppliedLabelFloors: z.record(z.string(), z.number().min(0).max(1)).optional(),
|
|
26677
|
-
/**
|
|
26678
|
-
* When true, the executor produces a landmark-aligned crop (similarity warp
|
|
26679
|
-
* onto the canonical template) before this step runs, instead of a plain
|
|
26680
|
-
* axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
|
|
26681
|
-
* their embeddings are only discriminative on an aligned input. The face
|
|
26682
|
-
* detector that produced the parent detail must emit 5 landmarks.
|
|
26683
|
-
*/
|
|
26684
|
-
faceAlignment: z.boolean().optional(),
|
|
26685
|
-
/**
|
|
26686
|
-
* Auxiliary files required at runtime (labels JSON, charset dict, etc.).
|
|
26687
|
-
* Downloaded into the same modelsDir alongside the model file.
|
|
26688
|
-
*/
|
|
26689
|
-
extraFiles: z.array(ModelExtraFileSchema).readonly().optional(),
|
|
26690
|
-
/**
|
|
26691
|
-
* LEGACY entry — retained in the catalog so a persisted operator selection
|
|
26692
|
-
* still RESOLVES (and can be re-activated), but hidden from the selectable
|
|
26693
|
-
* model list and excluded from the auto format-default pick. Set on the
|
|
26694
|
-
* superseded / consolidated models (older lineages, redundant fp16 IRs) so
|
|
26695
|
-
* the active lineup stays the coherent curated ladder without deleting a
|
|
26696
|
-
* model anyone may still be pinned to. `resolveModelForFormat` keeps honoring
|
|
26697
|
-
* an explicit legacy id that has a build for the node's format.
|
|
26698
|
-
*/
|
|
26699
|
-
legacy: z.boolean().optional(),
|
|
26700
|
-
/**
|
|
26701
|
-
* Measured quality/latency metadata — populated from the benchmark addon on
|
|
26702
|
-
* the real node classes. Absent = not yet measured (most entries today; the
|
|
26703
|
-
* catalog historically carried only `sizeMB`, a poor cross-architecture
|
|
26704
|
-
* speed proxy). `p95LatencyMs` is keyed by node class (e.g. `n100`, `mac`).
|
|
26705
|
-
*/
|
|
26706
|
-
metrics: z.object({
|
|
26707
|
-
map50: z.number().optional(),
|
|
26708
|
-
p95LatencyMs: z.record(z.string(), z.number()).optional()
|
|
26709
|
-
}).optional(),
|
|
26710
|
-
/**
|
|
26711
|
-
* The model's licence record — see {@link ModelLicenseSchema}. Optional in
|
|
26712
|
-
* the schema (a custom model's author may state none); REQUIRED and complete
|
|
26713
|
-
* on every built-in catalog entry (`scripts/check-catalog-licence.ts`).
|
|
26714
|
-
*/
|
|
26715
|
-
license: ModelLicenseSchema.optional(),
|
|
26716
|
-
/**
|
|
26717
|
-
* Variant-selector grouping. The UI groups models by `family` + `tier` and
|
|
26718
|
-
* offers `precision` / `optimization` as variant axes WITHIN a tier — so all
|
|
26719
|
-
* of a family's sizes and quantizations collapse into one grouped picker
|
|
26720
|
-
* instead of a flat list of `yolo26s`, `yolo26s-int8`, … Absent ⇒ ungrouped
|
|
26721
|
-
* (legacy / custom models) — never shown in the grouped selector. The flat
|
|
26722
|
-
* `id` stays the source of truth for resolution/download/persistence; grouping
|
|
26723
|
-
* is a presentation overlay resolved back to an `id`.
|
|
26724
|
-
*/
|
|
26725
|
-
group: ModelVariantGroupSchema.optional(),
|
|
26726
|
-
/**
|
|
26727
|
-
* Catalog source for the pipeline stepper's provider-first picker. Absent on
|
|
26728
|
-
* built-in CamStack entries (treated as `camstack`) and on registry rows
|
|
26729
|
-
* persisted before this field existed (`inferModelProvider` fills those).
|
|
26730
|
-
*/
|
|
26731
|
-
provider: ModelProviderIdSchema.optional(),
|
|
26732
|
-
/**
|
|
26733
|
-
* Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
|
|
26734
|
-
* applies (plus catalog / COCO public catalog). Set on a custom model whose raw
|
|
26735
|
-
* labels already ARE the CamStack macros (plugin catalog identity map).
|
|
26736
|
-
*/
|
|
26737
|
-
classMap: DetectionCatalogClassMapSchema.optional(),
|
|
26738
|
-
/**
|
|
26739
|
-
* The pipeline steps this ROOT detector can supply from its own output
|
|
26740
|
-
* (D730): its labels name a step's effect (`deer` for `animal-classifier`)
|
|
26741
|
-
* or draw a step's box (`license_plate` for `plate-detection`). Computed at
|
|
26742
|
-
* import from THIS model's labelmap by `deriveRootSupplies`, never written
|
|
26743
|
-
* by hand and never assumed per family; a row without it is derived on read
|
|
26744
|
-
* (`rootSuppliesOf`). Whether a camera uses it is the step's own
|
|
26745
|
-
* `useRootModel` flag (`resolveRootSupply`).
|
|
26746
|
-
*/
|
|
26747
|
-
suppliesSteps: z.array(RootStepSupplySchema).readonly().optional(),
|
|
26748
|
-
/**
|
|
26749
|
-
* The model's CLIP feature-space contract (text encoder, dimension, vector
|
|
26750
|
-
* index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
|
|
26751
|
-
* CLIP image encoder; its absence is what "not a CLIP model" means to the
|
|
26752
|
-
* embedding encoder and the semantic-search store (D649).
|
|
26753
|
-
*/
|
|
26754
|
-
clip: ClipModelMetaSchema.optional()
|
|
26755
|
-
});
|
|
26756
|
-
var ConvertTargetSchema = z.discriminatedUnion("format", [z.object({
|
|
26757
|
-
format: z.literal("openvino"),
|
|
26758
|
-
precisions: z.array(z.enum(["fp16", "int8"])).min(1).readonly()
|
|
26759
|
-
}), z.object({ format: z.literal("coreml") })]);
|
|
26760
|
-
var ModelConvertMetadataSchema = z.object({
|
|
26761
|
-
id: z.string().regex(/^[a-zA-Z0-9._-]+$/),
|
|
26762
|
-
name: z.string(),
|
|
26763
|
-
labels: z.array(LabelDefinitionSchema).readonly(),
|
|
26764
|
-
inputSize: z.object({
|
|
26765
|
-
width: z.number(),
|
|
26766
|
-
height: z.number()
|
|
26767
|
-
}),
|
|
26768
|
-
inputLayout: z.enum(["nchw", "nhwc"]).optional(),
|
|
26769
|
-
inputNormalization: z.enum([
|
|
26770
|
-
"zero-one",
|
|
26771
|
-
"imagenet",
|
|
26772
|
-
"none",
|
|
26773
|
-
"scrfd"
|
|
26774
|
-
]).optional(),
|
|
26775
|
-
preprocessMode: z.enum(["letterbox", "resize"]).optional(),
|
|
26776
|
-
outputFormat: z.enum([
|
|
26777
|
-
"yolo",
|
|
26778
|
-
"ssd",
|
|
26779
|
-
"embedding",
|
|
26780
|
-
"classification",
|
|
26781
|
-
"ocr",
|
|
26782
|
-
"segmentation"
|
|
26783
|
-
]),
|
|
26784
|
-
faceAlignment: z.boolean().optional(),
|
|
26785
|
-
classMap: DetectionCatalogClassMapSchema.optional()
|
|
26786
|
-
});
|
|
26787
|
-
var ConvertArtifactSchema = z.object({
|
|
26788
|
-
format: z.enum(MODEL_FORMATS),
|
|
26789
|
-
precision: z.enum(["fp16", "int8"]).optional(),
|
|
26790
|
-
sizeMB: z.number(),
|
|
26791
|
-
validated: z.boolean(),
|
|
26792
|
-
files: z.array(z.string()).readonly()
|
|
26793
|
-
});
|
|
26794
|
-
var ConvertResultSchema = z.object({
|
|
26795
|
-
entry: ModelCatalogEntrySchema,
|
|
26796
|
-
artifacts: z.array(ConvertArtifactSchema).readonly()
|
|
26797
|
-
});
|
|
26798
|
-
/**
|
|
26799
|
-
* True if the scope set grants `access` on device-scoped capabilities.
|
|
26800
|
-
* A `category:device` grant covers every device cap (the broad grant).
|
|
26801
|
-
*/
|
|
26802
|
-
function scopesAllowDeviceCap(scopes, access) {
|
|
26803
|
-
return scopes.some((s) => s.type === "category" && s.target === "device" && s.access.includes(access));
|
|
26804
|
-
}
|
|
26805
|
-
/**
|
|
26806
|
-
* True if the scope set names this addon with at least `access`.
|
|
26807
|
-
*
|
|
26808
|
-
* Deliberately NOT satisfied by `category:device`: a grant over per-camera
|
|
26809
|
-
* capabilities says nothing about an addon's own HTTP surface, and conflating
|
|
26810
|
-
* the two is precisely the confusion that let an Alexa token drive Home
|
|
26811
|
-
* Assistant's command route.
|
|
26812
|
-
*/
|
|
26813
|
-
function scopesAllowAddon(scopes, addonId, access) {
|
|
26814
|
-
return scopes.some((s) => s.type === "addon" && s.target === addonId && s.access.includes(access));
|
|
26815
|
-
}
|
|
26816
|
-
var ViewerFeatureIdSchema = z.enum([
|
|
26817
|
-
"face-assignment",
|
|
26818
|
-
"plate-assignment",
|
|
26819
|
-
"retrain",
|
|
26820
|
-
"scenes"
|
|
26821
|
-
]);
|
|
26822
|
-
/** Which devices a viewer reaches: `allow` minus `block`. */
|
|
26823
|
-
var ViewerDeviceAllowSchema = z.union([z.literal("*"), z.array(z.number().int().nonnegative())]);
|
|
26824
|
-
/**
|
|
26825
|
-
* The viewer grant, stored as ONE row of a user's `scopes`. A principal that
|
|
26826
|
-
* holds it is decided by the viewer rules ALONE — any other row it carries is
|
|
26827
|
-
* ignored, so a viewer can never be widened by a leftover grant.
|
|
26828
|
-
*/
|
|
26829
|
-
var ViewerTokenScopeSchema = z.object({
|
|
26830
|
-
type: z.literal("viewer"),
|
|
26831
|
-
allow: ViewerDeviceAllowSchema,
|
|
26832
|
-
block: z.array(z.number().int().nonnegative()),
|
|
26833
|
-
features: z.array(ViewerFeatureIdSchema)
|
|
26834
|
-
});
|
|
26835
|
-
/**
|
|
26836
|
-
* Zod schemas for persisted record types.
|
|
26837
|
-
*
|
|
26838
|
-
* These schemas serve as the single source of truth for types that are
|
|
26839
|
-
* stored in the settings-store backend and retrieved via tRPC. They
|
|
26840
|
-
* replace the manual TypeScript interfaces with schema-derived types,
|
|
26841
|
-
* enabling runtime validation when reading from the backend.
|
|
26842
|
-
*
|
|
26843
|
-
* Convention: each schema is named `<Type>Schema`, the inferred TS type
|
|
26844
|
-
* keeps the original name for backward compatibility.
|
|
26845
|
-
*/
|
|
26846
|
-
/**
|
|
26847
|
-
* Auth model (v2 — 2026-05-12 caps-only):
|
|
26848
|
-
*
|
|
26849
|
-
* Two principals:
|
|
26850
|
-
* - `isAdmin: true` — full bypass. Admin scope set is ignored.
|
|
26851
|
-
* - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
|
|
26852
|
-
*
|
|
26853
|
-
* No role enum. There used to be `viewer / agent / scoped` and earlier
|
|
26854
|
-
* `super_admin` — collapsed onto the single boolean because every
|
|
26855
|
-
* non-admin caller is governed by the same scope-check rules; the
|
|
26856
|
-
* distinction was only ever used to route role-specific procedures
|
|
26857
|
-
* which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
|
|
26858
|
-
* with `isAdmin: false` + an explicit scope list.
|
|
26859
|
-
*/
|
|
26860
|
-
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
26861
|
-
var MethodAccessSchema = z.enum([
|
|
26862
|
-
"view",
|
|
26863
|
-
"create",
|
|
26864
|
-
"delete"
|
|
26865
|
-
]);
|
|
26866
|
-
/**
|
|
26867
|
-
* A single scope grant. Three forms — checked in matcher with OR
|
|
26868
|
-
* semantics; the first match decides whether the call passes:
|
|
26869
|
-
*
|
|
26870
|
-
* - `category` — broadest. `target: 'device' | 'system'` selects every
|
|
26871
|
-
* cap with the matching `scope` declaration. New caps inherit grants
|
|
26872
|
-
* automatically — adding a device cap to the codebase makes it
|
|
26873
|
-
* reachable to every user with `category:device [...]` without a
|
|
26874
|
-
* re-grant. Use this for "family viewer" / "operator" tiers.
|
|
26875
|
-
*
|
|
26876
|
-
* - `addon` — every cap that ships inside a given addon id. Niche;
|
|
26877
|
-
* useful when an integration needs to interact with one specific
|
|
26878
|
-
* addon's surface regardless of how many caps it exports.
|
|
26879
|
-
*
|
|
26880
|
-
* - `capability` — the most precise form. Single cap name. Use for
|
|
26881
|
-
* integration tokens where you want to grant `addons.installPackage`
|
|
26882
|
-
* and nothing else.
|
|
26883
|
-
*
|
|
26884
|
-
* `access` is REQUIRED with min 1 element. `admin` bypass is the
|
|
26885
|
-
* "give me everything" escape; there is no wildcard scope.
|
|
26886
|
-
*/
|
|
26887
|
-
var AllowedProviderSchema = z.union([z.literal("*"), z.array(z.string())]);
|
|
26888
|
-
var AllowedDevicesSchema = z.record(z.string(), z.union([z.literal("*"), z.array(z.string())]));
|
|
26889
|
-
var CapScopeSchema = z.enum(["device", "system"]);
|
|
26890
|
-
/**
|
|
26891
|
-
* DeviceSelector (scope model v3 — 2026-08-12).
|
|
26892
|
-
*
|
|
26893
|
-
* A `device` grant no longer carries a frozen list of deviceIds. It carries
|
|
26894
|
-
* a SELECTOR the matcher resolves against the live fleet, so the grant can be
|
|
26895
|
-
* DYNAMIC: a `types:['camera']` selector automatically covers a camera added
|
|
26896
|
-
* AFTER the grant was minted — no re-grant, no re-login.
|
|
26897
|
-
*
|
|
26898
|
-
* - `all` — every device in the deployment. The broad viewer/operator
|
|
26899
|
-
* lever without a `category` grant (a `category` grant also covers device
|
|
26900
|
-
* caps that carry no deviceId; `all` is specifically the device set).
|
|
26901
|
-
* - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
|
|
26902
|
-
* grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
|
|
26903
|
-
* is NOT covered until the grant is edited.
|
|
26904
|
-
* - `types` — every device of a `DeviceType` (e.g. every `camera`).
|
|
26905
|
-
* DYNAMIC. A device that changes type, or a new device of the type,
|
|
26906
|
-
* re-resolves on the next request.
|
|
26907
|
-
* - `locations` — every device whose operator-assigned `location` label is
|
|
26908
|
-
* in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
|
|
26909
|
-
* null/unset location matches NO `locations` selector.
|
|
26910
|
-
*/
|
|
26911
|
-
var DeviceSelectorSchema = z.discriminatedUnion("kind", [
|
|
26912
|
-
z.object({ kind: z.literal("all") }),
|
|
26913
|
-
z.object({
|
|
26914
|
-
kind: z.literal("ids"),
|
|
26915
|
-
ids: z.array(z.number().int()).min(1)
|
|
26916
|
-
}),
|
|
26917
|
-
z.object({
|
|
26918
|
-
kind: z.literal("types"),
|
|
26919
|
-
types: z.array(z.enum(DeviceType)).min(1)
|
|
26920
|
-
}),
|
|
26921
|
-
z.object({
|
|
26922
|
-
kind: z.literal("locations"),
|
|
26923
|
-
locations: z.array(z.string().min(1)).min(1)
|
|
26924
|
-
})
|
|
26925
|
-
]);
|
|
26926
|
-
var DeviceTokenScopeSchema = z.object({
|
|
26927
|
-
type: z.literal("device"),
|
|
26928
|
-
/** The device SET this grant covers — resolved against the live fleet. */
|
|
26929
|
-
selector: DeviceSelectorSchema,
|
|
26930
|
-
access: z.array(MethodAccessSchema).min(1),
|
|
26931
|
-
/**
|
|
26932
|
-
* Whether a grant on a PARENT device transparently covers its accessory
|
|
26933
|
-
* CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
|
|
26934
|
-
* Direction is parent → children ONLY.
|
|
26935
|
-
*
|
|
26936
|
-
* Absent → the matcher DERIVES it from the access flavour: `view`
|
|
26937
|
-
* inherits (a camera viewer sees the camera's accessories), `create` /
|
|
26938
|
-
* `delete` do NOT (actuating/removing a child is an explicit act the
|
|
26939
|
-
* operator must grant on the child, not inherit from the parent). Set it
|
|
26940
|
-
* explicitly to override that default per grant.
|
|
26941
|
-
*/
|
|
26942
|
-
includeLinked: z.boolean().optional()
|
|
26943
|
-
});
|
|
26944
|
-
/**
|
|
26945
|
-
* v2 → v3 lazy migration. A pre-v3 `device` grant carried
|
|
26946
|
-
* `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
|
|
26947
|
-
* `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
|
|
26948
|
-
* EVERY parse path — stored records AND the JWT-carried scope arrays
|
|
26949
|
-
* normalised at the request boundary ({@link normalizeTokenScopes} in
|
|
26950
|
-
* `device-selector.ts`). Chosen over a one-time DB migration because a
|
|
26951
|
-
* migration cannot reach a JWT already in a client's hands; parse-time
|
|
26952
|
-
* migration covers both without a flag day. No cast — the raw object is read
|
|
26953
|
-
* through `Reflect.get` (its static type is `unknown`).
|
|
26954
|
-
*/
|
|
26955
|
-
function migrateLegacyTokenScope(raw) {
|
|
26956
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
26957
|
-
if (Reflect.get(raw, "type") !== "device") return raw;
|
|
26958
|
-
if (Reflect.get(raw, "selector") !== void 0) return canonicalSelectorTypes(raw);
|
|
26959
|
-
const targets = Reflect.get(raw, "targets");
|
|
26960
|
-
if (!Array.isArray(targets)) return raw;
|
|
26961
|
-
return {
|
|
26962
|
-
type: "device",
|
|
26963
|
-
selector: {
|
|
26964
|
-
kind: "ids",
|
|
26965
|
-
ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
|
|
26966
|
-
},
|
|
26967
|
-
access: Reflect.get(raw, "access")
|
|
26968
|
-
};
|
|
26969
|
-
}
|
|
26970
|
-
/**
|
|
26971
|
-
* A stored `types` selector may name a type D1033 retired (`thermostat`). The
|
|
26972
|
-
* grant is read back through this same preprocess, so the retired name is
|
|
26973
|
-
* rewritten to its canonical type here and {@link DeviceSelectorSchema} itself
|
|
26974
|
-
* stays a strict enum on the wire.
|
|
26975
|
-
*/
|
|
26976
|
-
function canonicalSelectorTypes(raw) {
|
|
26977
|
-
const selector = Reflect.get(raw, "selector");
|
|
26978
|
-
if (selector === null || typeof selector !== "object") return raw;
|
|
26979
|
-
if (Reflect.get(selector, "kind") !== "types") return raw;
|
|
26980
|
-
const types = Reflect.get(selector, "types");
|
|
26981
|
-
if (!Array.isArray(types)) return raw;
|
|
26982
|
-
const canonical = types.map((t) => typeof t === "string" ? canonicalStoredDeviceType(t) : t);
|
|
26983
|
-
return {
|
|
26984
|
-
...raw,
|
|
26985
|
-
selector: {
|
|
26986
|
-
...selector,
|
|
26987
|
-
types: canonical
|
|
26988
|
-
}
|
|
26989
|
-
};
|
|
26990
|
-
}
|
|
26991
|
-
var TokenScopeSchema = z.preprocess(migrateLegacyTokenScope, z.discriminatedUnion("type", [
|
|
26992
|
-
z.object({
|
|
26993
|
-
type: z.literal("category"),
|
|
26994
|
-
target: CapScopeSchema,
|
|
26995
|
-
access: z.array(MethodAccessSchema).min(1)
|
|
26996
|
-
}),
|
|
26997
|
-
z.object({
|
|
26998
|
-
type: z.literal("capability"),
|
|
26999
|
-
target: z.string(),
|
|
27000
|
-
access: z.array(MethodAccessSchema).min(1)
|
|
27001
|
-
}),
|
|
27002
|
-
z.object({
|
|
27003
|
-
type: z.literal("addon"),
|
|
27004
|
-
target: z.string(),
|
|
27005
|
-
access: z.array(MethodAccessSchema).min(1)
|
|
27006
|
-
}),
|
|
27007
|
-
DeviceTokenScopeSchema
|
|
27008
|
-
]));
|
|
27009
|
-
/**
|
|
27010
|
-
* What a PERSON's grant set holds (D921): the capability rows above (legacy
|
|
27011
|
-
* users, integration-style tokens) or the viewer row, which is decided by its
|
|
27012
|
-
* own rules alone. Kept apart from {@link TokenScope} so every surface that
|
|
27013
|
-
* edits capability rows (the scope picker, token minting) keeps its shape.
|
|
27014
|
-
*/
|
|
27015
|
-
var UserScopeSchema = z.union([ViewerTokenScopeSchema, TokenScopeSchema]);
|
|
27016
|
-
var UserRecordSchema = z.object({
|
|
27017
|
-
id: z.string(),
|
|
27018
|
-
username: z.string(),
|
|
27019
|
-
passwordHash: z.string(),
|
|
27020
|
-
/**
|
|
27021
|
-
* Admin bypass. When true, the middleware skips the scope-access
|
|
27022
|
-
* check entirely. There is no other axis of privilege; the legacy
|
|
27023
|
-
* role enum collapsed onto this boolean in v2.
|
|
27024
|
-
*/
|
|
27025
|
-
isAdmin: z.boolean().default(false),
|
|
27026
|
-
allowedProviders: AllowedProviderSchema,
|
|
27027
|
-
allowedDevices: AllowedDevicesSchema,
|
|
27028
|
-
/**
|
|
27029
|
-
* Scopes granted to this user. Admins bypass; their `scopes` is
|
|
27030
|
-
* ignored. Non-admins without scopes are locked out of every
|
|
27031
|
-
* protected call.
|
|
27032
|
-
*/
|
|
27033
|
-
scopes: z.array(UserScopeSchema).default([]),
|
|
27034
|
-
createdAt: z.number(),
|
|
27035
|
-
updatedAt: z.number()
|
|
27036
|
-
});
|
|
27037
|
-
var ScopedTokenSchema = z.object({
|
|
27038
|
-
id: z.string(),
|
|
27039
|
-
userId: z.string(),
|
|
27040
|
-
name: z.string(),
|
|
27041
|
-
tokenHash: z.string(),
|
|
27042
|
-
tokenPrefix: z.string(),
|
|
27043
|
-
scopes: z.array(TokenScopeSchema),
|
|
27044
|
-
expiresAt: z.number().nullish(),
|
|
27045
|
-
lastUsedAt: z.number().nullish(),
|
|
27046
|
-
createdAt: z.number()
|
|
27047
|
-
});
|
|
27048
|
-
/** What a share-view grant lets its holder see. */
|
|
27049
|
-
var ShareViewGrantSchema = z.object({
|
|
27050
|
-
kind: z.enum(SHARE_VIEW_KINDS),
|
|
27051
|
-
deviceIds: z.array(z.number().int().nonnegative()).min(1).max(64),
|
|
27052
|
-
/** Talk-back, opt-in at mint time; absent means off. */
|
|
27053
|
-
talk: z.boolean().optional()
|
|
27054
|
-
});
|
|
27055
|
-
var ShareViewScopeSchema = z.object({
|
|
27056
|
-
type: z.literal("share-view"),
|
|
27057
|
-
grant: ShareViewGrantSchema
|
|
27058
|
-
});
|
|
27059
|
-
var AddonRoutesScopeSchema = z.object({
|
|
27060
|
-
type: z.literal("addon-routes"),
|
|
27061
|
-
access: z.array(MethodAccessSchema).min(1)
|
|
27062
|
-
});
|
|
27063
|
-
var PreferencesSelfScopeSchema = z.object({ type: z.literal("preferences-self") });
|
|
27064
|
-
var CredentialScopeSchema = z.union([
|
|
27065
|
-
z.literal("*"),
|
|
27066
|
-
ShareViewScopeSchema,
|
|
27067
|
-
AddonRoutesScopeSchema,
|
|
27068
|
-
PreferencesSelfScopeSchema,
|
|
27069
|
-
ViewerTokenScopeSchema,
|
|
27070
|
-
TokenScopeSchema
|
|
27071
|
-
]);
|
|
27072
|
-
/**
|
|
27073
|
-
* The `kind` claim of a unified token. It names the TOKEN FAMILY (so every
|
|
27074
|
-
* older gate that classifies a hub JWT refuses it — `classifyBearerPrincipal`
|
|
27075
|
-
* treats any `kind` it does not know as not-a-credential), never what the
|
|
27076
|
-
* token may do: that is its `scopes`, and only its `scopes`.
|
|
27077
|
-
*/
|
|
27078
|
-
var CREDENTIAL_TOKEN_KIND = "credential";
|
|
27079
|
-
/**
|
|
27080
|
-
* The `aud` claim every minted token is signed with (D895). The hub's raw JWT
|
|
27081
|
-
* verify (`AuthManager.verifyToken`, used by every surface that wants a LOGIN
|
|
27082
|
-
* session — the OAuth consent page, the session cookie, health, backups)
|
|
27083
|
-
* refuses a token carrying it, so a minted token — a share link above all —
|
|
27084
|
-
* can never be replayed as a person's session. Only the credential verifier's
|
|
27085
|
-
* own door (`verifyCredentialToken`) accepts it.
|
|
27086
|
-
*/
|
|
27087
|
-
var CREDENTIAL_TOKEN_AUDIENCE = "camstack:credential";
|
|
27088
|
-
/** Does a verified JWT payload belong to the minted-token family? */
|
|
27089
|
-
function isCredentialTokenPayload(payload) {
|
|
27090
|
-
if (payload === null || typeof payload !== "object") return false;
|
|
27091
|
-
const kind = Reflect.get(payload, "kind");
|
|
27092
|
-
const aud = Reflect.get(payload, "aud");
|
|
27093
|
-
return kind === "credential" || aud === "camstack:credential" || Array.isArray(aud) && aud.includes("camstack:credential");
|
|
27094
|
-
}
|
|
27095
|
-
/**
|
|
27096
|
-
* The claims of a unified token (`auth.mintToken`). It carries no `exp`: its
|
|
27097
|
-
* row (looked up by `jti` on every verify, for revocation) holds the ONE
|
|
27098
|
-
* expiry, so a share link can be extended and a JWT clock can never disagree
|
|
27099
|
-
* with the row.
|
|
27100
|
-
*/
|
|
27101
|
-
var CredentialTokenClaimsSchema = z.object({
|
|
27102
|
-
kind: z.literal(CREDENTIAL_TOKEN_KIND),
|
|
27103
|
-
sub: z.string().min(1),
|
|
27104
|
-
jti: z.string().min(16),
|
|
27105
|
-
scopes: z.array(CredentialScopeSchema).min(1)
|
|
27106
|
-
});
|
|
27107
|
-
/**
|
|
27108
|
-
* Per-user ACCOUNT preferences (D894): the hub-side half of the viewer's two
|
|
27109
|
-
* settings levels.
|
|
27110
|
-
*
|
|
27111
|
-
* - DEVICE settings never leave the phone.
|
|
27112
|
-
* - ACCOUNT settings live here: one row per `(user, namespace)`, private to
|
|
27113
|
-
* that user, synced across every device signed in as them, last write wins
|
|
27114
|
-
* unless the writer sends the revision it based its edit on.
|
|
27115
|
-
*
|
|
27116
|
-
* A setting lives in exactly ONE level; there are no overrides. The caller
|
|
27117
|
-
* never names a user: the hub stamps the principal's own id, admin included.
|
|
27118
|
-
*
|
|
27119
|
-
* The contract the client codes against is the `preferences.*` tRPC router
|
|
27120
|
-
* (`server/backend/src/api/core/preferences.router.ts`).
|
|
27121
|
-
*/
|
|
27122
|
-
/** `viewer.app`, `viewer.cameras`, `viewer.grids` … — lowercase, dot/dash separated. */
|
|
27123
|
-
var PREFERENCES_NAMESPACE_PATTERN = /^[a-z][a-z0-9.-]{0,63}$/;
|
|
27124
|
-
/** One row's value, measured as UTF-8 JSON. */
|
|
27125
|
-
var PREFERENCES_MAX_VALUE_BYTES = 256 * 1024;
|
|
27126
|
-
var PreferenceNamespaceSchema = z.string().regex(PREFERENCES_NAMESPACE_PATTERN);
|
|
27127
|
-
/** A namespace's value: a JSON object, opaque to the hub. */
|
|
27128
|
-
var PreferenceValueSchema = z.record(z.string(), z.unknown());
|
|
27129
|
-
var PreferenceDeviceIdSchema = z.string().min(1).max(64);
|
|
27130
|
-
/** A stored row, as the owner reads it. */
|
|
27131
|
-
var PreferenceRowSchema = z.object({
|
|
27132
|
-
namespace: PreferenceNamespaceSchema,
|
|
27133
|
-
value: PreferenceValueSchema,
|
|
27134
|
-
/** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
|
|
27135
|
-
revision: z.number().int().positive(),
|
|
27136
|
-
updatedAt: z.number().int(),
|
|
27137
|
-
/** The client id the last writer sent; `null` when it sent none. */
|
|
27138
|
-
updatedByDevice: PreferenceDeviceIdSchema.nullable()
|
|
27139
|
-
});
|
|
27140
|
-
z.object({
|
|
27141
|
-
/** Absent: every namespace the caller holds. */
|
|
27142
|
-
namespaces: z.array(PreferenceNamespaceSchema).max(32).optional() });
|
|
27143
|
-
z.object({ rows: z.array(PreferenceRowSchema) });
|
|
27144
|
-
z.object({
|
|
27145
|
-
namespace: PreferenceNamespaceSchema,
|
|
27146
|
-
value: PreferenceValueSchema,
|
|
27147
|
-
/**
|
|
27148
|
-
* The revision the edit was based on. Absent: last write wins. `0`: the
|
|
27149
|
-
* namespace must not exist yet. Any other value that is not the current
|
|
27150
|
-
* revision answers `conflict` and writes nothing.
|
|
27151
|
-
*/
|
|
27152
|
-
baseRevision: z.number().int().nonnegative().optional(),
|
|
27153
|
-
deviceId: PreferenceDeviceIdSchema.optional()
|
|
27154
|
-
});
|
|
27155
|
-
z.discriminatedUnion("status", [z.object({
|
|
27156
|
-
status: z.literal("saved"),
|
|
27157
|
-
row: PreferenceRowSchema
|
|
27158
|
-
}), z.object({
|
|
27159
|
-
status: z.literal("conflict"),
|
|
27160
|
-
current: PreferenceRowSchema.nullable()
|
|
27161
|
-
})]);
|
|
27162
|
-
z.object({ namespace: PreferenceNamespaceSchema });
|
|
27163
|
-
z.object({
|
|
27164
|
-
/** `false` when the namespace did not exist. */
|
|
27165
|
-
deleted: z.boolean() });
|
|
27166
|
-
z.object({
|
|
27167
|
-
/** The revision the client holds per namespace; a namespace it does not list is new to it. */
|
|
27168
|
-
revisionByNamespace: z.record(PreferenceNamespaceSchema, z.number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
|
|
27169
|
-
z.object({
|
|
27170
|
-
/** Every row whose revision differs from the client's, and every row it did not list. */
|
|
27171
|
-
rows: z.array(PreferenceRowSchema),
|
|
27172
|
-
/** Namespaces the client listed that no longer exist. */
|
|
27173
|
-
deleted: z.array(PreferenceNamespaceSchema)
|
|
27174
|
-
});
|
|
27175
|
-
z.enum(["new-session", "step-up"]);
|
|
27176
|
-
/** The languages the hub's app landing pages are written in (D858). */
|
|
27177
|
-
var AppPageLangSchema = z.enum(["en", "it"]);
|
|
27178
|
-
/** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
|
|
27179
|
-
var AppLoginPathSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("native") }), z.object({
|
|
27180
|
-
kind: z.literal("browser"),
|
|
27181
|
-
startPath: z.string().startsWith("/")
|
|
27182
|
-
})]);
|
|
27183
|
-
/**
|
|
27184
|
-
* Device certificates (D855) — the wire contract shared by the hub, the admin
|
|
27185
|
-
* UI and the native viewer.
|
|
27186
|
-
*
|
|
27187
|
-
* A device (a phone) generates its OWN P-256 key pair in hardware (Secure
|
|
27188
|
-
* Enclave / Android Keystore / a non-extractable WebCrypto key). The private
|
|
27189
|
-
* key never travels. The hub signs the PUBLIC key into an X.509 leaf under a
|
|
27190
|
-
* dedicated device CA; the device later proves possession of the key by
|
|
27191
|
-
* signing a hub-issued nonce, and the hub answers with the same session a
|
|
27192
|
-
* password login opens.
|
|
27193
|
-
*
|
|
27194
|
-
* Everything on the wire is a small string (a PEM, a base64url signature):
|
|
27195
|
-
* D613 is about bulk bytes, and a certificate is ~600 bytes.
|
|
27196
|
-
*/
|
|
27197
|
-
/** Signature algorithm of every device credential: ECDSA, curve P-256, SHA-256. */
|
|
27198
|
-
var DEVICE_CERT_SIGNATURE = "ecdsa-p256-sha256";
|
|
27199
|
-
/** First line of every signed message; a change of format bumps the version. */
|
|
27200
|
-
var DEVICE_SIGNATURE_MESSAGE_VERSION = "camstack-device-cert-v1";
|
|
27201
|
-
z.enum([
|
|
27202
|
-
"login",
|
|
27203
|
-
"renew",
|
|
27204
|
-
"revoke"
|
|
27205
|
-
]);
|
|
27206
|
-
/** One-shot enrollment code and login nonce lifetimes. */
|
|
27207
|
-
var DEVICE_ENROLLMENT_TTL_MS = 10 * 6e4;
|
|
27208
|
-
var DEVICE_NONCE_TTL_MS = 6e4;
|
|
27209
|
-
/** SAN URI prefixes of a device leaf. */
|
|
27210
|
-
var DEVICE_SAN_CREDENTIAL_PREFIX = "camstack:credential:";
|
|
27211
|
-
var DEVICE_SAN_USER_PREFIX = "camstack:user:";
|
|
27212
|
-
/**
|
|
27213
|
-
* The exact bytes a device signs (UTF-8, `\n` separators, no trailing newline):
|
|
27214
|
-
*
|
|
27215
|
-
* camstack-device-cert-v1
|
|
27216
|
-
* <login|renew>
|
|
27217
|
-
* <origin> the hub origin returned by `getDeviceChallenge`
|
|
27218
|
-
* <nonce>
|
|
27219
|
-
*
|
|
27220
|
-
* The origin is part of the message so a signature collected by a look-alike
|
|
27221
|
-
* hub is worthless on the real one; the hub additionally binds the nonce to
|
|
27222
|
-
* the origin it issued it for and refuses any other.
|
|
27223
|
-
*/
|
|
27224
|
-
function buildDeviceSignatureMessage(input) {
|
|
27225
|
-
return [
|
|
27226
|
-
DEVICE_SIGNATURE_MESSAGE_VERSION,
|
|
27227
|
-
input.purpose,
|
|
27228
|
-
input.origin,
|
|
27229
|
-
input.nonce
|
|
27230
|
-
].join("\n");
|
|
27231
|
-
}
|
|
27232
|
-
/** The deep link a QR carries: `camstack://enroll?hub=<origin>&code=<code>`. */
|
|
27233
|
-
function buildDeviceEnrollmentLink(input) {
|
|
27234
|
-
const query = new URLSearchParams();
|
|
27235
|
-
if (input.hub !== void 0) query.set("hub", input.hub);
|
|
27236
|
-
query.set("code", input.code);
|
|
27237
|
-
return `${input.scheme ?? "camstack"}://enroll?${query.toString()}`;
|
|
27238
|
-
}
|
|
27239
|
-
var DevicePlatformSchema = z.enum([
|
|
27240
|
-
"ios",
|
|
27241
|
-
"android",
|
|
27242
|
-
"web",
|
|
27243
|
-
"other"
|
|
27244
|
-
]);
|
|
27245
|
-
var Base64UrlSchema = z.string().min(1).max(4096).regex(/^[A-Za-z0-9_-]+$/);
|
|
27246
|
-
var PemSchema = z.string().min(1).max(16384);
|
|
27247
|
-
/**
|
|
27248
|
-
* Why a device-certificate endpoint said no. Distinct from a transport / 5xx
|
|
27249
|
-
* failure: those carry no reason and mean "try again", never "the credential is
|
|
27250
|
-
* dead". The viewer switches on this exhaustively.
|
|
27251
|
-
*/
|
|
27252
|
-
var DeviceRefusalReasonSchema = z.enum([
|
|
27253
|
-
"revoked",
|
|
27254
|
-
"unknown-credential",
|
|
27255
|
-
"expired",
|
|
27256
|
-
"bad-signature",
|
|
27257
|
-
"nonce-invalid",
|
|
27258
|
-
"rate-limited",
|
|
27259
|
-
"invalid-certificate",
|
|
27260
|
-
"superseded",
|
|
27261
|
-
"user-gone",
|
|
27262
|
-
"unavailable",
|
|
27263
|
-
"code-invalid",
|
|
27264
|
-
"self-enrollment-disabled",
|
|
27265
|
-
"step-up-required",
|
|
27266
|
-
"bad-public-key"
|
|
27267
|
-
]);
|
|
27268
|
-
var DeviceRefusalSchema = z.object({
|
|
27269
|
-
ok: z.literal(false),
|
|
27270
|
-
reason: DeviceRefusalReasonSchema,
|
|
27271
|
-
definitive: z.boolean(),
|
|
27272
|
-
retryAfterSeconds: z.number().optional()
|
|
27273
|
-
});
|
|
27274
|
-
z.object({
|
|
27275
|
-
code: z.string().min(1).max(256),
|
|
27276
|
-
/** SubjectPublicKeyInfo DER of the device's P-256 public key, base64url. */
|
|
27277
|
-
publicKeySpki: Base64UrlSchema,
|
|
27278
|
-
deviceName: z.string().min(1).max(80).optional(),
|
|
27279
|
-
platform: DevicePlatformSchema
|
|
27280
|
-
});
|
|
27281
|
-
var CompleteEnrollmentOutputSchema = z.object({
|
|
27282
|
-
credentialId: z.string(),
|
|
27283
|
-
certPem: PemSchema,
|
|
27284
|
-
/** The device CA certificate the leaf chains to. */
|
|
27285
|
-
chainPem: PemSchema,
|
|
27286
|
-
notAfter: z.number(),
|
|
27287
|
-
user: z.object({
|
|
27288
|
-
id: z.string(),
|
|
27289
|
-
username: z.string()
|
|
27290
|
-
})
|
|
27291
|
-
});
|
|
27292
|
-
z.discriminatedUnion("ok", [CompleteEnrollmentOutputSchema.extend({ ok: z.literal(true) }), DeviceRefusalSchema]);
|
|
27293
|
-
z.object({
|
|
27294
|
-
/** The single-use step-up proof (`auth.deviceEnrollProofFrom…`). */
|
|
27295
|
-
proof: z.string().min(1).max(512),
|
|
27296
|
-
publicKeySpki: Base64UrlSchema,
|
|
27297
|
-
deviceName: z.string().min(1).max(80),
|
|
27298
|
-
platform: DevicePlatformSchema
|
|
27299
|
-
});
|
|
27300
|
-
z.object({
|
|
27301
|
-
proof: z.string(),
|
|
27302
|
-
expiresAt: z.number()
|
|
27303
|
-
});
|
|
27304
|
-
var DeviceChallengeSchema = z.object({
|
|
27305
|
-
nonce: z.string(),
|
|
27306
|
-
/** The origin to put in the signed message. The app compares it to the hub it dialled. */
|
|
27307
|
-
origin: z.string(),
|
|
27308
|
-
expiresAt: z.number(),
|
|
27309
|
-
signature: z.literal(DEVICE_CERT_SIGNATURE)
|
|
27310
|
-
});
|
|
27311
|
-
z.discriminatedUnion("ok", [DeviceChallengeSchema.extend({ ok: z.literal(true) }), DeviceRefusalSchema]);
|
|
27312
|
-
z.object({
|
|
27313
|
-
certPem: PemSchema,
|
|
27314
|
-
nonce: z.string().min(1).max(256),
|
|
27315
|
-
/** ECDSA P-256 SHA-256 over {@link buildDeviceSignatureMessage}; raw r||s or DER, base64url. */
|
|
27316
|
-
signature: Base64UrlSchema
|
|
27317
|
-
});
|
|
27318
|
-
var RenewDeviceCertificateOutputSchema = z.object({
|
|
27319
|
-
credentialId: z.string(),
|
|
27320
|
-
certPem: PemSchema,
|
|
27321
|
-
chainPem: PemSchema,
|
|
27322
|
-
notAfter: z.number()
|
|
27323
|
-
});
|
|
27324
|
-
z.discriminatedUnion("ok", [RenewDeviceCertificateOutputSchema.extend({ ok: z.literal(true) }), DeviceRefusalSchema]);
|
|
27325
|
-
z.discriminatedUnion("ok", [z.object({
|
|
27326
|
-
ok: z.literal(true),
|
|
27327
|
-
credentialId: z.string(),
|
|
27328
|
-
sessionsEnded: z.number().int()
|
|
27329
|
-
}), DeviceRefusalSchema]);
|
|
27330
|
-
function formatDeviceRevoker(revoker) {
|
|
27331
|
-
return revoker.kind === "device" ? "device" : `${revoker.kind}:${revoker.userId}`;
|
|
27332
|
-
}
|
|
27333
|
-
var DeviceCredentialStatusSchema = z.enum([
|
|
27334
|
-
"active",
|
|
27335
|
-
"expired",
|
|
27336
|
-
"revoked"
|
|
27337
|
-
]);
|
|
27338
|
-
var DeviceCredentialSchema = z.object({
|
|
27339
|
-
id: z.string(),
|
|
27340
|
-
userId: z.string(),
|
|
27341
|
-
username: z.string().nullable(),
|
|
27342
|
-
deviceName: z.string(),
|
|
27343
|
-
platform: DevicePlatformSchema,
|
|
27344
|
-
enrolledVia: z.enum(["qr", "self"]),
|
|
27345
|
-
/** SHA-256 of the leaf certificate DER, colon-hex. */
|
|
27346
|
-
fingerprint: z.string(),
|
|
27347
|
-
issuedAt: z.number(),
|
|
27348
|
-
expiresAt: z.number(),
|
|
27349
|
-
lastUsedAt: z.number().nullable(),
|
|
27350
|
-
lastUsedFrom: z.string().nullable(),
|
|
27351
|
-
revokedAt: z.number().nullable(),
|
|
27352
|
-
/** `admin:<userId>` | `user:<userId>` | `device` | `user-deleted`. */
|
|
27353
|
-
revokedBy: z.string().nullable(),
|
|
27354
|
-
status: DeviceCredentialStatusSchema
|
|
27355
|
-
});
|
|
27356
|
-
var StartEnrollmentOutputSchema = z.object({
|
|
27357
|
-
/** Shown once; only its hash is kept. */
|
|
27358
|
-
code: z.string(),
|
|
27359
|
-
expiresAt: z.number(),
|
|
27360
|
-
/** `camstack://enroll?hub=…&code=…` — what the QR encodes. */
|
|
27361
|
-
enrollUrl: z.string(),
|
|
27362
|
-
/** The hub origin in the link, or `null` when the hub could not name one (the link then has no `hub`). */
|
|
27363
|
-
hubOrigin: z.string().nullable(),
|
|
27364
|
-
/** Every origin the apps may try (role `appConnections`). */
|
|
27365
|
-
hubOrigins: z.array(z.string())
|
|
27366
|
-
});
|
|
27367
|
-
z.object({
|
|
27368
|
-
kind: z.literal("device-certificate"),
|
|
27369
|
-
id: z.literal("device-certificate"),
|
|
27370
|
-
label: z.string(),
|
|
27371
|
-
stage: z.literal("primary"),
|
|
27372
|
-
/** tRPC paths under the hub's `auth` router, so a client names no literal. */
|
|
27373
|
-
challengePath: z.literal("auth.getDeviceChallenge"),
|
|
27374
|
-
revokePath: z.literal("auth.revokeOwnDeviceCertificate"),
|
|
27375
|
-
enrollSelfPath: z.literal("auth.enrollSelf"),
|
|
27376
|
-
loginPath: z.literal("auth.loginWithDeviceCertificate"),
|
|
27377
|
-
renewPath: z.literal("auth.renewDeviceCertificate"),
|
|
27378
|
-
signature: z.literal(DEVICE_CERT_SIGNATURE),
|
|
27379
|
-
messageVersion: z.literal(DEVICE_SIGNATURE_MESSAGE_VERSION),
|
|
27380
|
-
/** Which clients can execute it: a native app silently, a browser with a non-extractable WebCrypto key. */
|
|
27381
|
-
clients: z.array(z.enum(["native", "web"])),
|
|
27382
|
-
/** The app executes it itself, silently (D858). */
|
|
27383
|
-
app: AppLoginPathSchema.nullable()
|
|
27384
|
-
});
|
|
27385
26609
|
/** Lucide category ids, alphabetical. `ICON_META` indexes into this. */
|
|
27386
26610
|
var ICON_CATEGORY_IDS = [
|
|
27387
26611
|
"accessibility",
|
|
@@ -47195,93 +46419,1229 @@ var ICON_SYNONYMS = {
|
|
|
47195
46419
|
]
|
|
47196
46420
|
};
|
|
47197
46421
|
/**
|
|
47198
|
-
* Spellings an operator may already have PERSISTED that no lucide package
|
|
47199
|
-
* accepts any more, and the catalog key they draw. They resolve
|
|
47200
|
-
* (`canonicalIconKey`) but are never offered. `gauge2` was this repo's own
|
|
47201
|
-
* pre-catalog spelling of `gauge`.
|
|
46422
|
+
* Spellings an operator may already have PERSISTED that no lucide package
|
|
46423
|
+
* accepts any more, and the catalog key they draw. They resolve
|
|
46424
|
+
* (`canonicalIconKey`) but are never offered. `gauge2` was this repo's own
|
|
46425
|
+
* pre-catalog spelling of `gauge`.
|
|
46426
|
+
*/
|
|
46427
|
+
var LEGACY_ICON_ALIASES = { gauge2: "gauge" };
|
|
46428
|
+
/**
|
|
46429
|
+
* icon-catalog — THE icon vocabulary (D854).
|
|
46430
|
+
*
|
|
46431
|
+
* Every place that picks or stores an icon — a device's display override, a
|
|
46432
|
+
* location, a site zone, a viewer accessory, an `icon` settings field — names
|
|
46433
|
+
* it by a key of this catalog and nothing else. There is no curated subset and
|
|
46434
|
+
* no second list: the catalog is every lucide icon that both surfaces can draw
|
|
46435
|
+
* (the admin UI's `lucide-react` and the viewer's `lucide-react-native`), the
|
|
46436
|
+
* intersection computed by `scripts/generate-icon-catalog.ts` into the
|
|
46437
|
+
* committed `icon-catalog.generated.ts`.
|
|
46438
|
+
*
|
|
46439
|
+
* Like the vocabularies it replaces, this module holds STRINGS only — no React,
|
|
46440
|
+
* no lucide import, no glyph. Each surface owns its glyph table (the web one
|
|
46441
|
+
* lives in `ui-library`, loaded lazily), and a test on each side pins that it
|
|
46442
|
+
* covers {@link ICON_KEYS}.
|
|
46443
|
+
*
|
|
46444
|
+
* ## What is persisted
|
|
46445
|
+
*
|
|
46446
|
+
* The canonical kebab-case lucide id ({@link IconKey}). Spellings that a lucide
|
|
46447
|
+
* package still accepts (`home` for `house`) and this repo's own legacy ones
|
|
46448
|
+
* (`gauge2`) RESOLVE ({@link canonicalIconKey}) so a stored value never goes
|
|
46449
|
+
* stale, but they are never OFFERED by search.
|
|
46450
|
+
*
|
|
46451
|
+
* ## Search
|
|
46452
|
+
*
|
|
46453
|
+
* Over the key, the Italian/English overlay in `icon-synonyms.ts`, any words
|
|
46454
|
+
* the caller adds, and lucide's English tags — in that order of weight.
|
|
46455
|
+
*/
|
|
46456
|
+
var KEY_SET$2 = new Set(ICON_KEYS);
|
|
46457
|
+
var ALIAS_TO_KEY = new Map([...Object.entries(ICON_ALIASES), ...Object.entries(LEGACY_ICON_ALIASES)]);
|
|
46458
|
+
/** Is this a canonical key of the catalog? (An alias is not — see {@link canonicalIconKey}.) */
|
|
46459
|
+
function isIconKey(value) {
|
|
46460
|
+
return typeof value === "string" && KEY_SET$2.has(value);
|
|
46461
|
+
}
|
|
46462
|
+
/**
|
|
46463
|
+
* A stored value as a catalog key: the key itself, the key a still-accepted or
|
|
46464
|
+
* legacy spelling stands for, or `undefined` — never a guess.
|
|
46465
|
+
*/
|
|
46466
|
+
function canonicalIconKey(value) {
|
|
46467
|
+
if (typeof value !== "string") return void 0;
|
|
46468
|
+
if (isIconKey(value)) return value;
|
|
46469
|
+
return ALIAS_TO_KEY.get(value);
|
|
46470
|
+
}
|
|
46471
|
+
/**
|
|
46472
|
+
* Wire/storage schema for one icon key.
|
|
46473
|
+
*
|
|
46474
|
+
* Deliberately NOT a `z.enum` of the catalog: ~1,700 literals would be inlined
|
|
46475
|
+
* into every cap router, type and API-reference row that carries an icon. The
|
|
46476
|
+
* check is membership in the catalog and the type is {@link IconKey}.
|
|
46477
|
+
*/
|
|
46478
|
+
var IconKeySchema = z.custom(isIconKey, "Not an icon of the catalog");
|
|
46479
|
+
var ENTRIES = ICON_KEYS.map((key, index) => {
|
|
46480
|
+
const [categoryIndexes, tags] = ICON_META[index] ?? [[], []];
|
|
46481
|
+
const categories = categoryIndexes.flatMap((i) => {
|
|
46482
|
+
const id = ICON_CATEGORY_IDS[i];
|
|
46483
|
+
return id === void 0 ? [] : [id];
|
|
46484
|
+
});
|
|
46485
|
+
return {
|
|
46486
|
+
key,
|
|
46487
|
+
categories,
|
|
46488
|
+
primaryCategory: categories[0] ?? ICON_CATEGORY_IDS[0],
|
|
46489
|
+
tags,
|
|
46490
|
+
synonyms: ICON_SYNONYMS[key] ?? []
|
|
46491
|
+
};
|
|
46492
|
+
});
|
|
46493
|
+
new Map(ENTRIES.map((e) => [e.key, e]));
|
|
46494
|
+
/** Categories a picker offers first: the ones this product's icons mostly live in. */
|
|
46495
|
+
var LEADING_CATEGORIES = [
|
|
46496
|
+
"devices",
|
|
46497
|
+
"home",
|
|
46498
|
+
"security",
|
|
46499
|
+
"buildings",
|
|
46500
|
+
"connectivity",
|
|
46501
|
+
"multimedia",
|
|
46502
|
+
"nature",
|
|
46503
|
+
"weather",
|
|
46504
|
+
"transportation",
|
|
46505
|
+
"animals"
|
|
46506
|
+
];
|
|
46507
|
+
var PRIMARY_CATEGORIES = new Set(ENTRIES.map((e) => e.primaryCategory));
|
|
46508
|
+
[...LEADING_CATEGORIES, ...ICON_CATEGORY_IDS.filter((c) => !LEADING_CATEGORIES.includes(c))].filter((c) => PRIMARY_CATEGORIES.has(c));
|
|
46509
|
+
/** One tag name: trimmed, 1..40 characters. */
|
|
46510
|
+
var TagNameSchema = z.string().trim().min(1).max(40);
|
|
46511
|
+
/** The `tags` field every owner record carries. Absent = no tags. */
|
|
46512
|
+
var TagsFieldSchema = z.array(TagNameSchema).max(20);
|
|
46513
|
+
/** Fixed tag palette ids (map to `--color-tag-*` theme tokens, never a hex). */
|
|
46514
|
+
var TAG_COLOR_IDS = [
|
|
46515
|
+
"tag-a",
|
|
46516
|
+
"tag-b",
|
|
46517
|
+
"tag-c",
|
|
46518
|
+
"tag-d",
|
|
46519
|
+
"tag-e",
|
|
46520
|
+
"tag-f",
|
|
46521
|
+
"tag-g",
|
|
46522
|
+
"tag-h"
|
|
46523
|
+
];
|
|
46524
|
+
var TagColorIdSchema = z.enum(TAG_COLOR_IDS);
|
|
46525
|
+
var TagStyleSchema = z.object({
|
|
46526
|
+
name: TagNameSchema,
|
|
46527
|
+
color: TagColorIdSchema,
|
|
46528
|
+
icon: IconKeySchema
|
|
46529
|
+
});
|
|
46530
|
+
/** The comparison key of a tag: trimmed and lower-cased. */
|
|
46531
|
+
function tagKey(name) {
|
|
46532
|
+
return name.trim().toLowerCase();
|
|
46533
|
+
}
|
|
46534
|
+
/** Two tag names are the same tag. */
|
|
46535
|
+
function sameTag(a, b) {
|
|
46536
|
+
return tagKey(a) === tagKey(b);
|
|
46537
|
+
}
|
|
46538
|
+
/** Stable FNV-1a hash of the tag key → one palette slot. */
|
|
46539
|
+
function hashTagKey(key) {
|
|
46540
|
+
let h = 2166136261;
|
|
46541
|
+
for (let i = 0; i < key.length; i++) {
|
|
46542
|
+
h ^= key.charCodeAt(i);
|
|
46543
|
+
h = Math.imul(h, 16777619);
|
|
46544
|
+
}
|
|
46545
|
+
return h >>> 0;
|
|
46546
|
+
}
|
|
46547
|
+
/** The colour a tag shows until the operator styles it (same name → same colour, case-insensitively). */
|
|
46548
|
+
function defaultTagColorId(name) {
|
|
46549
|
+
const id = TAG_COLOR_IDS[hashTagKey(tagKey(name)) % TAG_COLOR_IDS.length];
|
|
46550
|
+
if (id !== void 0) return id;
|
|
46551
|
+
return "tag-a";
|
|
46552
|
+
}
|
|
46553
|
+
/** Trim, drop empty, dedupe case-insensitively keeping the first spelling. */
|
|
46554
|
+
function normalizeTags(tags) {
|
|
46555
|
+
const seen = /* @__PURE__ */ new Set();
|
|
46556
|
+
const out = [];
|
|
46557
|
+
for (const raw of tags) {
|
|
46558
|
+
const name = raw.trim();
|
|
46559
|
+
if (name.length === 0) continue;
|
|
46560
|
+
const key = tagKey(name);
|
|
46561
|
+
if (seen.has(key)) continue;
|
|
46562
|
+
seen.add(key);
|
|
46563
|
+
out.push(name);
|
|
46564
|
+
}
|
|
46565
|
+
return out;
|
|
46566
|
+
}
|
|
46567
|
+
/** `tags` with every spelling of `from` replaced by `to` (deduped), or `null` when it did not carry `from`. */
|
|
46568
|
+
function renameInTags(tags, from, to) {
|
|
46569
|
+
if (!tags.some((t) => sameTag(t, from))) return null;
|
|
46570
|
+
return normalizeTags(tags.map((t) => sameTag(t, from) ? to : t));
|
|
46571
|
+
}
|
|
46572
|
+
/** `tags` without `name`, or `null` when it did not carry it. */
|
|
46573
|
+
function removeFromTags(tags, name) {
|
|
46574
|
+
if (!tags.some((t) => sameTag(t, name))) return null;
|
|
46575
|
+
return tags.filter((t) => !sameTag(t, name));
|
|
46576
|
+
}
|
|
46577
|
+
var ClipModelMetaSchema = z.object({
|
|
46578
|
+
/** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
|
|
46579
|
+
textModelId: z.string().min(1),
|
|
46580
|
+
/** Output dimension of BOTH towers. A vector of any other length is refused. */
|
|
46581
|
+
embeddingDim: z.number().int().positive(),
|
|
46582
|
+
/**
|
|
46583
|
+
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
46584
|
+
* per index: two models share an index only when their vectors are ranked
|
|
46585
|
+
* against each other, which for CLIP means never across families. Every
|
|
46586
|
+
* model gets its own.
|
|
46587
|
+
*/
|
|
46588
|
+
vectorIndex: z.string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
|
|
46589
|
+
/**
|
|
46590
|
+
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
46591
|
+
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
46592
|
+
* models directory, so two different tokenizers under the same name would
|
|
46593
|
+
* silently overwrite each other (whichever model downloaded last wins, and
|
|
46594
|
+
* the other one tokenises with the wrong vocabulary).
|
|
46595
|
+
*/
|
|
46596
|
+
tokenizerFile: z.string().min(1),
|
|
46597
|
+
/** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
|
|
46598
|
+
contextLength: z.number().int().positive(),
|
|
46599
|
+
/** Id the tokenizer pads with. */
|
|
46600
|
+
padId: z.number().int().nonnegative(),
|
|
46601
|
+
/**
|
|
46602
|
+
* The search cosine floor at `strictness: 'loose'` — calibrated per model,
|
|
46603
|
+
* because cosine bands are a property of the model: 0.2 keeps 96% of matched
|
|
46604
|
+
* COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
|
|
46605
|
+
*/
|
|
46606
|
+
searchMinScore: z.number().min(0).max(1)
|
|
46607
|
+
});
|
|
46608
|
+
var ClipSearchStrictnessSchema = z.enum([
|
|
46609
|
+
"loose",
|
|
46610
|
+
"balanced",
|
|
46611
|
+
"strict"
|
|
46612
|
+
]);
|
|
46613
|
+
/** Steps whose effect a root label can BE. */
|
|
46614
|
+
var LABEL_SUPPLY_STEP_IDS = [
|
|
46615
|
+
"animal-classifier",
|
|
46616
|
+
"vehicle-classifier",
|
|
46617
|
+
"package-detection"
|
|
46618
|
+
];
|
|
46619
|
+
/** Steps whose box a root detection can BE. */
|
|
46620
|
+
var CROP_SUPPLY_STEP_IDS = ["plate-detection", "face-detection"];
|
|
46621
|
+
/**
|
|
46622
|
+
* Steps whose per-detection MASK a root detection can carry (D737). The live
|
|
46623
|
+
* mask step is `segmentation` — a frame-plane refiner that runs its own model
|
|
46624
|
+
* once per detection crop. (`instance-segmentation` is a dormant step id that
|
|
46625
|
+
* no camera tree carries.)
|
|
46626
|
+
*/
|
|
46627
|
+
var MASK_SUPPLY_STEP_IDS = ["segmentation"];
|
|
46628
|
+
[
|
|
46629
|
+
...LABEL_SUPPLY_STEP_IDS,
|
|
46630
|
+
...CROP_SUPPLY_STEP_IDS,
|
|
46631
|
+
...MASK_SUPPLY_STEP_IDS
|
|
46632
|
+
];
|
|
46633
|
+
/**
|
|
46634
|
+
* Multi-file format payload.
|
|
46635
|
+
*
|
|
46636
|
+
* - Directory formats (`isDirectory: true`, e.g. `.mlpackage`): files
|
|
46637
|
+
* relative to the directory root — the downloader fetches each from
|
|
46638
|
+
* `{url}/{file}` into `{modelDir}/{file}`. If omitted, it probes the
|
|
46639
|
+
* HuggingFace API (slower).
|
|
46640
|
+
* - Single-file formats (no `isDirectory`, e.g. OpenVINO IR): sibling
|
|
46641
|
+
* files fetched from the SAME remote directory as `url` and stored flat
|
|
46642
|
+
* alongside the main file — e.g. `['camstack-yolov9t.bin']` for the IR
|
|
46643
|
+
* weights next to `camstack-yolov9t.xml`.
|
|
46644
|
+
*/
|
|
46645
|
+
var ModelFormatEntrySchema = z.object({
|
|
46646
|
+
url: z.string(),
|
|
46647
|
+
sizeMB: z.number(),
|
|
46648
|
+
/** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
|
|
46649
|
+
isDirectory: z.boolean().optional(),
|
|
46650
|
+
/** Multi-file payload (directory members or sibling files). */
|
|
46651
|
+
files: z.array(z.string()).readonly().optional(),
|
|
46652
|
+
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
46653
|
+
runtimes: z.array(z.enum(["python"])).readonly().optional(),
|
|
46654
|
+
/**
|
|
46655
|
+
* Content revision of the artefact, for one hosted OFF the CamStack mirror.
|
|
46656
|
+
* A format on the mirror leaves it unset: its revision (the sha256 of its
|
|
46657
|
+
* weight file) comes from the downloader's generated table, kept in step
|
|
46658
|
+
* with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
|
|
46659
|
+
* node records the revision it downloaded next to the file
|
|
46660
|
+
* (`<file>.revision`); a copy with no record or a different one is stale
|
|
46661
|
+
* unless its weight file hashes to the revision, and a stale copy is
|
|
46662
|
+
* downloaded again, the old one serving until the new one is complete. No
|
|
46663
|
+
* revision at all ⇒ a file on disk is current, whatever it holds (D743).
|
|
46664
|
+
*/
|
|
46665
|
+
revision: z.string().min(1).optional()
|
|
46666
|
+
});
|
|
46667
|
+
/**
|
|
46668
|
+
* What a node holds for one (model, format) (D746). `current` is a complete
|
|
46669
|
+
* copy at its catalog revision — exactly what `downloaded: true` means.
|
|
46670
|
+
* `stale` is bytes on disk that are not (yet) proven current under D743/D744:
|
|
46671
|
+
* no or a different revision record, or a missing sibling. `missing` is no
|
|
46672
|
+
* copy. `downloaded` alone folds `stale` into "not downloaded", which hid
|
|
46673
|
+
* reclaimable bytes and a copy about to be replaced.
|
|
46674
|
+
*/
|
|
46675
|
+
var ModelOnDiskStateSchema = z.enum([
|
|
46676
|
+
"current",
|
|
46677
|
+
"stale",
|
|
46678
|
+
"missing"
|
|
46679
|
+
]);
|
|
46680
|
+
/**
|
|
46681
|
+
* The numeric precision of one format's BUILD (D746) — reported only when the
|
|
46682
|
+
* build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
|
|
46683
|
+
* CamStack Core ML export). Absent means "not stated", never "fp32".
|
|
46684
|
+
*/
|
|
46685
|
+
var ModelFormatPrecisionSchema = z.enum([
|
|
46686
|
+
"fp32",
|
|
46687
|
+
"fp16",
|
|
46688
|
+
"int8"
|
|
46689
|
+
]);
|
|
46690
|
+
/**
|
|
46691
|
+
* One format of one model as a node's `pipelineExecutor.getSchema` reports it.
|
|
46692
|
+
* `onDisk` / `precision` are optional for version skew: a runner that predates
|
|
46693
|
+
* them omits them, and a reader falls back to `downloaded`.
|
|
46694
|
+
*/
|
|
46695
|
+
var PipelineModelFormatStatusSchema = z.object({
|
|
46696
|
+
downloaded: z.boolean(),
|
|
46697
|
+
sizeMB: z.number(),
|
|
46698
|
+
onDisk: ModelOnDiskStateSchema.optional(),
|
|
46699
|
+
precision: ModelFormatPrecisionSchema.optional()
|
|
46700
|
+
});
|
|
46701
|
+
/**
|
|
46702
|
+
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
46703
|
+
* The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
|
|
46704
|
+
*/
|
|
46705
|
+
var ModelExtraFileSchema = z.object({
|
|
46706
|
+
url: z.string(),
|
|
46707
|
+
filename: z.string(),
|
|
46708
|
+
sizeMB: z.number()
|
|
46709
|
+
});
|
|
46710
|
+
/**
|
|
46711
|
+
* Per-format payload map. Modelled as an explicit object (one optional key
|
|
46712
|
+
* per `ModelFormat`) rather than `z.record(enum, …)` — zod v4's enum-keyed
|
|
46713
|
+
* record requires every key, but a catalog entry only ships a subset of
|
|
46714
|
+
* formats.
|
|
46715
|
+
*/
|
|
46716
|
+
var ModelFormatsSchema = z.object({
|
|
46717
|
+
onnx: ModelFormatEntrySchema.optional(),
|
|
46718
|
+
coreml: ModelFormatEntrySchema.optional(),
|
|
46719
|
+
openvino: ModelFormatEntrySchema.optional(),
|
|
46720
|
+
tflite: ModelFormatEntrySchema.optional(),
|
|
46721
|
+
pt: ModelFormatEntrySchema.optional(),
|
|
46722
|
+
gguf: ModelFormatEntrySchema.optional()
|
|
46723
|
+
});
|
|
46724
|
+
/**
|
|
46725
|
+
* Variant-selector grouping axes. Shared by the full `ModelCatalogEntry` and by
|
|
46726
|
+
* the reduced `PipelineModelOption` returned in `pipeline.getSchema()` so the
|
|
46727
|
+
* grouped Family→Tier→Variant picker renders identically in the config UI and
|
|
46728
|
+
* in the pipeline/device steppers. The flat `id` stays the source of truth for
|
|
46729
|
+
* resolution/download/persistence; this is a presentation overlay resolved back
|
|
46730
|
+
* to an `id`.
|
|
46731
|
+
*/
|
|
46732
|
+
var ModelVariantGroupSchema = z.object({
|
|
46733
|
+
/** Top-level family, e.g. `yolo26` (later `d-fine`, `rf-detr`). */
|
|
46734
|
+
family: z.string(),
|
|
46735
|
+
/** Size within the family, e.g. `n` | `s` | `m` | `l`. */
|
|
46736
|
+
tier: z.string(),
|
|
46737
|
+
/** Quantization axis. Omit ⇒ the fp32 base build. */
|
|
46738
|
+
precision: z.enum(["fp32", "int8"]).optional(),
|
|
46739
|
+
/**
|
|
46740
|
+
* Training / latency-variant axis. Omit ⇒ the standard build. `test` marks
|
|
46741
|
+
* an alternate training of the same family (plugin catalog `relu_test`); chip
|
|
46742
|
+
* label is "Test".
|
|
46743
|
+
*/
|
|
46744
|
+
optimization: z.enum(["standard", "test"]).optional(),
|
|
46745
|
+
/**
|
|
46746
|
+
* Input-resolution axis (square input side, px). Omit ⇒ the family's native
|
|
46747
|
+
* resolution (640 for yolo26). Reduced-input builds (320 / 256) are a big,
|
|
46748
|
+
* cheap latency lever — especially on Apple ANE and the Intel N100 — at a
|
|
46749
|
+
* small-object accuracy cost. Mirrors the model's `inputSize` but lifted onto
|
|
46750
|
+
* the group so the selector can offer it as a variant axis.
|
|
46751
|
+
*/
|
|
46752
|
+
resolution: z.number().int().positive().optional()
|
|
46753
|
+
});
|
|
46754
|
+
var ModelProviderIdSchema = z.enum([
|
|
46755
|
+
"camstack",
|
|
46756
|
+
"frigate",
|
|
46757
|
+
"scrypted",
|
|
46758
|
+
"custom"
|
|
46759
|
+
]);
|
|
46760
|
+
var ModelLicenseRecordSchema = z.object({
|
|
46761
|
+
/** SPDX id of the WEIGHTS' terms, a `LicenseRef-*` for non-SPDX terms, or `UNKNOWN`. */
|
|
46762
|
+
weights: z.string().min(1),
|
|
46763
|
+
/** SPDX id of the upstream code that defines / trained the network. */
|
|
46764
|
+
code: z.string().min(1).optional(),
|
|
46765
|
+
/** Training data whose terms add obligations (attribution, non-commercial). */
|
|
46766
|
+
data: z.object({
|
|
46767
|
+
name: z.string().min(1),
|
|
46768
|
+
terms: z.string().min(1),
|
|
46769
|
+
url: z.string().url().optional()
|
|
46770
|
+
}).optional(),
|
|
46771
|
+
/** The project the weights come from. Required on built-in entries (guard). */
|
|
46772
|
+
upstream: z.object({
|
|
46773
|
+
name: z.string().min(1),
|
|
46774
|
+
url: z.string().url()
|
|
46775
|
+
}).optional(),
|
|
46776
|
+
/** Where the licence text governing the weights is published. */
|
|
46777
|
+
url: z.string().url().optional(),
|
|
46778
|
+
/** Attribution the licence REQUIRES, verbatim. */
|
|
46779
|
+
attribution: z.string().min(1).optional(),
|
|
46780
|
+
/** What CamStack changed. Required when `hosting` is `camstack-hf` (guard). */
|
|
46781
|
+
modifications: z.string().min(1).optional(),
|
|
46782
|
+
/** Who serves the file a node downloads. */
|
|
46783
|
+
hosting: z.enum([
|
|
46784
|
+
"camstack-hf",
|
|
46785
|
+
"third-party",
|
|
46786
|
+
"built-in"
|
|
46787
|
+
]).optional(),
|
|
46788
|
+
/** True when the weights or their data forbid commercial use. */
|
|
46789
|
+
nonCommercial: z.boolean().optional()
|
|
46790
|
+
});
|
|
46791
|
+
/**
|
|
46792
|
+
* The licence of a model, as a record rather than a bare SPDX string: a
|
|
46793
|
+
* permissive CODE licence routinely sits on top of restrictive WEIGHTS or
|
|
46794
|
+
* DATA, and the obligations (attribution, modification notices, source offers)
|
|
46795
|
+
* are per upstream. A persisted custom-model row written when this field was a
|
|
46796
|
+
* string still parses — the string is lifted into `{ weights }`.
|
|
46797
|
+
*
|
|
46798
|
+
* Every machine licence surface (`THIRD_PARTY_MODELS.md`, the Hugging Face
|
|
46799
|
+
* model table) is GENERATED from these records by
|
|
46800
|
+
* `scripts/gen-model-licenses.ts` (D661). Operator-facing docs live in
|
|
46801
|
+
* `camstack/docs` → `/docs/detection/models`.
|
|
47202
46802
|
*/
|
|
47203
|
-
var
|
|
46803
|
+
var ModelLicenseSchema = z.preprocess((value) => typeof value === "string" ? { weights: value } : value, ModelLicenseRecordSchema);
|
|
47204
46804
|
/**
|
|
47205
|
-
*
|
|
46805
|
+
* One step a ROOT detector can supply from its own output (D730) — see
|
|
46806
|
+
* `ModelCatalogEntry.suppliesSteps`.
|
|
47206
46807
|
*
|
|
47207
|
-
*
|
|
47208
|
-
*
|
|
47209
|
-
*
|
|
47210
|
-
*
|
|
47211
|
-
*
|
|
47212
|
-
*
|
|
47213
|
-
*
|
|
46808
|
+
* - `label`: the root's raw class IS the step's answer. `labelToEffect` maps
|
|
46809
|
+
* the root's label to the step's vocabulary; `uncovered` is the vocabulary
|
|
46810
|
+
* the root cannot produce (shown as unavailable, never a blocker).
|
|
46811
|
+
* - `crop`: the root draws the box the step would have found (`license_plate`
|
|
46812
|
+
* for plate-detection, `face` for face-detection). The box becomes a detail
|
|
46813
|
+
* child of the `parentMacro` detection that contains it — never a track.
|
|
46814
|
+
* - `mask`: the root's decode emits an instance mask with every detection (a
|
|
46815
|
+
* YOLO26-seg root, D737) — the `segmentation` step's result, carried on the
|
|
46816
|
+
* detection in the shape that step produces. Derived from the model's
|
|
46817
|
+
* postprocessor on read, never stored by an import.
|
|
46818
|
+
*/
|
|
46819
|
+
var RootStepSupplySchema = z.discriminatedUnion("kind", [
|
|
46820
|
+
z.object({
|
|
46821
|
+
kind: z.literal("label"),
|
|
46822
|
+
stepId: z.enum(LABEL_SUPPLY_STEP_IDS),
|
|
46823
|
+
labelToEffect: z.record(z.string(), z.string()),
|
|
46824
|
+
uncovered: z.array(z.string()).readonly()
|
|
46825
|
+
}),
|
|
46826
|
+
z.object({
|
|
46827
|
+
kind: z.literal("crop"),
|
|
46828
|
+
stepId: z.enum(CROP_SUPPLY_STEP_IDS),
|
|
46829
|
+
rootLabels: z.array(z.string()).readonly(),
|
|
46830
|
+
parentMacro: z.enum(["vehicle", "person"]),
|
|
46831
|
+
childClass: z.enum(["plate", "face"]),
|
|
46832
|
+
/**
|
|
46833
|
+
* The root's smaller input side, stamped on read by `rootSuppliesOf` from
|
|
46834
|
+
* the model entry — what a step's `minRootInputPx` gate judges. Never
|
|
46835
|
+
* stored by an import.
|
|
46836
|
+
*/
|
|
46837
|
+
rootInputPx: z.number().int().positive().optional()
|
|
46838
|
+
}),
|
|
46839
|
+
z.object({
|
|
46840
|
+
kind: z.literal("mask"),
|
|
46841
|
+
stepId: z.enum(MASK_SUPPLY_STEP_IDS)
|
|
46842
|
+
})
|
|
46843
|
+
]);
|
|
46844
|
+
var ModelCatalogEntrySchema = z.object({
|
|
46845
|
+
id: z.string(),
|
|
46846
|
+
name: z.string(),
|
|
46847
|
+
description: z.string(),
|
|
46848
|
+
formats: ModelFormatsSchema,
|
|
46849
|
+
inputSize: z.object({
|
|
46850
|
+
width: z.number(),
|
|
46851
|
+
height: z.number()
|
|
46852
|
+
}),
|
|
46853
|
+
/**
|
|
46854
|
+
* Channel count of the model input tensor. Omit ⇒ 3 (RGB), the default for
|
|
46855
|
+
* every detector / classifier / embedder. Set to 1 for a grayscale CTC text
|
|
46856
|
+
* recognizer (EasyOCR VGG plate-OCR: input `[N,1,H,W]`) so the preprocess
|
|
46857
|
+
* feeds a single-channel, EasyOCR-normalized tensor instead of the default
|
|
46858
|
+
* 3-channel RGB one. Threaded through `PoolModelConfig.inputChannels` to the
|
|
46859
|
+
* Python inference pool.
|
|
46860
|
+
*/
|
|
46861
|
+
inputChannels: z.number().int().positive().optional(),
|
|
46862
|
+
labels: z.array(LabelDefinitionSchema).readonly(),
|
|
46863
|
+
inputLayout: z.enum(["nchw", "nhwc"]).optional(),
|
|
46864
|
+
/**
|
|
46865
|
+
* `'scrfd'` applies InsightFace's SCRFD input contract, `(x - 127.5) / 128`
|
|
46866
|
+
* (upstream `insightface/model_zoo/scrfd.py`), instead of the historical
|
|
46867
|
+
* plain `/255`. Measured against COCO GT: 188 → 196 faces found on the
|
|
46868
|
+
* `scrfd-2.5g` catalog entry (2026-09-26 model-replacement spike, §2.4-2).
|
|
46869
|
+
*/
|
|
46870
|
+
inputNormalization: z.enum([
|
|
46871
|
+
"zero-one",
|
|
46872
|
+
"imagenet",
|
|
46873
|
+
"none",
|
|
46874
|
+
"scrfd"
|
|
46875
|
+
]).optional(),
|
|
46876
|
+
/**
|
|
46877
|
+
* The model already applies softmax IN-GRAPH — its raw output is a
|
|
46878
|
+
* probability distribution, not logits. When set, the `softmax`
|
|
46879
|
+
* postprocessor must NOT re-apply softmax: re-softmaxing an already-normalised
|
|
46880
|
+
* probability vector collapses it toward uniform (top-1 score craters far
|
|
46881
|
+
* below its true value, making every confidence gate meaningless). Absent ⇒
|
|
46882
|
+
* the output is raw logits and the postprocessor applies softmax (the normal
|
|
46883
|
+
* case). Set on the Google AIY Birds `bird-classifier` (softmax baked into the
|
|
46884
|
+
* TF graph). Threaded to the Python pool via `PoolModelConfig.outputProbabilities`.
|
|
46885
|
+
*/
|
|
46886
|
+
outputProbabilities: z.boolean().optional(),
|
|
46887
|
+
preprocessMode: z.enum(["letterbox", "resize"]).optional(),
|
|
46888
|
+
/**
|
|
46889
|
+
* Per-MODEL postprocessor override. Absent ⇒ the step's own
|
|
46890
|
+
* `StepDefinition.postprocessor` applies (the normal case — every model in a
|
|
46891
|
+
* step shares its decode). Set it when a step hosts models with DIFFERENT raw
|
|
46892
|
+
* output layouts under one slot: e.g. object-detection is `'yolo'` by default,
|
|
46893
|
+
* but a Coral SSD MobileNet build emits the `TFLite_Detection_PostProcess`
|
|
46894
|
+
* 4-tensor layout and needs `'ssd'`. Threaded into `PoolModelConfig.postprocessor`
|
|
46895
|
+
* by the engine factory (`modelEntry.postprocessor ?? def.postprocessor`).
|
|
46896
|
+
*/
|
|
46897
|
+
postprocessor: z.custom().optional(),
|
|
46898
|
+
/**
|
|
46899
|
+
* Per-MODEL default confidence floor. Absent ⇒ the step's
|
|
46900
|
+
* `StepDefinition.defaultConfidence` applies. A score is a property of one
|
|
46901
|
+
* model's output scale, not of the step slot it sits in: YuNet's
|
|
46902
|
+
* `sqrt(cls·obj)` is not SCRFD's score, and inheriting SCRFD's 0.5 filled the
|
|
46903
|
+
* face gallery with wheels and hands (D662, amends D645). An operator's
|
|
46904
|
+
* explicit value still wins over it. Resolved in ONE place —
|
|
46905
|
+
* `addon-pipeline/.../registry/effective-confidence.ts`.
|
|
46906
|
+
*/
|
|
46907
|
+
defaultConfidence: z.number().min(0).max(1).optional(),
|
|
46908
|
+
/**
|
|
46909
|
+
* Per-MODEL default of the per-class confidence floors (`minConfidence<Macro>`
|
|
46910
|
+
* on a detector step), keyed by macro class: `{ person: 0.45 }`. A class
|
|
46911
|
+
* absent here runs at the step slider's global default. The same row shape
|
|
46912
|
+
* the floor measurement produces (`model-floors.json`: modelId → floors), so
|
|
46913
|
+
* a measured table is copied in as-is. An operator override is bound to the
|
|
46914
|
+
* model it was made for and does not survive a model change (D738). A custom
|
|
46915
|
+
* / imported model may declare it; without it, the global defaults apply.
|
|
46916
|
+
*/
|
|
46917
|
+
defaultClassFloors: z.record(z.string(), z.number().min(0).max(1)).optional(),
|
|
46918
|
+
/**
|
|
46919
|
+
* The inference precision this model's OpenVINO IR needs on an Intel GPU.
|
|
46920
|
+
* Absent ⇒ the device default (f16 on a GPU). Set to `'f32'` for an FP32 IR
|
|
46921
|
+
* that produces invalid output at f16 — measured 2026-10-07 for YOLO26
|
|
46922
|
+
* base IRs (`yolo26s`: 0 true / 146 false positives; `yolo26m*`: NaN
|
|
46923
|
+
* scores) on the Core Ultra iGPU and the N100. Threaded to the pool as
|
|
46924
|
+
* `PoolModelConfig.gpuInferencePrecision`; the pool sets
|
|
46925
|
+
* INFERENCE_PRECISION_HINT on a GPU only. Costs ~60% latency on the GPU.
|
|
46926
|
+
*/
|
|
46927
|
+
gpuInferencePrecision: z.enum(["f32", "f16"]).optional(),
|
|
46928
|
+
/**
|
|
46929
|
+
* ROOT detectors only: per supplied step (`animal-classifier`, …), the
|
|
46930
|
+
* minimum DETECTION score from which this root's own fine label (species,
|
|
46931
|
+
* vehicle type — D736 root supply) is taken (D741). Below it the detection
|
|
46932
|
+
* keeps its macro class without the fine label. `1` = never take it from
|
|
46933
|
+
* this root. Absent ⇒ no floor beyond the macro floor. The supplied step's
|
|
46934
|
+
* `minConfidence` slider, bound to the ROOT model, overrides it.
|
|
46935
|
+
*/
|
|
46936
|
+
suppliedLabelFloors: z.record(z.string(), z.number().min(0).max(1)).optional(),
|
|
46937
|
+
/**
|
|
46938
|
+
* When true, the executor produces a landmark-aligned crop (similarity warp
|
|
46939
|
+
* onto the canonical template) before this step runs, instead of a plain
|
|
46940
|
+
* axis-aligned bbox crop. Required for face-recognition embedders (ArcFace):
|
|
46941
|
+
* their embeddings are only discriminative on an aligned input. The face
|
|
46942
|
+
* detector that produced the parent detail must emit 5 landmarks.
|
|
46943
|
+
*/
|
|
46944
|
+
faceAlignment: z.boolean().optional(),
|
|
46945
|
+
/**
|
|
46946
|
+
* Auxiliary files required at runtime (labels JSON, charset dict, etc.).
|
|
46947
|
+
* Downloaded into the same modelsDir alongside the model file.
|
|
46948
|
+
*/
|
|
46949
|
+
extraFiles: z.array(ModelExtraFileSchema).readonly().optional(),
|
|
46950
|
+
/**
|
|
46951
|
+
* LEGACY entry — retained in the catalog so a persisted operator selection
|
|
46952
|
+
* still RESOLVES (and can be re-activated), but hidden from the selectable
|
|
46953
|
+
* model list and excluded from the auto format-default pick. Set on the
|
|
46954
|
+
* superseded / consolidated models (older lineages, redundant fp16 IRs) so
|
|
46955
|
+
* the active lineup stays the coherent curated ladder without deleting a
|
|
46956
|
+
* model anyone may still be pinned to. `resolveModelForFormat` keeps honoring
|
|
46957
|
+
* an explicit legacy id that has a build for the node's format.
|
|
46958
|
+
*/
|
|
46959
|
+
legacy: z.boolean().optional(),
|
|
46960
|
+
/**
|
|
46961
|
+
* Measured quality/latency metadata — populated from the benchmark addon on
|
|
46962
|
+
* the real node classes. Absent = not yet measured (most entries today; the
|
|
46963
|
+
* catalog historically carried only `sizeMB`, a poor cross-architecture
|
|
46964
|
+
* speed proxy). `p95LatencyMs` is keyed by node class (e.g. `n100`, `mac`).
|
|
46965
|
+
*/
|
|
46966
|
+
metrics: z.object({
|
|
46967
|
+
map50: z.number().optional(),
|
|
46968
|
+
p95LatencyMs: z.record(z.string(), z.number()).optional()
|
|
46969
|
+
}).optional(),
|
|
46970
|
+
/**
|
|
46971
|
+
* The model's licence record — see {@link ModelLicenseSchema}. Optional in
|
|
46972
|
+
* the schema (a custom model's author may state none); REQUIRED and complete
|
|
46973
|
+
* on every built-in catalog entry (`scripts/check-catalog-licence.ts`).
|
|
46974
|
+
*/
|
|
46975
|
+
license: ModelLicenseSchema.optional(),
|
|
46976
|
+
/**
|
|
46977
|
+
* Variant-selector grouping. The UI groups models by `family` + `tier` and
|
|
46978
|
+
* offers `precision` / `optimization` as variant axes WITHIN a tier — so all
|
|
46979
|
+
* of a family's sizes and quantizations collapse into one grouped picker
|
|
46980
|
+
* instead of a flat list of `yolo26s`, `yolo26s-int8`, … Absent ⇒ ungrouped
|
|
46981
|
+
* (legacy / custom models) — never shown in the grouped selector. The flat
|
|
46982
|
+
* `id` stays the source of truth for resolution/download/persistence; grouping
|
|
46983
|
+
* is a presentation overlay resolved back to an `id`.
|
|
46984
|
+
*/
|
|
46985
|
+
group: ModelVariantGroupSchema.optional(),
|
|
46986
|
+
/**
|
|
46987
|
+
* Catalog source for the pipeline stepper's provider-first picker. Absent on
|
|
46988
|
+
* built-in CamStack entries (treated as `camstack`) and on registry rows
|
|
46989
|
+
* persisted before this field existed (`inferModelProvider` fills those).
|
|
46990
|
+
*/
|
|
46991
|
+
provider: ModelProviderIdSchema.optional(),
|
|
46992
|
+
/**
|
|
46993
|
+
* Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
|
|
46994
|
+
* applies (plus catalog / COCO public catalog). Set on a custom model whose raw
|
|
46995
|
+
* labels already ARE the CamStack macros (plugin catalog identity map).
|
|
46996
|
+
*/
|
|
46997
|
+
classMap: DetectionCatalogClassMapSchema.optional(),
|
|
46998
|
+
/**
|
|
46999
|
+
* The pipeline steps this ROOT detector can supply from its own output
|
|
47000
|
+
* (D730): its labels name a step's effect (`deer` for `animal-classifier`)
|
|
47001
|
+
* or draw a step's box (`license_plate` for `plate-detection`). Computed at
|
|
47002
|
+
* import from THIS model's labelmap by `deriveRootSupplies`, never written
|
|
47003
|
+
* by hand and never assumed per family; a row without it is derived on read
|
|
47004
|
+
* (`rootSuppliesOf`). Whether a camera uses it is the step's own
|
|
47005
|
+
* `useRootModel` flag (`resolveRootSupply`).
|
|
47006
|
+
*/
|
|
47007
|
+
suppliesSteps: z.array(RootStepSupplySchema).readonly().optional(),
|
|
47008
|
+
/**
|
|
47009
|
+
* The model's CLIP feature-space contract (text encoder, dimension, vector
|
|
47010
|
+
* index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
|
|
47011
|
+
* CLIP image encoder; its absence is what "not a CLIP model" means to the
|
|
47012
|
+
* embedding encoder and the semantic-search store (D649).
|
|
47013
|
+
*/
|
|
47014
|
+
clip: ClipModelMetaSchema.optional()
|
|
47015
|
+
});
|
|
47016
|
+
var ConvertTargetSchema = z.discriminatedUnion("format", [z.object({
|
|
47017
|
+
format: z.literal("openvino"),
|
|
47018
|
+
precisions: z.array(z.enum(["fp16", "int8"])).min(1).readonly()
|
|
47019
|
+
}), z.object({ format: z.literal("coreml") })]);
|
|
47020
|
+
var ModelConvertMetadataSchema = z.object({
|
|
47021
|
+
id: z.string().regex(/^[a-zA-Z0-9._-]+$/),
|
|
47022
|
+
name: z.string(),
|
|
47023
|
+
labels: z.array(LabelDefinitionSchema).readonly(),
|
|
47024
|
+
inputSize: z.object({
|
|
47025
|
+
width: z.number(),
|
|
47026
|
+
height: z.number()
|
|
47027
|
+
}),
|
|
47028
|
+
inputLayout: z.enum(["nchw", "nhwc"]).optional(),
|
|
47029
|
+
inputNormalization: z.enum([
|
|
47030
|
+
"zero-one",
|
|
47031
|
+
"imagenet",
|
|
47032
|
+
"none",
|
|
47033
|
+
"scrfd"
|
|
47034
|
+
]).optional(),
|
|
47035
|
+
preprocessMode: z.enum(["letterbox", "resize"]).optional(),
|
|
47036
|
+
outputFormat: z.enum([
|
|
47037
|
+
"yolo",
|
|
47038
|
+
"ssd",
|
|
47039
|
+
"embedding",
|
|
47040
|
+
"classification",
|
|
47041
|
+
"ocr",
|
|
47042
|
+
"segmentation"
|
|
47043
|
+
]),
|
|
47044
|
+
faceAlignment: z.boolean().optional(),
|
|
47045
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
47046
|
+
});
|
|
47047
|
+
var ConvertArtifactSchema = z.object({
|
|
47048
|
+
format: z.enum(MODEL_FORMATS),
|
|
47049
|
+
precision: z.enum(["fp16", "int8"]).optional(),
|
|
47050
|
+
sizeMB: z.number(),
|
|
47051
|
+
validated: z.boolean(),
|
|
47052
|
+
files: z.array(z.string()).readonly()
|
|
47053
|
+
});
|
|
47054
|
+
var ConvertResultSchema = z.object({
|
|
47055
|
+
entry: ModelCatalogEntrySchema,
|
|
47056
|
+
artifacts: z.array(ConvertArtifactSchema).readonly()
|
|
47057
|
+
});
|
|
47058
|
+
/**
|
|
47059
|
+
* True if the scope set grants `access` on device-scoped capabilities.
|
|
47060
|
+
* A `category:device` grant covers every device cap (the broad grant).
|
|
47061
|
+
*/
|
|
47062
|
+
function scopesAllowDeviceCap(scopes, access) {
|
|
47063
|
+
return scopes.some((s) => s.type === "category" && s.target === "device" && s.access.includes(access));
|
|
47064
|
+
}
|
|
47065
|
+
/**
|
|
47066
|
+
* True if the scope set names this addon with at least `access`.
|
|
47214
47067
|
*
|
|
47215
|
-
*
|
|
47216
|
-
*
|
|
47217
|
-
*
|
|
47218
|
-
*
|
|
47068
|
+
* Deliberately NOT satisfied by `category:device`: a grant over per-camera
|
|
47069
|
+
* capabilities says nothing about an addon's own HTTP surface, and conflating
|
|
47070
|
+
* the two is precisely the confusion that let an Alexa token drive Home
|
|
47071
|
+
* Assistant's command route.
|
|
47072
|
+
*/
|
|
47073
|
+
function scopesAllowAddon(scopes, addonId, access) {
|
|
47074
|
+
return scopes.some((s) => s.type === "addon" && s.target === addonId && s.access.includes(access));
|
|
47075
|
+
}
|
|
47076
|
+
var ViewerFeatureIdSchema = z.enum([
|
|
47077
|
+
"face-assignment",
|
|
47078
|
+
"plate-assignment",
|
|
47079
|
+
"retrain",
|
|
47080
|
+
"scenes"
|
|
47081
|
+
]);
|
|
47082
|
+
/** Which devices a viewer reaches: `allow` minus `block`. */
|
|
47083
|
+
var ViewerDeviceAllowSchema = z.union([z.literal("*"), z.array(z.number().int().nonnegative())]);
|
|
47084
|
+
/**
|
|
47085
|
+
* The viewer grant, stored as ONE row of a user's `scopes`. A principal that
|
|
47086
|
+
* holds it is decided by the viewer rules ALONE — any other row it carries is
|
|
47087
|
+
* ignored, so a viewer can never be widened by a leftover grant.
|
|
47088
|
+
*/
|
|
47089
|
+
var ViewerTokenScopeSchema = z.object({
|
|
47090
|
+
type: z.literal("viewer"),
|
|
47091
|
+
allow: ViewerDeviceAllowSchema,
|
|
47092
|
+
block: z.array(z.number().int().nonnegative()),
|
|
47093
|
+
features: z.array(ViewerFeatureIdSchema)
|
|
47094
|
+
});
|
|
47095
|
+
/**
|
|
47096
|
+
* Zod schemas for persisted record types.
|
|
47219
47097
|
*
|
|
47220
|
-
*
|
|
47098
|
+
* These schemas serve as the single source of truth for types that are
|
|
47099
|
+
* stored in the settings-store backend and retrieved via tRPC. They
|
|
47100
|
+
* replace the manual TypeScript interfaces with schema-derived types,
|
|
47101
|
+
* enabling runtime validation when reading from the backend.
|
|
47221
47102
|
*
|
|
47222
|
-
*
|
|
47223
|
-
*
|
|
47224
|
-
|
|
47225
|
-
|
|
47103
|
+
* Convention: each schema is named `<Type>Schema`, the inferred TS type
|
|
47104
|
+
* keeps the original name for backward compatibility.
|
|
47105
|
+
*/
|
|
47106
|
+
/**
|
|
47107
|
+
* Auth model (v2 — 2026-05-12 caps-only):
|
|
47226
47108
|
*
|
|
47227
|
-
*
|
|
47109
|
+
* Two principals:
|
|
47110
|
+
* - `isAdmin: true` — full bypass. Admin scope set is ignored.
|
|
47111
|
+
* - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
|
|
47228
47112
|
*
|
|
47229
|
-
*
|
|
47230
|
-
*
|
|
47113
|
+
* No role enum. There used to be `viewer / agent / scoped` and earlier
|
|
47114
|
+
* `super_admin` — collapsed onto the single boolean because every
|
|
47115
|
+
* non-admin caller is governed by the same scope-check rules; the
|
|
47116
|
+
* distinction was only ever used to route role-specific procedures
|
|
47117
|
+
* which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
|
|
47118
|
+
* with `isAdmin: false` + an explicit scope list.
|
|
47231
47119
|
*/
|
|
47232
|
-
|
|
47233
|
-
var
|
|
47234
|
-
|
|
47235
|
-
|
|
47236
|
-
|
|
47237
|
-
|
|
47120
|
+
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
47121
|
+
var MethodAccessSchema = z.enum([
|
|
47122
|
+
"view",
|
|
47123
|
+
"create",
|
|
47124
|
+
"delete"
|
|
47125
|
+
]);
|
|
47238
47126
|
/**
|
|
47239
|
-
* A
|
|
47240
|
-
*
|
|
47127
|
+
* A single scope grant. Three forms — checked in matcher with OR
|
|
47128
|
+
* semantics; the first match decides whether the call passes:
|
|
47129
|
+
*
|
|
47130
|
+
* - `category` — broadest. `target: 'device' | 'system'` selects every
|
|
47131
|
+
* cap with the matching `scope` declaration. New caps inherit grants
|
|
47132
|
+
* automatically — adding a device cap to the codebase makes it
|
|
47133
|
+
* reachable to every user with `category:device [...]` without a
|
|
47134
|
+
* re-grant. Use this for "family viewer" / "operator" tiers.
|
|
47135
|
+
*
|
|
47136
|
+
* - `addon` — every cap that ships inside a given addon id. Niche;
|
|
47137
|
+
* useful when an integration needs to interact with one specific
|
|
47138
|
+
* addon's surface regardless of how many caps it exports.
|
|
47139
|
+
*
|
|
47140
|
+
* - `capability` — the most precise form. Single cap name. Use for
|
|
47141
|
+
* integration tokens where you want to grant `addons.installPackage`
|
|
47142
|
+
* and nothing else.
|
|
47143
|
+
*
|
|
47144
|
+
* `access` is REQUIRED with min 1 element. `admin` bypass is the
|
|
47145
|
+
* "give me everything" escape; there is no wildcard scope.
|
|
47241
47146
|
*/
|
|
47242
|
-
|
|
47243
|
-
|
|
47244
|
-
|
|
47245
|
-
return ALIAS_TO_KEY.get(value);
|
|
47246
|
-
}
|
|
47147
|
+
var AllowedProviderSchema = z.union([z.literal("*"), z.array(z.string())]);
|
|
47148
|
+
var AllowedDevicesSchema = z.record(z.string(), z.union([z.literal("*"), z.array(z.string())]));
|
|
47149
|
+
var CapScopeSchema = z.enum(["device", "system"]);
|
|
47247
47150
|
/**
|
|
47248
|
-
*
|
|
47151
|
+
* DeviceSelector (scope model v3 — 2026-08-12).
|
|
47249
47152
|
*
|
|
47250
|
-
*
|
|
47251
|
-
*
|
|
47252
|
-
*
|
|
47153
|
+
* A `device` grant no longer carries a frozen list of deviceIds. It carries
|
|
47154
|
+
* a SELECTOR the matcher resolves against the live fleet, so the grant can be
|
|
47155
|
+
* DYNAMIC: a `types:['camera']` selector automatically covers a camera added
|
|
47156
|
+
* AFTER the grant was minted — no re-grant, no re-login.
|
|
47157
|
+
*
|
|
47158
|
+
* - `all` — every device in the deployment. The broad viewer/operator
|
|
47159
|
+
* lever without a `category` grant (a `category` grant also covers device
|
|
47160
|
+
* caps that carry no deviceId; `all` is specifically the device set).
|
|
47161
|
+
* - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
|
|
47162
|
+
* grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
|
|
47163
|
+
* is NOT covered until the grant is edited.
|
|
47164
|
+
* - `types` — every device of a `DeviceType` (e.g. every `camera`).
|
|
47165
|
+
* DYNAMIC. A device that changes type, or a new device of the type,
|
|
47166
|
+
* re-resolves on the next request.
|
|
47167
|
+
* - `locations` — every device whose operator-assigned `location` label is
|
|
47168
|
+
* in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
|
|
47169
|
+
* null/unset location matches NO `locations` selector.
|
|
47253
47170
|
*/
|
|
47254
|
-
var
|
|
47255
|
-
|
|
47256
|
-
|
|
47257
|
-
|
|
47258
|
-
|
|
47259
|
-
|
|
47260
|
-
|
|
47171
|
+
var DeviceSelectorSchema = z.discriminatedUnion("kind", [
|
|
47172
|
+
z.object({ kind: z.literal("all") }),
|
|
47173
|
+
z.object({
|
|
47174
|
+
kind: z.literal("ids"),
|
|
47175
|
+
ids: z.array(z.number().int()).min(1)
|
|
47176
|
+
}),
|
|
47177
|
+
z.object({
|
|
47178
|
+
kind: z.literal("types"),
|
|
47179
|
+
types: z.array(z.enum(DeviceType)).min(1)
|
|
47180
|
+
}),
|
|
47181
|
+
z.object({
|
|
47182
|
+
kind: z.literal("locations"),
|
|
47183
|
+
locations: z.array(z.string().min(1)).min(1)
|
|
47184
|
+
})
|
|
47185
|
+
]);
|
|
47186
|
+
var DeviceTokenScopeSchema = z.object({
|
|
47187
|
+
type: z.literal("device"),
|
|
47188
|
+
/** The device SET this grant covers — resolved against the live fleet. */
|
|
47189
|
+
selector: DeviceSelectorSchema,
|
|
47190
|
+
access: z.array(MethodAccessSchema).min(1),
|
|
47191
|
+
/**
|
|
47192
|
+
* Whether a grant on a PARENT device transparently covers its accessory
|
|
47193
|
+
* CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
|
|
47194
|
+
* Direction is parent → children ONLY.
|
|
47195
|
+
*
|
|
47196
|
+
* Absent → the matcher DERIVES it from the access flavour: `view`
|
|
47197
|
+
* inherits (a camera viewer sees the camera's accessories), `create` /
|
|
47198
|
+
* `delete` do NOT (actuating/removing a child is an explicit act the
|
|
47199
|
+
* operator must grant on the child, not inherit from the parent). Set it
|
|
47200
|
+
* explicitly to override that default per grant.
|
|
47201
|
+
*/
|
|
47202
|
+
includeLinked: z.boolean().optional()
|
|
47203
|
+
});
|
|
47204
|
+
/**
|
|
47205
|
+
* v2 → v3 lazy migration. A pre-v3 `device` grant carried
|
|
47206
|
+
* `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
|
|
47207
|
+
* `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
|
|
47208
|
+
* EVERY parse path — stored records AND the JWT-carried scope arrays
|
|
47209
|
+
* normalised at the request boundary ({@link normalizeTokenScopes} in
|
|
47210
|
+
* `device-selector.ts`). Chosen over a one-time DB migration because a
|
|
47211
|
+
* migration cannot reach a JWT already in a client's hands; parse-time
|
|
47212
|
+
* migration covers both without a flag day. No cast — the raw object is read
|
|
47213
|
+
* through `Reflect.get` (its static type is `unknown`).
|
|
47214
|
+
*/
|
|
47215
|
+
function migrateLegacyTokenScope(raw) {
|
|
47216
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
47217
|
+
if (Reflect.get(raw, "type") !== "device") return raw;
|
|
47218
|
+
if (Reflect.get(raw, "selector") !== void 0) return canonicalSelectorTypes(raw);
|
|
47219
|
+
const targets = Reflect.get(raw, "targets");
|
|
47220
|
+
if (!Array.isArray(targets)) return raw;
|
|
47261
47221
|
return {
|
|
47262
|
-
|
|
47263
|
-
|
|
47264
|
-
|
|
47265
|
-
|
|
47266
|
-
|
|
47222
|
+
type: "device",
|
|
47223
|
+
selector: {
|
|
47224
|
+
kind: "ids",
|
|
47225
|
+
ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
|
|
47226
|
+
},
|
|
47227
|
+
access: Reflect.get(raw, "access")
|
|
47228
|
+
};
|
|
47229
|
+
}
|
|
47230
|
+
/**
|
|
47231
|
+
* A stored `types` selector may name a type D1033 retired (`thermostat`). The
|
|
47232
|
+
* grant is read back through this same preprocess, so the retired name is
|
|
47233
|
+
* rewritten to its canonical type here and {@link DeviceSelectorSchema} itself
|
|
47234
|
+
* stays a strict enum on the wire.
|
|
47235
|
+
*/
|
|
47236
|
+
function canonicalSelectorTypes(raw) {
|
|
47237
|
+
const selector = Reflect.get(raw, "selector");
|
|
47238
|
+
if (selector === null || typeof selector !== "object") return raw;
|
|
47239
|
+
if (Reflect.get(selector, "kind") !== "types") return raw;
|
|
47240
|
+
const types = Reflect.get(selector, "types");
|
|
47241
|
+
if (!Array.isArray(types)) return raw;
|
|
47242
|
+
const canonical = types.map((t) => typeof t === "string" ? canonicalStoredDeviceType(t) : t);
|
|
47243
|
+
return {
|
|
47244
|
+
...raw,
|
|
47245
|
+
selector: {
|
|
47246
|
+
...selector,
|
|
47247
|
+
types: canonical
|
|
47248
|
+
}
|
|
47267
47249
|
};
|
|
47250
|
+
}
|
|
47251
|
+
var TokenScopeSchema = z.preprocess(migrateLegacyTokenScope, z.discriminatedUnion("type", [
|
|
47252
|
+
z.object({
|
|
47253
|
+
type: z.literal("category"),
|
|
47254
|
+
target: CapScopeSchema,
|
|
47255
|
+
access: z.array(MethodAccessSchema).min(1)
|
|
47256
|
+
}),
|
|
47257
|
+
z.object({
|
|
47258
|
+
type: z.literal("capability"),
|
|
47259
|
+
target: z.string(),
|
|
47260
|
+
access: z.array(MethodAccessSchema).min(1)
|
|
47261
|
+
}),
|
|
47262
|
+
z.object({
|
|
47263
|
+
type: z.literal("addon"),
|
|
47264
|
+
target: z.string(),
|
|
47265
|
+
access: z.array(MethodAccessSchema).min(1)
|
|
47266
|
+
}),
|
|
47267
|
+
DeviceTokenScopeSchema
|
|
47268
|
+
]));
|
|
47269
|
+
/**
|
|
47270
|
+
* What a PERSON's grant set holds (D921): the capability rows above (legacy
|
|
47271
|
+
* users, integration-style tokens) or the viewer row, which is decided by its
|
|
47272
|
+
* own rules alone. Kept apart from {@link TokenScope} so every surface that
|
|
47273
|
+
* edits capability rows (the scope picker, token minting) keeps its shape.
|
|
47274
|
+
*/
|
|
47275
|
+
var UserScopeSchema = z.union([ViewerTokenScopeSchema, TokenScopeSchema]);
|
|
47276
|
+
var UserRecordSchema = z.object({
|
|
47277
|
+
id: z.string(),
|
|
47278
|
+
username: z.string(),
|
|
47279
|
+
passwordHash: z.string(),
|
|
47280
|
+
/**
|
|
47281
|
+
* Admin bypass. When true, the middleware skips the scope-access
|
|
47282
|
+
* check entirely. There is no other axis of privilege; the legacy
|
|
47283
|
+
* role enum collapsed onto this boolean in v2.
|
|
47284
|
+
*/
|
|
47285
|
+
isAdmin: z.boolean().default(false),
|
|
47286
|
+
allowedProviders: AllowedProviderSchema,
|
|
47287
|
+
allowedDevices: AllowedDevicesSchema,
|
|
47288
|
+
/**
|
|
47289
|
+
* Scopes granted to this user. Admins bypass; their `scopes` is
|
|
47290
|
+
* ignored. Non-admins without scopes are locked out of every
|
|
47291
|
+
* protected call.
|
|
47292
|
+
*/
|
|
47293
|
+
scopes: z.array(UserScopeSchema).default([]),
|
|
47294
|
+
createdAt: z.number(),
|
|
47295
|
+
updatedAt: z.number()
|
|
47296
|
+
});
|
|
47297
|
+
var ScopedTokenSchema = z.object({
|
|
47298
|
+
id: z.string(),
|
|
47299
|
+
userId: z.string(),
|
|
47300
|
+
name: z.string(),
|
|
47301
|
+
tokenHash: z.string(),
|
|
47302
|
+
tokenPrefix: z.string(),
|
|
47303
|
+
scopes: z.array(TokenScopeSchema),
|
|
47304
|
+
expiresAt: z.number().nullish(),
|
|
47305
|
+
lastUsedAt: z.number().nullish(),
|
|
47306
|
+
createdAt: z.number()
|
|
47307
|
+
});
|
|
47308
|
+
/** What a share-view grant lets its holder see. */
|
|
47309
|
+
var ShareViewGrantSchema = z.object({
|
|
47310
|
+
kind: z.enum(SHARE_VIEW_KINDS),
|
|
47311
|
+
deviceIds: z.array(z.number().int().nonnegative()).min(1).max(64),
|
|
47312
|
+
/** Talk-back, opt-in at mint time; absent means off. */
|
|
47313
|
+
talk: z.boolean().optional()
|
|
47314
|
+
});
|
|
47315
|
+
var ShareViewScopeSchema = z.object({
|
|
47316
|
+
type: z.literal("share-view"),
|
|
47317
|
+
grant: ShareViewGrantSchema
|
|
47318
|
+
});
|
|
47319
|
+
var AddonRoutesScopeSchema = z.object({
|
|
47320
|
+
type: z.literal("addon-routes"),
|
|
47321
|
+
access: z.array(MethodAccessSchema).min(1)
|
|
47322
|
+
});
|
|
47323
|
+
var PreferencesSelfScopeSchema = z.object({ type: z.literal("preferences-self") });
|
|
47324
|
+
var CredentialScopeSchema = z.union([
|
|
47325
|
+
z.literal("*"),
|
|
47326
|
+
ShareViewScopeSchema,
|
|
47327
|
+
AddonRoutesScopeSchema,
|
|
47328
|
+
PreferencesSelfScopeSchema,
|
|
47329
|
+
ViewerTokenScopeSchema,
|
|
47330
|
+
TokenScopeSchema
|
|
47331
|
+
]);
|
|
47332
|
+
/**
|
|
47333
|
+
* The `kind` claim of a unified token. It names the TOKEN FAMILY (so every
|
|
47334
|
+
* older gate that classifies a hub JWT refuses it — `classifyBearerPrincipal`
|
|
47335
|
+
* treats any `kind` it does not know as not-a-credential), never what the
|
|
47336
|
+
* token may do: that is its `scopes`, and only its `scopes`.
|
|
47337
|
+
*/
|
|
47338
|
+
var CREDENTIAL_TOKEN_KIND = "credential";
|
|
47339
|
+
/**
|
|
47340
|
+
* The `aud` claim every minted token is signed with (D895). The hub's raw JWT
|
|
47341
|
+
* verify (`AuthManager.verifyToken`, used by every surface that wants a LOGIN
|
|
47342
|
+
* session — the OAuth consent page, the session cookie, health, backups)
|
|
47343
|
+
* refuses a token carrying it, so a minted token — a share link above all —
|
|
47344
|
+
* can never be replayed as a person's session. Only the credential verifier's
|
|
47345
|
+
* own door (`verifyCredentialToken`) accepts it.
|
|
47346
|
+
*/
|
|
47347
|
+
var CREDENTIAL_TOKEN_AUDIENCE = "camstack:credential";
|
|
47348
|
+
/** Does a verified JWT payload belong to the minted-token family? */
|
|
47349
|
+
function isCredentialTokenPayload(payload) {
|
|
47350
|
+
if (payload === null || typeof payload !== "object") return false;
|
|
47351
|
+
const kind = Reflect.get(payload, "kind");
|
|
47352
|
+
const aud = Reflect.get(payload, "aud");
|
|
47353
|
+
return kind === "credential" || aud === "camstack:credential" || Array.isArray(aud) && aud.includes("camstack:credential");
|
|
47354
|
+
}
|
|
47355
|
+
/**
|
|
47356
|
+
* The claims of a unified token (`auth.mintToken`). It carries no `exp`: its
|
|
47357
|
+
* row (looked up by `jti` on every verify, for revocation) holds the ONE
|
|
47358
|
+
* expiry, so a share link can be extended and a JWT clock can never disagree
|
|
47359
|
+
* with the row.
|
|
47360
|
+
*/
|
|
47361
|
+
var CredentialTokenClaimsSchema = z.object({
|
|
47362
|
+
kind: z.literal(CREDENTIAL_TOKEN_KIND),
|
|
47363
|
+
sub: z.string().min(1),
|
|
47364
|
+
jti: z.string().min(16),
|
|
47365
|
+
scopes: z.array(CredentialScopeSchema).min(1)
|
|
47366
|
+
});
|
|
47367
|
+
/**
|
|
47368
|
+
* Per-user ACCOUNT preferences (D894): the hub-side half of the viewer's two
|
|
47369
|
+
* settings levels.
|
|
47370
|
+
*
|
|
47371
|
+
* - DEVICE settings never leave the phone.
|
|
47372
|
+
* - ACCOUNT settings live here: one row per `(user, namespace)`, private to
|
|
47373
|
+
* that user, synced across every device signed in as them, last write wins
|
|
47374
|
+
* unless the writer sends the revision it based its edit on.
|
|
47375
|
+
*
|
|
47376
|
+
* A setting lives in exactly ONE level; there are no overrides. The caller
|
|
47377
|
+
* never names a user: the hub stamps the principal's own id, admin included.
|
|
47378
|
+
*
|
|
47379
|
+
* The contract the client codes against is the `preferences.*` tRPC router
|
|
47380
|
+
* (`server/backend/src/api/core/preferences.router.ts`).
|
|
47381
|
+
*/
|
|
47382
|
+
/** `viewer.app`, `viewer.cameras`, `viewer.grids` … — lowercase, dot/dash separated. */
|
|
47383
|
+
var PREFERENCES_NAMESPACE_PATTERN = /^[a-z][a-z0-9.-]{0,63}$/;
|
|
47384
|
+
/** One row's value, measured as UTF-8 JSON. */
|
|
47385
|
+
var PREFERENCES_MAX_VALUE_BYTES = 256 * 1024;
|
|
47386
|
+
var PreferenceNamespaceSchema = z.string().regex(PREFERENCES_NAMESPACE_PATTERN);
|
|
47387
|
+
/** A namespace's value: a JSON object, opaque to the hub. */
|
|
47388
|
+
var PreferenceValueSchema = z.record(z.string(), z.unknown());
|
|
47389
|
+
var PreferenceDeviceIdSchema = z.string().min(1).max(64);
|
|
47390
|
+
/** A stored row, as the owner reads it. */
|
|
47391
|
+
var PreferenceRowSchema = z.object({
|
|
47392
|
+
namespace: PreferenceNamespaceSchema,
|
|
47393
|
+
value: PreferenceValueSchema,
|
|
47394
|
+
/** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
|
|
47395
|
+
revision: z.number().int().positive(),
|
|
47396
|
+
updatedAt: z.number().int(),
|
|
47397
|
+
/** The client id the last writer sent; `null` when it sent none. */
|
|
47398
|
+
updatedByDevice: PreferenceDeviceIdSchema.nullable()
|
|
47399
|
+
});
|
|
47400
|
+
z.object({
|
|
47401
|
+
/** Absent: every namespace the caller holds. */
|
|
47402
|
+
namespaces: z.array(PreferenceNamespaceSchema).max(32).optional() });
|
|
47403
|
+
z.object({ rows: z.array(PreferenceRowSchema) });
|
|
47404
|
+
z.object({
|
|
47405
|
+
namespace: PreferenceNamespaceSchema,
|
|
47406
|
+
value: PreferenceValueSchema,
|
|
47407
|
+
/**
|
|
47408
|
+
* The revision the edit was based on. Absent: last write wins. `0`: the
|
|
47409
|
+
* namespace must not exist yet. Any other value that is not the current
|
|
47410
|
+
* revision answers `conflict` and writes nothing.
|
|
47411
|
+
*/
|
|
47412
|
+
baseRevision: z.number().int().nonnegative().optional(),
|
|
47413
|
+
deviceId: PreferenceDeviceIdSchema.optional()
|
|
47414
|
+
});
|
|
47415
|
+
z.discriminatedUnion("status", [z.object({
|
|
47416
|
+
status: z.literal("saved"),
|
|
47417
|
+
row: PreferenceRowSchema
|
|
47418
|
+
}), z.object({
|
|
47419
|
+
status: z.literal("conflict"),
|
|
47420
|
+
current: PreferenceRowSchema.nullable()
|
|
47421
|
+
})]);
|
|
47422
|
+
z.object({ namespace: PreferenceNamespaceSchema });
|
|
47423
|
+
z.object({
|
|
47424
|
+
/** `false` when the namespace did not exist. */
|
|
47425
|
+
deleted: z.boolean() });
|
|
47426
|
+
z.object({
|
|
47427
|
+
/** The revision the client holds per namespace; a namespace it does not list is new to it. */
|
|
47428
|
+
revisionByNamespace: z.record(PreferenceNamespaceSchema, z.number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
|
|
47429
|
+
z.object({
|
|
47430
|
+
/** Every row whose revision differs from the client's, and every row it did not list. */
|
|
47431
|
+
rows: z.array(PreferenceRowSchema),
|
|
47432
|
+
/** Namespaces the client listed that no longer exist. */
|
|
47433
|
+
deleted: z.array(PreferenceNamespaceSchema)
|
|
47434
|
+
});
|
|
47435
|
+
z.enum(["new-session", "step-up"]);
|
|
47436
|
+
/** The languages the hub's app landing pages are written in (D858). */
|
|
47437
|
+
var AppPageLangSchema = z.enum(["en", "it"]);
|
|
47438
|
+
/** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
|
|
47439
|
+
var AppLoginPathSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("native") }), z.object({
|
|
47440
|
+
kind: z.literal("browser"),
|
|
47441
|
+
startPath: z.string().startsWith("/")
|
|
47442
|
+
})]);
|
|
47443
|
+
/**
|
|
47444
|
+
* Device certificates (D855) — the wire contract shared by the hub, the admin
|
|
47445
|
+
* UI and the native viewer.
|
|
47446
|
+
*
|
|
47447
|
+
* A device (a phone) generates its OWN P-256 key pair in hardware (Secure
|
|
47448
|
+
* Enclave / Android Keystore / a non-extractable WebCrypto key). The private
|
|
47449
|
+
* key never travels. The hub signs the PUBLIC key into an X.509 leaf under a
|
|
47450
|
+
* dedicated device CA; the device later proves possession of the key by
|
|
47451
|
+
* signing a hub-issued nonce, and the hub answers with the same session a
|
|
47452
|
+
* password login opens.
|
|
47453
|
+
*
|
|
47454
|
+
* Everything on the wire is a small string (a PEM, a base64url signature):
|
|
47455
|
+
* D613 is about bulk bytes, and a certificate is ~600 bytes.
|
|
47456
|
+
*/
|
|
47457
|
+
/** Signature algorithm of every device credential: ECDSA, curve P-256, SHA-256. */
|
|
47458
|
+
var DEVICE_CERT_SIGNATURE = "ecdsa-p256-sha256";
|
|
47459
|
+
/** First line of every signed message; a change of format bumps the version. */
|
|
47460
|
+
var DEVICE_SIGNATURE_MESSAGE_VERSION = "camstack-device-cert-v1";
|
|
47461
|
+
z.enum([
|
|
47462
|
+
"login",
|
|
47463
|
+
"renew",
|
|
47464
|
+
"revoke"
|
|
47465
|
+
]);
|
|
47466
|
+
/** One-shot enrollment code and login nonce lifetimes. */
|
|
47467
|
+
var DEVICE_ENROLLMENT_TTL_MS = 10 * 6e4;
|
|
47468
|
+
var DEVICE_NONCE_TTL_MS = 6e4;
|
|
47469
|
+
/** SAN URI prefixes of a device leaf. */
|
|
47470
|
+
var DEVICE_SAN_CREDENTIAL_PREFIX = "camstack:credential:";
|
|
47471
|
+
var DEVICE_SAN_USER_PREFIX = "camstack:user:";
|
|
47472
|
+
/**
|
|
47473
|
+
* The exact bytes a device signs (UTF-8, `\n` separators, no trailing newline):
|
|
47474
|
+
*
|
|
47475
|
+
* camstack-device-cert-v1
|
|
47476
|
+
* <login|renew>
|
|
47477
|
+
* <origin> the hub origin returned by `getDeviceChallenge`
|
|
47478
|
+
* <nonce>
|
|
47479
|
+
*
|
|
47480
|
+
* The origin is part of the message so a signature collected by a look-alike
|
|
47481
|
+
* hub is worthless on the real one; the hub additionally binds the nonce to
|
|
47482
|
+
* the origin it issued it for and refuses any other.
|
|
47483
|
+
*/
|
|
47484
|
+
function buildDeviceSignatureMessage(input) {
|
|
47485
|
+
return [
|
|
47486
|
+
DEVICE_SIGNATURE_MESSAGE_VERSION,
|
|
47487
|
+
input.purpose,
|
|
47488
|
+
input.origin,
|
|
47489
|
+
input.nonce
|
|
47490
|
+
].join("\n");
|
|
47491
|
+
}
|
|
47492
|
+
/** The deep link a QR carries: `camstack://enroll?hub=<origin>&code=<code>`. */
|
|
47493
|
+
function buildDeviceEnrollmentLink(input) {
|
|
47494
|
+
const query = new URLSearchParams();
|
|
47495
|
+
if (input.hub !== void 0) query.set("hub", input.hub);
|
|
47496
|
+
query.set("code", input.code);
|
|
47497
|
+
return `${input.scheme ?? "camstack"}://enroll?${query.toString()}`;
|
|
47498
|
+
}
|
|
47499
|
+
var DevicePlatformSchema = z.enum([
|
|
47500
|
+
"ios",
|
|
47501
|
+
"android",
|
|
47502
|
+
"web",
|
|
47503
|
+
"other"
|
|
47504
|
+
]);
|
|
47505
|
+
var Base64UrlSchema = z.string().min(1).max(4096).regex(/^[A-Za-z0-9_-]+$/);
|
|
47506
|
+
var PemSchema = z.string().min(1).max(16384);
|
|
47507
|
+
/**
|
|
47508
|
+
* Why a device-certificate endpoint said no. Distinct from a transport / 5xx
|
|
47509
|
+
* failure: those carry no reason and mean "try again", never "the credential is
|
|
47510
|
+
* dead". The viewer switches on this exhaustively.
|
|
47511
|
+
*/
|
|
47512
|
+
var DeviceRefusalReasonSchema = z.enum([
|
|
47513
|
+
"revoked",
|
|
47514
|
+
"unknown-credential",
|
|
47515
|
+
"expired",
|
|
47516
|
+
"bad-signature",
|
|
47517
|
+
"nonce-invalid",
|
|
47518
|
+
"rate-limited",
|
|
47519
|
+
"invalid-certificate",
|
|
47520
|
+
"superseded",
|
|
47521
|
+
"user-gone",
|
|
47522
|
+
"unavailable",
|
|
47523
|
+
"code-invalid",
|
|
47524
|
+
"self-enrollment-disabled",
|
|
47525
|
+
"step-up-required",
|
|
47526
|
+
"bad-public-key"
|
|
47527
|
+
]);
|
|
47528
|
+
var DeviceRefusalSchema = z.object({
|
|
47529
|
+
ok: z.literal(false),
|
|
47530
|
+
reason: DeviceRefusalReasonSchema,
|
|
47531
|
+
definitive: z.boolean(),
|
|
47532
|
+
retryAfterSeconds: z.number().optional()
|
|
47533
|
+
});
|
|
47534
|
+
z.object({
|
|
47535
|
+
code: z.string().min(1).max(256),
|
|
47536
|
+
/** SubjectPublicKeyInfo DER of the device's P-256 public key, base64url. */
|
|
47537
|
+
publicKeySpki: Base64UrlSchema,
|
|
47538
|
+
deviceName: z.string().min(1).max(80).optional(),
|
|
47539
|
+
platform: DevicePlatformSchema
|
|
47540
|
+
});
|
|
47541
|
+
var CompleteEnrollmentOutputSchema = z.object({
|
|
47542
|
+
credentialId: z.string(),
|
|
47543
|
+
certPem: PemSchema,
|
|
47544
|
+
/** The device CA certificate the leaf chains to. */
|
|
47545
|
+
chainPem: PemSchema,
|
|
47546
|
+
notAfter: z.number(),
|
|
47547
|
+
user: z.object({
|
|
47548
|
+
id: z.string(),
|
|
47549
|
+
username: z.string()
|
|
47550
|
+
})
|
|
47551
|
+
});
|
|
47552
|
+
z.discriminatedUnion("ok", [CompleteEnrollmentOutputSchema.extend({ ok: z.literal(true) }), DeviceRefusalSchema]);
|
|
47553
|
+
z.object({
|
|
47554
|
+
/** The single-use step-up proof (`auth.deviceEnrollProofFrom…`). */
|
|
47555
|
+
proof: z.string().min(1).max(512),
|
|
47556
|
+
publicKeySpki: Base64UrlSchema,
|
|
47557
|
+
deviceName: z.string().min(1).max(80),
|
|
47558
|
+
platform: DevicePlatformSchema
|
|
47559
|
+
});
|
|
47560
|
+
z.object({
|
|
47561
|
+
proof: z.string(),
|
|
47562
|
+
expiresAt: z.number()
|
|
47563
|
+
});
|
|
47564
|
+
var DeviceChallengeSchema = z.object({
|
|
47565
|
+
nonce: z.string(),
|
|
47566
|
+
/** The origin to put in the signed message. The app compares it to the hub it dialled. */
|
|
47567
|
+
origin: z.string(),
|
|
47568
|
+
expiresAt: z.number(),
|
|
47569
|
+
signature: z.literal(DEVICE_CERT_SIGNATURE)
|
|
47570
|
+
});
|
|
47571
|
+
z.discriminatedUnion("ok", [DeviceChallengeSchema.extend({ ok: z.literal(true) }), DeviceRefusalSchema]);
|
|
47572
|
+
z.object({
|
|
47573
|
+
certPem: PemSchema,
|
|
47574
|
+
nonce: z.string().min(1).max(256),
|
|
47575
|
+
/** ECDSA P-256 SHA-256 over {@link buildDeviceSignatureMessage}; raw r||s or DER, base64url. */
|
|
47576
|
+
signature: Base64UrlSchema
|
|
47577
|
+
});
|
|
47578
|
+
var RenewDeviceCertificateOutputSchema = z.object({
|
|
47579
|
+
credentialId: z.string(),
|
|
47580
|
+
certPem: PemSchema,
|
|
47581
|
+
chainPem: PemSchema,
|
|
47582
|
+
notAfter: z.number()
|
|
47583
|
+
});
|
|
47584
|
+
z.discriminatedUnion("ok", [RenewDeviceCertificateOutputSchema.extend({ ok: z.literal(true) }), DeviceRefusalSchema]);
|
|
47585
|
+
z.discriminatedUnion("ok", [z.object({
|
|
47586
|
+
ok: z.literal(true),
|
|
47587
|
+
credentialId: z.string(),
|
|
47588
|
+
sessionsEnded: z.number().int()
|
|
47589
|
+
}), DeviceRefusalSchema]);
|
|
47590
|
+
function formatDeviceRevoker(revoker) {
|
|
47591
|
+
return revoker.kind === "device" ? "device" : `${revoker.kind}:${revoker.userId}`;
|
|
47592
|
+
}
|
|
47593
|
+
var DeviceCredentialStatusSchema = z.enum([
|
|
47594
|
+
"active",
|
|
47595
|
+
"expired",
|
|
47596
|
+
"revoked"
|
|
47597
|
+
]);
|
|
47598
|
+
var DeviceCredentialSchema = z.object({
|
|
47599
|
+
id: z.string(),
|
|
47600
|
+
userId: z.string(),
|
|
47601
|
+
username: z.string().nullable(),
|
|
47602
|
+
deviceName: z.string(),
|
|
47603
|
+
platform: DevicePlatformSchema,
|
|
47604
|
+
enrolledVia: z.enum(["qr", "self"]),
|
|
47605
|
+
/** SHA-256 of the leaf certificate DER, colon-hex. */
|
|
47606
|
+
fingerprint: z.string(),
|
|
47607
|
+
issuedAt: z.number(),
|
|
47608
|
+
expiresAt: z.number(),
|
|
47609
|
+
lastUsedAt: z.number().nullable(),
|
|
47610
|
+
lastUsedFrom: z.string().nullable(),
|
|
47611
|
+
revokedAt: z.number().nullable(),
|
|
47612
|
+
/** `admin:<userId>` | `user:<userId>` | `device` | `user-deleted`. */
|
|
47613
|
+
revokedBy: z.string().nullable(),
|
|
47614
|
+
status: DeviceCredentialStatusSchema
|
|
47615
|
+
});
|
|
47616
|
+
var StartEnrollmentOutputSchema = z.object({
|
|
47617
|
+
/** Shown once; only its hash is kept. */
|
|
47618
|
+
code: z.string(),
|
|
47619
|
+
expiresAt: z.number(),
|
|
47620
|
+
/** `camstack://enroll?hub=…&code=…` — what the QR encodes. */
|
|
47621
|
+
enrollUrl: z.string(),
|
|
47622
|
+
/** The hub origin in the link, or `null` when the hub could not name one (the link then has no `hub`). */
|
|
47623
|
+
hubOrigin: z.string().nullable(),
|
|
47624
|
+
/** Every origin the apps may try (role `appConnections`). */
|
|
47625
|
+
hubOrigins: z.array(z.string())
|
|
47626
|
+
});
|
|
47627
|
+
z.object({
|
|
47628
|
+
kind: z.literal("device-certificate"),
|
|
47629
|
+
id: z.literal("device-certificate"),
|
|
47630
|
+
label: z.string(),
|
|
47631
|
+
stage: z.literal("primary"),
|
|
47632
|
+
/** tRPC paths under the hub's `auth` router, so a client names no literal. */
|
|
47633
|
+
challengePath: z.literal("auth.getDeviceChallenge"),
|
|
47634
|
+
revokePath: z.literal("auth.revokeOwnDeviceCertificate"),
|
|
47635
|
+
enrollSelfPath: z.literal("auth.enrollSelf"),
|
|
47636
|
+
loginPath: z.literal("auth.loginWithDeviceCertificate"),
|
|
47637
|
+
renewPath: z.literal("auth.renewDeviceCertificate"),
|
|
47638
|
+
signature: z.literal(DEVICE_CERT_SIGNATURE),
|
|
47639
|
+
messageVersion: z.literal(DEVICE_SIGNATURE_MESSAGE_VERSION),
|
|
47640
|
+
/** Which clients can execute it: a native app silently, a browser with a non-extractable WebCrypto key. */
|
|
47641
|
+
clients: z.array(z.enum(["native", "web"])),
|
|
47642
|
+
/** The app executes it itself, silently (D858). */
|
|
47643
|
+
app: AppLoginPathSchema.nullable()
|
|
47268
47644
|
});
|
|
47269
|
-
new Map(ENTRIES.map((e) => [e.key, e]));
|
|
47270
|
-
/** Categories a picker offers first: the ones this product's icons mostly live in. */
|
|
47271
|
-
var LEADING_CATEGORIES = [
|
|
47272
|
-
"devices",
|
|
47273
|
-
"home",
|
|
47274
|
-
"security",
|
|
47275
|
-
"buildings",
|
|
47276
|
-
"connectivity",
|
|
47277
|
-
"multimedia",
|
|
47278
|
-
"nature",
|
|
47279
|
-
"weather",
|
|
47280
|
-
"transportation",
|
|
47281
|
-
"animals"
|
|
47282
|
-
];
|
|
47283
|
-
var PRIMARY_CATEGORIES = new Set(ENTRIES.map((e) => e.primaryCategory));
|
|
47284
|
-
[...LEADING_CATEGORIES, ...ICON_CATEGORY_IDS.filter((c) => !LEADING_CATEGORIES.includes(c))].filter((c) => PRIMARY_CATEGORIES.has(c));
|
|
47285
47645
|
/**
|
|
47286
47646
|
* One (location, icon) assignment as it travels.
|
|
47287
47647
|
*
|
|
@@ -49781,7 +50141,9 @@ var SchedulerInputSchema = z.object({
|
|
|
49781
50141
|
/** Higher wins when two holds want the same device in different states. */
|
|
49782
50142
|
priority: z.number().int().min(0).max(100).default(0),
|
|
49783
50143
|
maxLateMs: z.number().int().min(1e3).max(24 * 36e5).default(DEFAULT_MAX_LATE_MS),
|
|
49784
|
-
profiles: z.array(SchedulerProfileSchema).max(20)
|
|
50144
|
+
profiles: z.array(SchedulerProfileSchema).max(20),
|
|
50145
|
+
/** Operator tags (D1054). Absent = no tags. */
|
|
50146
|
+
tags: TagsFieldSchema.optional()
|
|
49785
50147
|
});
|
|
49786
50148
|
var SchedulerSchema = SchedulerInputSchema.extend({
|
|
49787
50149
|
id: z.string().min(1),
|
|
@@ -53302,6 +53664,8 @@ var ActionEntrySchema = z.object({
|
|
|
53302
53664
|
* action (two rules, a button, an automation).
|
|
53303
53665
|
*/
|
|
53304
53666
|
minDelaySec: ActionMinDelaySecSchema.optional(),
|
|
53667
|
+
/** Internal only: operator tags (D1054). Absent = no tags. */
|
|
53668
|
+
tags: TagsFieldSchema.optional(),
|
|
53305
53669
|
status: ActionStatusSchema
|
|
53306
53670
|
}).superRefine((entry, ctx) => {
|
|
53307
53671
|
if (entry.source === "internal") {
|
|
@@ -53333,7 +53697,8 @@ var ActionInputSchema = z.object({
|
|
|
53333
53697
|
name: z.string().min(1).max(120),
|
|
53334
53698
|
steps: z.array(ActionStepSchema).min(1).max(50),
|
|
53335
53699
|
variables: z.array(ActionVariableSchema).max(20).optional(),
|
|
53336
|
-
minDelaySec: ActionMinDelaySecSchema.optional()
|
|
53700
|
+
minDelaySec: ActionMinDelaySecSchema.optional(),
|
|
53701
|
+
tags: TagsFieldSchema.optional()
|
|
53337
53702
|
});
|
|
53338
53703
|
/** Who started a run. Absent = the operator pressed it. */
|
|
53339
53704
|
var ActionRunOriginSchema = z.object({
|
|
@@ -67705,7 +68070,9 @@ var CoreBlockInputFieldsSchema = z.object({
|
|
|
67705
68070
|
* from the compiled entry after a successful load; the editor may also set
|
|
67706
68071
|
* it. Absent ⇒ `getBlockSettings` returns null until one is known.
|
|
67707
68072
|
*/
|
|
67708
|
-
settingsSchema: CoreBlockSettingsSchemaBridge.optional()
|
|
68073
|
+
settingsSchema: CoreBlockSettingsSchemaBridge.optional(),
|
|
68074
|
+
/** Operator tags (D1054), kept on the record. Absent = no tags. */
|
|
68075
|
+
tags: TagsFieldSchema.optional()
|
|
67709
68076
|
});
|
|
67710
68077
|
/** Client-authored fields for create — requires `code` or `files[entry]`. */
|
|
67711
68078
|
var CoreBlockInputSchema = CoreBlockInputFieldsSchema.superRefine((val, ctx) => {
|
|
@@ -67803,6 +68170,8 @@ var CoreBlockSchema = z.object({
|
|
|
67803
68170
|
placement: CoreBlockPlacementSchema,
|
|
67804
68171
|
integrationId: z.string().optional(),
|
|
67805
68172
|
settingsSchema: CoreBlockSettingsSchemaBridge.optional(),
|
|
68173
|
+
/** Operator tags (D1054). Absent = no tags. */
|
|
68174
|
+
tags: TagsFieldSchema.optional(),
|
|
67806
68175
|
id: z.string(),
|
|
67807
68176
|
createdAt: z.number(),
|
|
67808
68177
|
updatedAt: z.number(),
|
|
@@ -69554,38 +69923,11 @@ var DeviceTemplateThisDeviceSchema = z.object({
|
|
|
69554
69923
|
});
|
|
69555
69924
|
/** The synthetic slice `thisDevice.values` is exposed under. */
|
|
69556
69925
|
var DEVICE_TEMPLATE_VALUES_CAP = "values";
|
|
69557
|
-
/**
|
|
69558
|
-
|
|
69559
|
-
|
|
69560
|
-
|
|
69561
|
-
|
|
69562
|
-
"onoff",
|
|
69563
|
-
"default",
|
|
69564
|
-
"since",
|
|
69565
|
-
"ago",
|
|
69566
|
-
"format",
|
|
69567
|
-
"upper",
|
|
69568
|
-
"lower",
|
|
69569
|
-
"title",
|
|
69570
|
-
"capitalize",
|
|
69571
|
-
"trim",
|
|
69572
|
-
"abs",
|
|
69573
|
-
"int",
|
|
69574
|
-
"float",
|
|
69575
|
-
"length",
|
|
69576
|
-
"d",
|
|
69577
|
-
"join",
|
|
69578
|
-
"replace",
|
|
69579
|
-
"first",
|
|
69580
|
-
"last",
|
|
69581
|
-
"sort",
|
|
69582
|
-
"reverse",
|
|
69583
|
-
"sum",
|
|
69584
|
-
"string",
|
|
69585
|
-
"list",
|
|
69586
|
-
"truncate",
|
|
69587
|
-
"time"
|
|
69588
|
-
];
|
|
69926
|
+
/**
|
|
69927
|
+
* The filters a template may use, derived from the catalogue. Anything else
|
|
69928
|
+
* is refused at parse time.
|
|
69929
|
+
*/
|
|
69930
|
+
var DEVICE_TEMPLATE_FILTERS = deviceTemplateFilterNames();
|
|
69589
69931
|
var DeviceTemplateRefusalSchema = z.object({
|
|
69590
69932
|
reason: z.enum([
|
|
69591
69933
|
"too-long",
|
|
@@ -70289,6 +70631,8 @@ var DeviceInfoSchema = z.object({
|
|
|
70289
70631
|
alias: DeviceAliasSchema.optional(),
|
|
70290
70632
|
/** Operator-organisational location label. `null` when unset. */
|
|
70291
70633
|
location: z.string().nullable(),
|
|
70634
|
+
/** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
|
|
70635
|
+
tags: TagsFieldSchema.optional(),
|
|
70292
70636
|
/** Soft-disabled flag. */
|
|
70293
70637
|
disabled: z.boolean(),
|
|
70294
70638
|
parentDeviceId: z.number().nullable(),
|
|
@@ -70450,6 +70794,8 @@ var SavedDeviceRowSchema = z.object({
|
|
|
70450
70794
|
name: z.string(),
|
|
70451
70795
|
/** Operator-organisational location label. `null` when unset. */
|
|
70452
70796
|
location: z.string().nullable(),
|
|
70797
|
+
/** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
|
|
70798
|
+
tags: TagsFieldSchema.optional(),
|
|
70453
70799
|
/** Soft-disabled flag. */
|
|
70454
70800
|
disabled: z.boolean(),
|
|
70455
70801
|
parentDeviceId: z.number().nullable(),
|
|
@@ -70472,6 +70818,8 @@ var DeviceMetaSchema = z.object({
|
|
|
70472
70818
|
* `DeviceMeta.userNamed`. */
|
|
70473
70819
|
userNamed: z.boolean().optional(),
|
|
70474
70820
|
location: z.string().nullable(),
|
|
70821
|
+
/** Operator tags (D1054), kept on the device meta beside `location`. Absent = no tags. */
|
|
70822
|
+
tags: TagsFieldSchema.optional(),
|
|
70475
70823
|
disabled: z.boolean(),
|
|
70476
70824
|
parentDeviceId: z.number().nullable(),
|
|
70477
70825
|
metadata: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
@@ -70768,6 +71116,17 @@ var deviceManagerCapability = {
|
|
|
70768
71116
|
kind: "mutation",
|
|
70769
71117
|
auth: "admin"
|
|
70770
71118
|
}),
|
|
71119
|
+
/** Replace the operator tags of one device (D1054). The list is normalised
|
|
71120
|
+
* on write (trimmed, deduplicated case-insensitively); `[]` clears them.
|
|
71121
|
+
* Tags are not inherited: unlike `setLocation`, nothing cascades to
|
|
71122
|
+
* descendants. */
|
|
71123
|
+
setTags: method(z.object({
|
|
71124
|
+
deviceId: z.number(),
|
|
71125
|
+
tags: TagsFieldSchema
|
|
71126
|
+
}), z.void(), {
|
|
71127
|
+
kind: "mutation",
|
|
71128
|
+
auth: "admin"
|
|
71129
|
+
}),
|
|
70771
71130
|
/** Update the device type. Writes the meta row, emits a
|
|
70772
71131
|
* `DeviceMetaChanged` event. Used by the kernel to apply
|
|
70773
71132
|
* `initialMeta.type` before device construction so the device
|
|
@@ -70924,6 +71283,7 @@ var deviceManagerCapability = {
|
|
|
70924
71283
|
deviceId: z.number(),
|
|
70925
71284
|
name: z.string().optional(),
|
|
70926
71285
|
location: z.string().nullable().optional(),
|
|
71286
|
+
tags: TagsFieldSchema.optional(),
|
|
70927
71287
|
type: z.enum(DeviceType).optional(),
|
|
70928
71288
|
integrationId: z.string().optional(),
|
|
70929
71289
|
linkDeviceId: z.number().nullable().optional(),
|
|
@@ -95165,7 +95525,7 @@ var OsdSourceSchema = z.discriminatedUnion("kind", [
|
|
|
95165
95525
|
z.object({ kind: z.literal("none") }),
|
|
95166
95526
|
z.object({
|
|
95167
95527
|
kind: z.literal("static"),
|
|
95168
|
-
text: z.string().max(
|
|
95528
|
+
text: z.string().max(OSD_TEMPLATE_TEXT_MAX)
|
|
95169
95529
|
}),
|
|
95170
95530
|
z.object({
|
|
95171
95531
|
kind: z.literal("template"),
|
|
@@ -106575,6 +106935,69 @@ var systemCapability = {
|
|
|
106575
106935
|
vocabulary: { notOperatorFacing: NOT_A_DEVICE.CLUSTER }
|
|
106576
106936
|
};
|
|
106577
106937
|
/**
|
|
106938
|
+
* tags — the registry of tag STYLES and the one place that renames or removes a
|
|
106939
|
+
* tag everywhere (D1054). A tag itself lives in the `tags` array of the record it
|
|
106940
|
+
* labels (a core block, a scheduler, a template, an action, a device); only its
|
|
106941
|
+
* colour token and icon are registered here. Provided by the core-blocks builtin,
|
|
106942
|
+
* the one place that knows every owner kind; devices are reached through
|
|
106943
|
+
* `deviceManager` over `ctx.api`.
|
|
106944
|
+
*
|
|
106945
|
+
* Tags compare trimmed and case-insensitively. `list` is the union of styled tags
|
|
106946
|
+
* and tags in use; a tag with no style answers a colour derived from its name and
|
|
106947
|
+
* the default icon (`styled: false`).
|
|
106948
|
+
*/
|
|
106949
|
+
var TagUsageCountsSchema = z.object({
|
|
106950
|
+
coreBlocks: z.number().int().nonnegative(),
|
|
106951
|
+
schedulers: z.number().int().nonnegative(),
|
|
106952
|
+
templates: z.number().int().nonnegative(),
|
|
106953
|
+
actions: z.number().int().nonnegative(),
|
|
106954
|
+
devices: z.number().int().nonnegative()
|
|
106955
|
+
});
|
|
106956
|
+
var TagEntrySchema = z.object({
|
|
106957
|
+
name: TagNameSchema,
|
|
106958
|
+
color: TagColorIdSchema,
|
|
106959
|
+
icon: IconKeySchema,
|
|
106960
|
+
/** `false` when the operator never chose a style: colour and icon are the derived defaults. */
|
|
106961
|
+
styled: z.boolean(),
|
|
106962
|
+
counts: TagUsageCountsSchema
|
|
106963
|
+
});
|
|
106964
|
+
var tagsCapability = {
|
|
106965
|
+
name: "tags",
|
|
106966
|
+
scope: "system",
|
|
106967
|
+
mode: "singleton",
|
|
106968
|
+
methods: {
|
|
106969
|
+
/** Every tag: styled or in use, with how many records of each kind carry it. */
|
|
106970
|
+
list: method(z.object({}), z.array(TagEntrySchema), { auth: "protected" }),
|
|
106971
|
+
/** Choose the colour and icon of a tag. The tag need not be in use. */
|
|
106972
|
+
setStyle: method(z.object({
|
|
106973
|
+
name: TagNameSchema,
|
|
106974
|
+
color: TagColorIdSchema,
|
|
106975
|
+
icon: IconKeySchema
|
|
106976
|
+
}), z.void(), {
|
|
106977
|
+
kind: "mutation",
|
|
106978
|
+
auth: "admin"
|
|
106979
|
+
}),
|
|
106980
|
+
/**
|
|
106981
|
+
* Rename a tag on EVERY owner in one call. When `to` already exists the two
|
|
106982
|
+
* merge and the TARGET's style wins (like `renameLocation`). An empty `to`
|
|
106983
|
+
* is refused before anything is written.
|
|
106984
|
+
*/
|
|
106985
|
+
rename: method(z.object({
|
|
106986
|
+
from: z.string(),
|
|
106987
|
+
to: z.string()
|
|
106988
|
+
}), z.object({ updated: TagUsageCountsSchema }), {
|
|
106989
|
+
kind: "mutation",
|
|
106990
|
+
auth: "admin"
|
|
106991
|
+
}),
|
|
106992
|
+
/** Drop a tag from every owner and delete its style. */
|
|
106993
|
+
remove: method(z.object({ name: z.string() }), z.object({ updated: TagUsageCountsSchema }), {
|
|
106994
|
+
kind: "mutation",
|
|
106995
|
+
auth: "admin"
|
|
106996
|
+
})
|
|
106997
|
+
},
|
|
106998
|
+
vocabulary: { notOperatorFacing: "tags are managed from the tag picker and the tags manager, not actuated" }
|
|
106999
|
+
};
|
|
107000
|
+
/**
|
|
106578
107001
|
* Tamper / case-open detection sensor. Drives Home Assistant
|
|
106579
107002
|
* `binary_sensor` entries with `device_class: tamper`. Push-driven.
|
|
106580
107003
|
*/
|
|
@@ -107448,7 +107871,9 @@ var TemplateRecordSchema = z.object({
|
|
|
107448
107871
|
createdAt: z.number(),
|
|
107449
107872
|
updatedAt: z.number(),
|
|
107450
107873
|
/** Shipped with CamStack (`builtin:` ids): listed beside the operator's, never updated or deleted. */
|
|
107451
|
-
builtIn: z.literal(true).optional()
|
|
107874
|
+
builtIn: z.literal(true).optional(),
|
|
107875
|
+
/** Operator tags (D1054). Absent = no tags. */
|
|
107876
|
+
tags: TagsFieldSchema.optional()
|
|
107452
107877
|
});
|
|
107453
107878
|
var TemplateWriteResultSchema = z.discriminatedUnion("status", [z.object({
|
|
107454
107879
|
status: z.literal("saved"),
|
|
@@ -107492,7 +107917,8 @@ var templateCapability = {
|
|
|
107492
107917
|
create: method(z.object({
|
|
107493
107918
|
kind: TemplateKindSchema,
|
|
107494
107919
|
name: z.string().min(1).max(120),
|
|
107495
|
-
payload: z.unknown()
|
|
107920
|
+
payload: z.unknown(),
|
|
107921
|
+
tags: TagsFieldSchema.optional()
|
|
107496
107922
|
}), TemplateWriteResultSchema, {
|
|
107497
107923
|
kind: "mutation",
|
|
107498
107924
|
auth: "admin"
|
|
@@ -107500,7 +107926,8 @@ var templateCapability = {
|
|
|
107500
107926
|
update: method(z.object({
|
|
107501
107927
|
id: z.string().min(1),
|
|
107502
107928
|
name: z.string().min(1).max(120).optional(),
|
|
107503
|
-
payload: z.unknown().optional()
|
|
107929
|
+
payload: z.unknown().optional(),
|
|
107930
|
+
tags: TagsFieldSchema.optional()
|
|
107504
107931
|
}), TemplateWriteResultSchema, {
|
|
107505
107932
|
kind: "mutation",
|
|
107506
107933
|
auth: "admin"
|
|
@@ -111404,6 +111831,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
111404
111831
|
streamSignalsCapability,
|
|
111405
111832
|
switchCapability,
|
|
111406
111833
|
systemCapability,
|
|
111834
|
+
tagsCapability,
|
|
111407
111835
|
tamperCapability,
|
|
111408
111836
|
temperatureSensorCapability,
|
|
111409
111837
|
templateCapability,
|
|
@@ -122064,6 +122492,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
122064
122492
|
access: "create",
|
|
122065
122493
|
role: "admin"
|
|
122066
122494
|
},
|
|
122495
|
+
"deviceManager.setTags": {
|
|
122496
|
+
capName: "device-manager",
|
|
122497
|
+
capScope: "system",
|
|
122498
|
+
addonId: null,
|
|
122499
|
+
access: "create",
|
|
122500
|
+
role: "admin"
|
|
122501
|
+
},
|
|
122067
122502
|
"deviceManager.setType": {
|
|
122068
122503
|
capName: "device-manager",
|
|
122069
122504
|
capScope: "system",
|
|
@@ -128777,6 +129212,34 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
128777
129212
|
access: "create",
|
|
128778
129213
|
role: "admin"
|
|
128779
129214
|
},
|
|
129215
|
+
"tags.list": {
|
|
129216
|
+
capName: "tags",
|
|
129217
|
+
capScope: "system",
|
|
129218
|
+
addonId: null,
|
|
129219
|
+
access: "view",
|
|
129220
|
+
role: "admin"
|
|
129221
|
+
},
|
|
129222
|
+
"tags.remove": {
|
|
129223
|
+
capName: "tags",
|
|
129224
|
+
capScope: "system",
|
|
129225
|
+
addonId: null,
|
|
129226
|
+
access: "delete",
|
|
129227
|
+
role: "admin"
|
|
129228
|
+
},
|
|
129229
|
+
"tags.rename": {
|
|
129230
|
+
capName: "tags",
|
|
129231
|
+
capScope: "system",
|
|
129232
|
+
addonId: null,
|
|
129233
|
+
access: "create",
|
|
129234
|
+
role: "admin"
|
|
129235
|
+
},
|
|
129236
|
+
"tags.setStyle": {
|
|
129237
|
+
capName: "tags",
|
|
129238
|
+
capScope: "system",
|
|
129239
|
+
addonId: null,
|
|
129240
|
+
access: "create",
|
|
129241
|
+
role: "admin"
|
|
129242
|
+
},
|
|
128780
129243
|
"tamper.getStatus": {
|
|
128781
129244
|
capName: "tamper",
|
|
128782
129245
|
capScope: "device",
|
|
@@ -130917,6 +131380,11 @@ Object.freeze({
|
|
|
130917
131380
|
form: "single",
|
|
130918
131381
|
optional: false
|
|
130919
131382
|
}],
|
|
131383
|
+
"deviceManager.setTags": [{
|
|
131384
|
+
name: "deviceId",
|
|
131385
|
+
form: "single",
|
|
131386
|
+
optional: false
|
|
131387
|
+
}],
|
|
130920
131388
|
"deviceManager.setType": [{
|
|
130921
131389
|
name: "deviceId",
|
|
130922
131390
|
form: "single",
|
|
@@ -135723,4 +136191,4 @@ function searchRank(rawQuery, fields) {
|
|
|
135723
136191
|
return matchRank(label, keywords, (fields.identifiers ?? []).map(normalizeSearchText).filter((identifier) => identifier.length > 0), query) ?? fuzzyMatchRank(label, query) ?? bestFuzzy(keywords, query);
|
|
135724
136192
|
}
|
|
135725
136193
|
//#endregion
|
|
135726
|
-
export { DEVICE_TOMBSTONE_RETENTION_MS as $, resolveRunnerId as $a, isInstanceEnabled as $c, modeMayWrite as $i, climateControlCapability as $n, COMPOSER_ADDON_ID as $o, filesystemBrowseCapability as $r, RECORD_DELETE_BATCH as $s, RemoteAssumedStateSchema as $t, CatalogFileSchema as A, readStoredRemoteConfig as Aa, collectSecretMarkerRefs as Ac, kebabToCamel as Ai, vocabActionIdFor as Al, armRemovalReconcile as An, supportedRuntimes as Ao, deviceManagerCapability as Ar, openReset as As, LOG_LEVEL_RANK as At, DEFAULT_HOLD_OVERRIDE as B, replacedFieldKeys as Ba, emitDownForOwnedCaps as Bc, lockDoorLinkOfComposition as Bi, buildDeviceSignatureMessage as Bn, unmetRequirements as Bo, evaluateCompositionField as Br, DATAPLANE_SECRET_HEADER as Bs, PREFERENCES_MAX_VALUE_BYTES as Bt, CATALOG_LANGS as C, problemsBlockSave as Ca, asString$1 as Cc, isDefaultAppConnectionEndpoint as Ci, secretTreeFromSchema as Cl, addonPagesCapability as Cn, storageAdminCapability as Co, defineExtensionSlotProvider as Cr, helperMembers as Cs, HUB_MDNS_TXT_KEYS as Ct, CORE_BLOCK_ADDON_PREFIX as D, proposeRunningThreshold as Da, buildSecretRef as Dc, isObjectInput as Di, toSecretFieldView as Dl, alertEpisodePayload as Dn, storageProviderCapability as Do, deviceCredentialsCapability as Dr, isForwardInputRef as Ds, KEYCHAIN_RESET_TRIGGER_ACTOR as Dt, CORE_BLOCKS_ADDON_ID as E, projectDeviceRow as Ea, auditedFields as Ec, isLocationEnabled as Ei, toNodeId as El, alertEpisodeId as En, storageOccupancyCapability as Eo, describeUnmet as Er, integrateReading as Es, INTERNAL_ACTION_PREFIX as Et, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as F, reexpandAutomationInstance as Fa, customAction as Fc, lifecycleJobSchema as Fi, DeviceRole as Fl, batteryCapability as Fn, timedRunLimitOf as Fo, deviceStatusCapability as Fr, toExpressionValue as Fs, MediaPlayerStatusSchema as Ft, DEVICE_NONCE_TTL_MS as G, resolveCoreBlockFiles as Ga, getDebugInterest as Gc, mayWriteToLocation as Gi, cameraGridLayoutCapability as Gn, valveCapability as Go, expressionContainsBuiltinCall as Gr, FilterRequiredError as Gs, PreferenceDeviceIdSchema as Gt, DEVICE_ENROLLMENT_TTL_MS as H, resolveAppConnections as Ha, entryBody as Hc, logLevelAtMost as Hi, buildStreamParamsConfigSchema as Hn, validateComposition as Ho, evaluateWhenTree as Hr, DEVICE_STATUS_METHOD as Hs, PackageRequiresSchema as Ht, DATABASE_SNAPSHOT_SUFFIX as I, remoteCapability as Ia, defineAddonMigrations as Ic, localDateOf as Ii, DeviceType as Il, brightnessCapability as In, timedRunMaxIn as Io, deviceTransitionsCapability as Ir, wattMillisecondsToKwh as Is, MigrationLedgerEntrySchema as It, DEVICE_TEMPLATE_FILTERS as J, resolveLocationMode as Ja, hydrateSchema as Jc, memoizePinnedFfmpeg as Ji, capUnitResolver as Jn, vectorStoreCapability as Jo, fanAxisPath as Jr, InvalidRecordError as Js, QuantityUnitError as Jt, DEVICE_SAN_CREDENTIAL_PREFIX as K, resolveHeroLayout as Ka, historyItemFieldPath as Kc, mediaPlayerCapability as Ki, canonicalIconKey as Kn, vectorDimFromBase64 as Ko, extractNestedAddonId as Kr, ForeignSecretMarkerError as Ks, PreferenceNamespaceSchema as Kt, DATABASE_SNAPSHOT_TIMEOUT_MS as L, remoteLayoutComponentsCapability as La, defineCustomActions as Lc, localNetworkCapability as Li, errMsg as Ll, buildActionSteps as Ln, timedRunQuickRun as Lo, enumerateInferenceDevices as Lr, BaseAddon as Ls, MigrationMetaSchema as Lt, ConsumableItemSchema as M, recordEntriesCapability as Ma, commandEffect as Mc, keychainCapability as Mi, withoutCallerStamp as Ml, authProviderCapability as Mn, switchStateOfMode as Mo, deviceRemovalHookCapability as Mr, planResetTier as Ms, MIGRATION_API_V1_METHODS as Mt, CoreBlockSchema as N, recordsCapability as Na, commandOrigin as Nc, legacyAutoLinkIds as Ni, COMPOSED_DEVICE_STABLE_ID_PREFIX as Nl, backupCapability as Nn, templateCapability as No, deviceRunsCapability as Nr, planStatisticTier as Ns, MINUTES_PER_DAY as Nt, CREDENTIAL_TOKEN_AUDIENCE as O, ptzAutotrackCapability as Oa, collectSecretConfigKeys as Oc, isSameAddonId as Oi, transformSecretWrite as Ol, alertsCapability as On, streamCatalogCapability as Oo, deviceExtensionCapability as Or, isHistoryHelper as Os, KeychainAuditEntrySchema as Ot, CredentialTokenClaimsSchema as P, reducePoints as Pa, createEvent as Pc, legacyModeOf as Pi, DeviceFeature as Pl, bareAddonId as Pn, timedRunCapability as Po, deviceStateCapability as Pr, statisticCadenceMs as Ps, MOTION_CLOSE_AFTER_MS as Pt, DEVICE_TEMPLATE_VALUES_CAP as Q, resolveRemoteSource as Qa, isEvent as Qc, modeForSwitch as Qi, checkTemplatePayload as Qn, zoneOnlySite as Qo, featureForwards as Qr, RECORD_BATCH_MAX_BYTES as Qs, RecordingStatusSchema as Qt, DATA_STORE_DATABASES as R, remoteSourceSteps as Ra, defineEntryKind as Rc, locationIconKey as Ri, featuresOfBoundCaps as Rl, buildCapabilityLookup as Rn, timedRunSeconds as Ro, enumerateItemArrayFields as Rr, BatchTooLargeError as Rs, NetworkTunnelStartedDataSchema as Rt, CAP_NAMES_WITH_STATUS as S, prepareRecipeUnits as Sa, asNumber as Sc, isCredentialTokenPayload as Si, secretTreeFromPaths as Sl, addonIdOfActionId as Sn, stableIdMapOf as So, decodeVectorBase64 as Sr, evaluateStatistic as Ss, HUB_MDNS_SERVICE_TYPE as St, COMPOSER_RUNNER_ID as T, processTimeZoneOr as Ta, assertValidDeclaration as Tc, isKernelDerivedFeature as Ti, sleep as Tl, addonWidgetsCapability as Tn, storageMigrationCapability as To, describeComposableCaps as Tr, implementedMethodsOf as Ts, IDLE_ACTION_STATUS as Tt, DEVICE_HISTORY_ENERGY_KEY as U, resolveBucketMs as Ua, expandCapMethods as Uc, looseSchema as Ui, builtinAutomationTemplate as Un, validateCustomAddress as Uo, evictionPolicyOfLocation as Ur, DeclarationRefusedError as Us, PetFountainStatusSchema as Ut, DERIVED_CAMERA_SILENCED_CAP_NAMES as V, resolveActionVariables as Va, emitReadiness as Vc, logDestinationCapability as Vi, buildHeroModel as Vn, userManagementCapability as Vo, evaluateStepCondition as Vr, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Vs, PROPOSAL_MIN_SPAN_MS as Vt, DEVICE_ID_FIELD as W, resolveCoreBlockEntry as Wa, formatSecretScope as Wc, mayReadLocation as Wi, calendarsCapability as Wn, validateSchedulerInput as Wo, expandContainer as Wr, DeviceTransitionSchema as Ws, PowerSourceInfoSchema as Wt, DEVICE_TEMPLATE_MAX_OUTPUT as X, resolveMutate as Xa, isDebugChannelName as Xc, metricsProviderCapability as Xi, checkDeviceAlias as Xn, withDefaultRunning as Xo, fanOutTargets as Xr, PlaintextSecretError as Xs, REMOTE_MEDIA_COMMANDS as Xt, DEVICE_TEMPLATE_MAX_LENGTH as Y, resolveMethodAuth as Ya, isCommand as Yc, methodRefusal as Yi, catalogueIssues as Yn, weekdayOfLocalDate as Yo, fanControlCapability as Yr, NoCallerError as Ys, RECORDING_SOURCE_CAMSTACK_ADDON as Yt, DEVICE_TEMPLATE_THIS_ALIAS as Z, resolveNotificationTapAddress as Za, isDeviceConfigCap as Zc, migrationsCapability as Zi, checkRoleAddress as Zn, withLocationMode as Zo, fanPresetsCapability as Zr, RECORD_BATCH_MAX as Zs, ROOT_BUCKET_KEY as Zt, BUILTIN_REMOTE_COMPONENTS as _, platformProbeCapability as _a, UnknownRecordKindError as _c, isAlertEpisodeSeverity as _i, recordSecretRef as _l, UNATTRIBUTED_BUCKET_KEY as _n, shortHostname as _o, customKeyOfRole as _r, compositionSliceKey as _s, FieldClaimModeSchema as _t, AGENT_MDNS_SERVICE_TYPE as a, normalizeUnit as aa, ReadinessRegistry as ac, generateAutomationBlock as ai, isSecretMarkerLike as al, SchedulerError as an, runtimeStatePolicyFor as ao, composerCapability as ar, HOUR_MS as as, DiscoveryProposalBodySchema as at, CAMERA_SWITCH_ORDER as b, powerSourceLinkOfComposition as ba, actionEffect as bc, isBuiltinTemplateId as bi, ruleFireOfClaim as bl, actionWaitTotalMs as bn, snapshotCapability as bo, declarationOwnerNodeId as br, disarmRoseMemory as bs, HISTORY_CATALOG as bt, ActionError as c, occurrenceOn as ca, RecordKindDeclarationSchema as cc, groupTemplate as ci, mapSecretLeaves as cl, ServerNameSchema as cn, scopesAllowDeviceCap as co, compositionUnionReads as cr, buildFfmpegArgs as cs, EMPTY_REMOTE_CONFIG as ct, ActionTargetResolver as d, parseColorInput as da, RecordUniqueViolationError as dc, instanceCodeHash as di, normalizeNodeId as dl, StorageCleanupJobSchema as dn, seedInstanceOnce as do, coreBlockComposition as dr, capAppliesToDeviceKind as ds, FAN_OSCILLATION_AXES as dt, motionCapability as ea, RECORD_SECRET_COLLECTION_PREFIX as ec, findChannelSource as ei, isKeychainStoredField as el, RemoteLayoutPayloadSchema as en, resolveStepArgs as eo, collectDeviceTemplates as er, CompositionSchema as es, DataStoreDatabaseSchema as et, ActionVariableSchema as f, parseStreamParamsFormPatch as fa, RevConflictError as fc, integrationInstancesCapability as fi, normalizeSecretOwner as fl, StorageLocationModeSchema as fn, settingsStoreCapability as fo, coreBlockIdFromAddonId as fr, cloneStatefulExpressionMemory as fs, FAN_OSCILLATION_AXIS_SETTABLE as ft, BUILTIN_AUTOMATION_TEMPLATES as g, planComposition as ga, UnindexedFilterError as gc, isAlertEpisodeOpen as gi, readinessKey as gl, TokenScopeSchema as gn, sharedColorModes as go, createDeviceExtensionProvider as gr, compositionItemFieldPath as gs, FanPresetSchema as gt, AutomationTemplatePayloadSchema as h, pickAppLinkHub as ha, TransactRefusedError as hc, isAddonInstanceId as hi, parseSecretRef as hl, TemplateKindSchema as hn, sharedActuatorMethods as ho, coverCapability as hr, compositionFeatureEnabled as hs, FanDirectionSchema as ht, ACTUATOR_TEMPLATE_IDS as i, normalizeCoreBlockWrite as ia, RUNTIME_DEFAULTS as ic, gbToBytes as ii, isSecretMarker as il, STREAM_PROFILE_META as in, runtimeFieldUnit as io, compileScalarOverride as ir, HISTORY_SLOW_MS as is, DeviceTombstoneSchema as it, ConditionMirror as j, reconcileReportedFeatures as ja, collectZodSecretPaths as jc, keychainAdminCapability as ji, vocabCall as jl, assertStepsOffered as jn, switchCapability as jo, deviceOffersActions as jr, openStatistic as js, METHOD_ACCESS_MAP as jt, CalendarPreferencesSchema as k, readRecipeLiteral as ka, collectSecretLeaves as kc, isVoidInput as ki, userError as kl, appendTrace as kn, streamQualityLabel as ko, deviceHistoryCapability as kr, nextLocalMidnight as ks, KeychainResetRecordSchema as kt, ActionMinDelaySecSchema as l, orderMigrations as la, RecordNotFoundError as lc, hasTimeLeaves as li, nodeIdOfScopedKey as ll, SetOscillationAxisInputSchema as ln, scoreRuntimes as lo, consumablesCapability as lr, canonicalStoredBlockTarget as ls, ExportNameRefusedError as lt, AutomationStateDocSchema as m, petFountainWaterItem as ma, StoredRecordKindDeclarationSchema as mc, interpolate as mi, parseJsonUnknown as ml, StorageMigrationJobSchema as mn, sharedActuatorFeatures as mo, coreBlocksCapability as mr, composedDeviceStableId as ms, FanControlStatusSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, nextTimeBoundaryInMs as na, REDACTED_SECRET as nc, formatDeviceRevoker as ni, isSecretClear as nl, STORAGE_ACCESS_FALLBACK as nn, runFanOut as no, colorCapability as nr, DEFAULT_HISTORY_RETENTION as ns, DeviceRunSchema as nt, AGENT_MDNS_TXT_KEYS as o, objectInputDeclaresAddonId as oa, ReadinessTimeoutError as oc, generateDeviceAlias as oi, isSecretRefOwnedBy as ol, SchedulerSchema as on, schedulersCapability as oo, compositionFieldKey as or, HelperMemberSchema as os, EMPTY_AUTOMATION_STATE as ot, AlertSchema as p, petFountainCapability as pa, SECRET_CLEAR as pc, internalActionId as pi, parseJsonObject as pl, StorageLocationTypeSchema as pn, settleDeviceFeatures as po, coreBlockSourceKind as pr, composedDeviceRef as ps, FIRST_LEVEL_MACRO_CLASSES as pt, DEVICE_SAN_USER_PREFIX as q, resolveHubAddressRoles as qa, historyUnitFor as qc, mediaPlayerFeaturesOfRoles as qi, canonicalStoredStepTargets as qn, vectorIndexDimConflictError as qo, extractSourceInfoFromMetadata as qr, HISTORY_DEFAULT_MIN_INTERVAL_MS as qs, PreferenceValueSchema as qt, ACTUATOR_METHODS as r, normalizeActionUnits as ra, REMOVE_LEAF as rc, formatMinutes as ri, isSecretFieldView as rl, STORAGE_LOCATION_MODES as rn, runSteps as ro, compareVersions as rr, HISTORY_FAST_MS as rs, DeviceStatusSchema as rt, ALL_CAPABILITY_DEFINITIONS as s, objectInputDeclaresRequiredDeviceId as sa, RecordIntegrationInstances as sc, groupCommandsCapability as si, makeSecretMarker as sl, ScopedTokenSchema as sn, scopesAllowAddon as so, compositionSourceRefs as sr, MINUTE_MS as ss, EMPTY_REMOTE_ASSUMED_STATE as st, ACTION_RUN_MAX_MS as t, nextOccurrence as ta, RECORD_SWEEP_INTERVAL_MS as tc, foldSnapshotByFunction as ti, isReadingQuantity as tl, RunningStateStatusSchema as tn, resolveTemplateRef as to, collectWhenMirrorSources as tr, DAY_MS as ts, DeclaredDevices as tt, ActionStepSchema as u, parseAcceleratorFactsJson as ua, RecordTooLargeError as uc, heroLayoutCapability as ui, nodePin as ul, SsoBridgeClaimsSchema as un, searchRank as uo, coreBlockAddonId as ur, canonicalStoredDeviceType as us, FAN_CAPTURE_FIELDS as ut, BaseDevice as v, powerSourceActuatorConflicts as va, VocabActionError as vc, isAppLinkBase as vi, resolveCapMount as vl, UserRecordSchema as vn, siteFor as vo, dataStoreProviderCapability as vr, compositionSourceKey as vs, FieldClaimSchema as vt, COMPOSED_ITEM_FIXED_FIELDS as w, procedureAuthKey as wa, assertTransactScope as wc, isInternalActionId as wi, secretViewsOf as wl, addonSettingsCapability as wn, storageCapability as wo, deriveBatteryPresence as wr, historyRetentionFromSettings as ws, HvacModeSchema as wt, CAMSTACK_APP_LINK_ORIGIN as x, preconditionOf as xa, asJsonObject as xc, isCollectionArrayMethod as xi, scopeKey as xl, actionsCapability as xn, splitTranslationRef as xo, declaredSeriesKind as xr, evaluateDerivative as xs, HISTORY_ITEM_CATALOG as xt, BatteryStatusSchema as y, powerSourceCapability as ya, WELL_KNOWN_TAB_MAP as yc, isArrayOutputSchema as yi, resolveSecretMarkers as yl, actionSourceCapability as yn, siteZoneKey as yo, databaseSnapshotCapability as yr, createStatefulExpressionMemory as ys, GroupCommandResultSchema as yt, DAY_NAMES as z, replaceRecipeLiteral as za, defineRecordKinds as zc, lockControlCapability as zi, EventCategory as zl, buildDeviceEnrollmentLink as zn, toTimings as zo, enumerateSchemaFields as zr, CALLER_STAMPED_CAPABILITIES as zs, PET_FOUNTAIN_WATER_KEY as zt };
|
|
136194
|
+
export { DEVICE_TOMBSTONE_RETENTION_MS as $, resolveHeroLayout as $a, formatSecretScope as $c, methodRefusal as $i, checkDeviceAlias as $n, validateSchedulerInput as $o, fanControlCapability as $r, DeviceTransitionSchema as $s, RemoteAssumedStateSchema as $t, CatalogFileSchema as A, processTimeZoneOr as Aa, asJsonObject as Ac, isLocationEnabled as Ai, scopeKey as Al, alertEpisodePayload as An, storageAdminCapability as Ao, describeUnmet as Ar, evaluateDerivative as As, LOG_LEVEL_RANK as At, DEFAULT_HOLD_OVERRIDE as B, reexpandAutomationInstance as Ba, collectZodSecretPaths as Bc, localDateOf as Bi, vocabCall as Bl, buildActionSteps as Bn, tagKey as Bo, deviceTransitionsCapability as Br, openStatistic as Bs, PREFERENCES_MAX_VALUE_BYTES as Bt, CATALOG_LANGS as C, powerSourceActuatorConflicts as Ca, StoredRecordKindDeclarationSchema as Cc, isArrayOutputSchema as Ci, parseJsonUnknown as Cl, actionWaitTotalMs as Cn, sharedColorModes as Co, declarationOwnerNodeId as Cr, composedDeviceStableId as Cs, HUB_MDNS_TXT_KEYS as Ct, CORE_BLOCK_ADDON_PREFIX as D, prepareRecipeUnits as Da, VocabActionError as Dc, isDefaultAppConnectionEndpoint as Di, resolveCapMount as Dl, addonSettingsCapability as Dn, snapshotCapability as Do, defineExtensionSlotProvider as Dr, compositionSourceKey as Ds, KEYCHAIN_RESET_TRIGGER_ACTOR as Dt, CORE_BLOCKS_ADDON_ID as E, preconditionOf as Ea, UnknownRecordKindError as Ec, isCredentialTokenPayload as Ei, recordSecretRef as El, addonPagesCapability as En, siteZoneKey as Eo, defaultTagColorId as Er, compositionSliceKey as Es, INTERNAL_ACTION_PREFIX as Et, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as F, readStoredRemoteConfig as Fa, auditedFields as Fc, keychainAdminCapability as Fi, toNodeId as Fl, authProviderCapability as Fn, streamCatalogCapability as Fo, deviceOffersActions as Fr, integrateReading as Fs, MediaPlayerStatusSchema as Ft, DEVICE_NONCE_TTL_MS as G, renameInTags as Ga, defineAddonMigrations as Gc, logDestinationCapability as Gi, DeviceType as Gl, buildStreamParamsConfigSchema as Gn, timedRunMaxIn as Go, evaluateStepCondition as Gr, wattMillisecondsToKwh as Gs, PreferenceDeviceIdSchema as Gt, DEVICE_ENROLLMENT_TTL_MS as H, remoteLayoutComponentsCapability as Ha, commandOrigin as Hc, locationIconKey as Hi, COMPOSED_DEVICE_STABLE_ID_PREFIX as Hl, buildDeviceEnrollmentLink as Hn, templateCapability as Ho, enumerateItemArrayFields as Hr, planStatisticTier as Hs, PackageRequiresSchema as Ht, DATABASE_SNAPSHOT_SUFFIX as I, reconcileReportedFeatures as Ia, buildSecretRef as Ic, keychainCapability as Ii, toSecretFieldView as Il, backupCapability as In, streamQualityLabel as Io, deviceRemovalHookCapability as Ir, isForwardInputRef as Is, MigrationLedgerEntrySchema as It, DEVICE_TEMPLATE_FILTERS as J, resolveActionVariables as Ja, defineRecordKinds as Jc, mayReadLocation as Ji, EventCategory as Jl, cameraGridLayoutCapability as Jn, toTimings as Jo, expandContainer as Jr, CALLER_STAMPED_CAPABILITIES as Js, QuantityUnitError as Jt, DEVICE_SAN_CREDENTIAL_PREFIX as K, replaceRecipeLiteral as Ka, defineCustomActions as Kc, logLevelAtMost as Ki, errMsg as Kl, builtinAutomationTemplate as Kn, timedRunQuickRun as Ko, evaluateWhenTree as Kr, BaseAddon as Ks, PreferenceNamespaceSchema as Kt, DATABASE_SNAPSHOT_TIMEOUT_MS as L, recordEntriesCapability as La, collectSecretConfigKeys as Lc, legacyAutoLinkIds as Li, transformSecretWrite as Ll, bareAddonId as Ln, supportedRuntimes as Lo, deviceRunsCapability as Lr, isHistoryHelper as Ls, MigrationMetaSchema as Lt, ConsumableItemSchema as M, proposeRunningThreshold as Ma, asString$1 as Mc, isSameAddonId as Mi, secretTreeFromSchema as Ml, appendTrace as Mn, storageMigrationCapability as Mo, deviceExtensionCapability as Mr, helperMembers as Ms, MIGRATION_API_V1_METHODS as Mt, CoreBlockSchema as N, ptzAutotrackCapability as Na, assertTransactScope as Nc, isVoidInput as Ni, secretViewsOf as Nl, armRemovalReconcile as Nn, storageOccupancyCapability as No, deviceHistoryCapability as Nr, historyRetentionFromSettings as Ns, MINUTES_PER_DAY as Nt, CREDENTIAL_TOKEN_AUDIENCE as O, problemsBlockSave as Oa, WELL_KNOWN_TAB_MAP as Oc, isInternalActionId as Oi, resolveSecretMarkers as Ol, addonWidgetsCapability as On, splitTranslationRef as Oo, deriveBatteryPresence as Or, createStatefulExpressionMemory as Os, KeychainAuditEntrySchema as Ot, CredentialTokenClaimsSchema as P, readRecipeLiteral as Pa, assertValidDeclaration as Pc, kebabToCamel as Pi, sleep as Pl, assertStepsOffered as Pn, storageProviderCapability as Po, deviceManagerCapability as Pr, implementedMethodsOf as Ps, MOTION_CLOSE_AFTER_MS as Pt, DEVICE_TEMPLATE_VALUES_CAP as Q, resolveCoreBlockFiles as Qa, expandCapMethods as Qc, memoizePinnedFfmpeg as Qi, catalogueIssues as Qn, validateCustomAddress as Qo, fanAxisPath as Qr, DeclarationRefusedError as Qs, RecordingStatusSchema as Qt, DATA_STORE_DATABASES as R, recordsCapability as Ra, collectSecretLeaves as Rc, legacyModeOf as Ri, userError as Rl, batteryCapability as Rn, switchCapability as Ro, deviceStateCapability as Rr, nextLocalMidnight as Rs, NetworkTunnelStartedDataSchema as Rt, CAP_NAMES_WITH_STATUS as S, platformProbeCapability as Sa, SECRET_CLEAR as Sc, isAppLinkBase as Si, parseJsonObject as Sl, actionSourceCapability as Sn, sharedActuatorMethods as So, databaseSnapshotCapability as Sr, composedDeviceRef as Ss, HUB_MDNS_SERVICE_TYPE as St, COMPOSER_RUNNER_ID as T, powerSourceLinkOfComposition as Ta, UnindexedFilterError as Tc, isCollectionArrayMethod as Ti, readinessKey as Tl, addonIdOfActionId as Tn, siteFor as To, decodeVectorBase64 as Tr, compositionItemFieldPath as Ts, IDLE_ACTION_STATUS as Tt, DEVICE_HISTORY_ENERGY_KEY as U, remoteSourceSteps as Ua, createEvent as Uc, lockControlCapability as Ui, DeviceFeature as Ul, buildDeviceSignatureMessage as Un, timedRunCapability as Uo, enumerateSchemaFields as Ur, statisticCadenceMs as Us, PetFountainStatusSchema as Ut, DERIVED_CAMERA_SILENCED_CAP_NAMES as V, remoteCapability as Va, commandEffect as Vc, localNetworkCapability as Vi, withoutCallerStamp as Vl, buildCapabilityLookup as Vn, tagsCapability as Vo, enumerateInferenceDevices as Vr, planResetTier as Vs, PROPOSAL_MIN_SPAN_MS as Vt, DEVICE_ID_FIELD as W, removeFromTags as Wa, customAction as Wc, lockDoorLinkOfComposition as Wi, DeviceRole as Wl, buildHeroModel as Wn, timedRunLimitOf as Wo, evaluateCompositionField as Wr, toExpressionValue as Ws, PowerSourceInfoSchema as Wt, DEVICE_TEMPLATE_MAX_OUTPUT as X, resolveBucketMs as Xa, emitReadiness as Xc, mediaPlayerCapability as Xi, canonicalStoredStepTargets as Xn, userManagementCapability as Xo, extractNestedAddonId as Xr, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Xs, REMOTE_MEDIA_COMMANDS as Xt, DEVICE_TEMPLATE_MAX_LENGTH as Y, resolveAppConnections as Ya, emitDownForOwnedCaps as Yc, mayWriteToLocation as Yi, canonicalIconKey as Yn, unmetRequirements as Yo, expressionContainsBuiltinCall as Yr, DATAPLANE_SECRET_HEADER as Ys, RECORDING_SOURCE_CAMSTACK_ADDON as Yt, DEVICE_TEMPLATE_THIS_ALIAS as Z, resolveCoreBlockEntry as Za, entryBody as Zc, mediaPlayerFeaturesOfRoles as Zi, capUnitResolver as Zn, validateComposition as Zo, extractSourceInfoFromMetadata as Zr, DEVICE_STATUS_METHOD as Zs, ROOT_BUCKET_KEY as Zt, BUILTIN_REMOTE_COMPONENTS as _, parseStreamParamsFormPatch as _a, RecordKindDeclarationSchema as _c, internalActionId as _i, mapSecretLeaves as _l, TagsFieldSchema as _n, searchRank as _o, coreBlocksCapability as _r, buildFfmpegArgs as _s, FieldClaimModeSchema as _t, AGENT_MDNS_SERVICE_TYPE as a, nextOccurrence as aa, PlaintextSecretError as ac, foldSnapshotByFunction as ai, isDebugChannelName as al, SchedulerError as an, resolveRemoteSource as ao, colorCapability as ar, withDefaultRunning as as, DiscoveryProposalBodySchema as at, CAMERA_SWITCH_ORDER as b, pickAppLinkHub as ba, RecordUniqueViolationError as bc, isAlertEpisodeOpen as bi, normalizeNodeId as bl, UNATTRIBUTED_BUCKET_KEY as bn, settleDeviceFeatures as bo, customKeyOfRole as br, capAppliesToDeviceKind as bs, HISTORY_CATALOG as bt, ActionError as c, normalizeCoreBlockWrite as ca, RECORD_DELETE_BATCH as cc, gbToBytes as ci, isInstanceEnabled as cl, ServerNameSchema as cn, resolveTemplateRef as co, composerCapability as cr, COMPOSER_ADDON_ID as cs, EMPTY_REMOTE_CONFIG as ct, ActionTargetResolver as d, objectInputDeclaresAddonId as da, REDACTED_SECRET as dc, groupCommandsCapability as di, isSecretClear as dl, StorageCleanupJobSchema as dn, runtimeFieldUnit as do, compositionUnionReads as dr, DEFAULT_HISTORY_RETENTION as ds, FAN_OSCILLATION_AXES as dt, metricsProviderCapability as ea, FilterRequiredError as ec, fanOutTargets as ei, getDebugInterest as el, RemoteLayoutPayloadSchema as en, resolveHubAddressRoles as eo, checkRoleAddress as er, valveCapability as es, DataStoreDatabaseSchema as et, ActionVariableSchema as f, objectInputDeclaresRequiredDeviceId as fa, REMOVE_LEAF as fc, groupTemplate as fi, isSecretFieldView as fl, StorageLocationModeSchema as fn, runtimeStatePolicyFor as fo, consumablesCapability as fr, HISTORY_FAST_MS as fs, FAN_OSCILLATION_AXIS_SETTABLE as ft, BUILTIN_AUTOMATION_TEMPLATES as g, parseColorInput as ga, RecordIntegrationInstances as gc, integrationInstancesCapability as gi, makeSecretMarker as gl, TagStyleSchema as gn, scoreRuntimes as go, coreBlockSourceKind as gr, MINUTE_MS as gs, FanPresetSchema as gt, AutomationTemplatePayloadSchema as h, parseAcceleratorFactsJson as ha, ReadinessTimeoutError as hc, instanceCodeHash as hi, isSecretRefOwnedBy as hl, TagNameSchema as hn, scopesAllowDeviceCap as ho, coreBlockIdFromAddonId as hr, HelperMemberSchema as hs, FanDirectionSchema as ht, ACTUATOR_TEMPLATE_IDS as i, motionCapability as ia, NoCallerError as ic, findChannelSource as ii, isCommand as il, STREAM_PROFILE_META as in, resolveNotificationTapAddress as io, collectWhenMirrorSources as ir, weekdayOfLocalDate as is, DeviceTombstoneSchema as it, ConditionMirror as j, projectDeviceRow as ja, asNumber as jc, isObjectInput as ji, secretTreeFromPaths as jl, alertsCapability as jn, storageCapability as jo, deviceCredentialsCapability as jr, evaluateStatistic as js, METHOD_ACCESS_MAP as jt, CalendarPreferencesSchema as k, procedureAuthKey as ka, actionEffect as kc, isKernelDerivedFeature as ki, ruleFireOfClaim as kl, alertEpisodeId as kn, stableIdMapOf as ko, describeComposableCaps as kr, disarmRoseMemory as ks, KeychainResetRecordSchema as kt, ActionMinDelaySecSchema as l, normalizeTags as la, RECORD_SECRET_COLLECTION_PREFIX as lc, generateAutomationBlock as li, isKeychainStoredField as ll, SetOscillationAxisInputSchema as ln, runFanOut as lo, compositionFieldKey as lr, CompositionSchema as ls, ExportNameRefusedError as lt, AutomationStateDocSchema as m, orderMigrations as ma, ReadinessRegistry as mc, heroLayoutCapability as mi, isSecretMarkerLike as ml, StorageMigrationJobSchema as mn, scopesAllowAddon as mo, coreBlockComposition as mr, HOUR_MS as ms, FanControlStatusSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, modeForSwitch as na, HISTORY_DEFAULT_MIN_INTERVAL_MS as nc, featureForwards as ni, historyUnitFor as nl, STORAGE_ACCESS_FALLBACK as nn, resolveMethodAuth as no, climateControlCapability as nr, vectorIndexDimConflictError as ns, DeviceRunSchema as nt, AGENT_MDNS_TXT_KEYS as o, nextTimeBoundaryInMs as oa, RECORD_BATCH_MAX as oc, formatDeviceRevoker as oi, isDeviceConfigCap as ol, SchedulerSchema as on, resolveRunnerId as oo, compareVersions as or, withLocationMode as os, EMPTY_AUTOMATION_STATE as ot, AlertSchema as p, occurrenceOn as pa, RUNTIME_DEFAULTS as pc, hasTimeLeaves as pi, isSecretMarker as pl, StorageLocationTypeSchema as pn, schedulersCapability as po, coreBlockAddonId as pr, HISTORY_SLOW_MS as ps, FIRST_LEVEL_MACRO_CLASSES as pt, DEVICE_SAN_USER_PREFIX as q, replacedFieldKeys as qa, defineEntryKind as qc, looseSchema as qi, featuresOfBoundCaps as ql, calendarsCapability as qn, timedRunSeconds as qo, evictionPolicyOfLocation as qr, BatchTooLargeError as qs, PreferenceValueSchema as qt, ACTUATOR_METHODS as r, modeMayWrite as ra, InvalidRecordError as rc, filesystemBrowseCapability as ri, hydrateSchema as rl, STORAGE_LOCATION_MODES as rn, resolveMutate as ro, collectDeviceTemplates as rr, vectorStoreCapability as rs, DeviceStatusSchema as rt, ALL_CAPABILITY_DEFINITIONS as s, normalizeActionUnits as sa, RECORD_BATCH_MAX_BYTES as sc, formatMinutes as si, isEvent as sl, ScopedTokenSchema as sn, resolveStepArgs as so, compileScalarOverride as sr, zoneOnlySite as ss, EMPTY_REMOTE_ASSUMED_STATE as st, ACTION_RUN_MAX_MS as t, migrationsCapability as ta, ForeignSecretMarkerError as tc, fanPresetsCapability as ti, historyItemFieldPath as tl, RunningStateStatusSchema as tn, resolveLocationMode as to, checkTemplatePayload as tr, vectorDimFromBase64 as ts, DeclaredDevices as tt, ActionStepSchema as u, normalizeUnit as ua, RECORD_SWEEP_INTERVAL_MS as uc, generateDeviceAlias as ui, isReadingQuantity as ul, SsoBridgeClaimsSchema as un, runSteps as uo, compositionSourceRefs as ur, DAY_MS as us, FAN_CAPTURE_FIELDS as ut, BaseDevice as v, petFountainCapability as va, RecordNotFoundError as vc, interpolate as vi, nodeIdOfScopedKey as vl, TemplateKindSchema as vn, seedInstanceOnce as vo, coverCapability as vr, canonicalStoredBlockTarget as vs, FieldClaimSchema as vt, COMPOSED_ITEM_FIXED_FIELDS as w, powerSourceCapability as wa, TransactRefusedError as wc, isBuiltinTemplateId as wi, parseSecretRef as wl, actionsCapability as wn, shortHostname as wo, declaredSeriesKind as wr, compositionFeatureEnabled as ws, HvacModeSchema as wt, CAMSTACK_APP_LINK_ORIGIN as x, planComposition as xa, RevConflictError as xc, isAlertEpisodeSeverity as xi, normalizeSecretOwner as xl, UserRecordSchema as xn, sharedActuatorFeatures as xo, dataStoreProviderCapability as xr, cloneStatefulExpressionMemory as xs, HISTORY_ITEM_CATALOG as xt, BatteryStatusSchema as y, petFountainWaterItem as ya, RecordTooLargeError as yc, isAddonInstanceId as yi, nodePin as yl, TokenScopeSchema as yn, settingsStoreCapability as yo, createDeviceExtensionProvider as yr, canonicalStoredDeviceType as ys, GroupCommandResultSchema as yt, DAY_NAMES as z, reducePoints as za, collectSecretMarkerRefs as zc, lifecycleJobSchema as zi, vocabActionIdFor as zl, brightnessCapability as zn, switchStateOfMode as zo, deviceStatusCapability as zr, openReset as zs, PET_FOUNTAIN_WATER_KEY as zt };
|