@camstack/types 1.2.306 → 1.2.308
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities/notification-rules.cap.d.ts +46 -0
- package/dist/capabilities/osd-manager.cap.d.ts +12 -0
- package/dist/client.js +24 -5
- package/dist/client.mjs +24 -5
- package/dist/device/hub-motion-read.d.ts +30 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +114 -10
- package/dist/index.mjs +111 -11
- package/dist/pipeline/removed-model-ids.d.ts +20 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19425,6 +19425,8 @@ var NcSystemEventKindSchema = zod.z.enum([
|
|
|
19425
19425
|
"stream-offline",
|
|
19426
19426
|
"node-online",
|
|
19427
19427
|
"node-offline",
|
|
19428
|
+
"node-restarting",
|
|
19429
|
+
"node-updating",
|
|
19428
19430
|
"node-inference-unavailable",
|
|
19429
19431
|
"detection-blind",
|
|
19430
19432
|
"addon-crash-loop",
|
|
@@ -20986,6 +20988,14 @@ var NC_CONDITION_CATALOG = [
|
|
|
20986
20988
|
value: "node-offline",
|
|
20987
20989
|
label: "Node offline"
|
|
20988
20990
|
},
|
|
20991
|
+
{
|
|
20992
|
+
value: "node-restarting",
|
|
20993
|
+
label: "Node restarting"
|
|
20994
|
+
},
|
|
20995
|
+
{
|
|
20996
|
+
value: "node-updating",
|
|
20997
|
+
label: "Node updating (restart imminent)"
|
|
20998
|
+
},
|
|
20989
20999
|
{
|
|
20990
21000
|
value: "node-inference-unavailable",
|
|
20991
21001
|
label: "Node has no usable inference device"
|
|
@@ -38326,7 +38336,8 @@ var MotionStatusSchema = zod.z.object({
|
|
|
38326
38336
|
* writes this slice (not even a boot seed), and neither does the runner's
|
|
38327
38337
|
* phase machine: its phase is "a session is attached" for every on-motion
|
|
38328
38338
|
* session, not motion, and it now has its own `DetectionPhaseTransition`.
|
|
38329
|
-
* A provider's `isDetected`
|
|
38339
|
+
* A provider's `isDetected` and `getStatus` answer from the hub's slice
|
|
38340
|
+
* (`hubMotionNativeProvider`).
|
|
38330
38341
|
* - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
|
|
38331
38342
|
* imports) — the provider pushes both edges itself, from the upstream
|
|
38332
38343
|
* system's own state change. That is the sensor's own fact.
|
|
@@ -67219,7 +67230,7 @@ function systemEventFilterApplies(kind, filter) {
|
|
|
67219
67230
|
case "deviceIds": return kind.startsWith("device-") || kind.startsWith("stream-") || kind === "detection-blind" || kind === "alarm-triggered";
|
|
67220
67231
|
case "deviceTypes": return kind.startsWith("device-") || kind === "detection-blind";
|
|
67221
67232
|
case "nodeIds": return kind.startsWith("node-") || kind === "addon-crash-loop" || kind === "addon-update-available" || kind === "addon-updated" || kind === "server-update-available" || kind === "wrapper-update-available" || kind === "server-updated";
|
|
67222
|
-
case "packageNames": return kind.endsWith("update-available") || kind === "addon-updated" || kind === "server-updated";
|
|
67233
|
+
case "packageNames": return kind.endsWith("update-available") || kind === "addon-updated" || kind === "node-updating" || kind === "server-updated";
|
|
67223
67234
|
case "consumableLowPercent": return NC_CONSUMABLE_SYSTEM_EVENT_KINDS.includes(kind);
|
|
67224
67235
|
}
|
|
67225
67236
|
}
|
|
@@ -67277,6 +67288,8 @@ var NC_SYSTEM_EVENT_FAMILY = {
|
|
|
67277
67288
|
"detection-blind": "device-events",
|
|
67278
67289
|
"node-online": "system",
|
|
67279
67290
|
"node-offline": "system",
|
|
67291
|
+
"node-restarting": "system",
|
|
67292
|
+
"node-updating": "system",
|
|
67280
67293
|
"node-inference-unavailable": "system",
|
|
67281
67294
|
"addon-crash-loop": "system",
|
|
67282
67295
|
"addon-update-available": "system",
|
|
@@ -67372,6 +67385,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
67372
67385
|
kinds: [
|
|
67373
67386
|
"node-offline",
|
|
67374
67387
|
"node-online",
|
|
67388
|
+
"node-restarting",
|
|
67375
67389
|
"node-inference-unavailable"
|
|
67376
67390
|
]
|
|
67377
67391
|
},
|
|
@@ -67393,6 +67407,7 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
67393
67407
|
label: "Server & container updates",
|
|
67394
67408
|
kinds: [
|
|
67395
67409
|
"server-update-available",
|
|
67410
|
+
"node-updating",
|
|
67396
67411
|
"server-updated",
|
|
67397
67412
|
"wrapper-update-available"
|
|
67398
67413
|
]
|
|
@@ -68892,6 +68907,7 @@ var STATE_SUMMARY_SECTION_VARS = [
|
|
|
68892
68907
|
kinds: [
|
|
68893
68908
|
"node-offline",
|
|
68894
68909
|
"node-online",
|
|
68910
|
+
"node-restarting",
|
|
68895
68911
|
"node-inference-unavailable"
|
|
68896
68912
|
]
|
|
68897
68913
|
},
|
|
@@ -68913,6 +68929,7 @@ var STATE_SUMMARY_SECTION_VARS = [
|
|
|
68913
68929
|
example: "server 1.2.377 → 1.2.378",
|
|
68914
68930
|
kinds: [
|
|
68915
68931
|
"server-update-available",
|
|
68932
|
+
"node-updating",
|
|
68916
68933
|
"server-updated",
|
|
68917
68934
|
"wrapper-update-available"
|
|
68918
68935
|
]
|
|
@@ -69318,6 +69335,8 @@ var NC_TEMPLATE_VARS = [
|
|
|
69318
69335
|
systemEventKinds: [
|
|
69319
69336
|
"node-online",
|
|
69320
69337
|
"node-offline",
|
|
69338
|
+
"node-restarting",
|
|
69339
|
+
"node-updating",
|
|
69321
69340
|
"node-inference-unavailable",
|
|
69322
69341
|
"addon-crash-loop",
|
|
69323
69342
|
...UPDATES,
|
|
@@ -69336,6 +69355,8 @@ var NC_TEMPLATE_VARS = [
|
|
|
69336
69355
|
systemEventKinds: [
|
|
69337
69356
|
"node-online",
|
|
69338
69357
|
"node-offline",
|
|
69358
|
+
"node-restarting",
|
|
69359
|
+
"node-updating",
|
|
69339
69360
|
"node-inference-unavailable",
|
|
69340
69361
|
"addon-crash-loop",
|
|
69341
69362
|
...UPDATES,
|
|
@@ -69389,6 +69410,7 @@ var NC_TEMPLATE_VARS = [
|
|
|
69389
69410
|
systemEventKinds: [
|
|
69390
69411
|
...UPDATES,
|
|
69391
69412
|
"addon-updated",
|
|
69413
|
+
"node-updating",
|
|
69392
69414
|
"server-updated"
|
|
69393
69415
|
]
|
|
69394
69416
|
},
|
|
@@ -69400,7 +69422,11 @@ var NC_TEMPLATE_VARS = [
|
|
|
69400
69422
|
families: ["rule"],
|
|
69401
69423
|
fields: [...RULE_TEXT],
|
|
69402
69424
|
kinds: ["system"],
|
|
69403
|
-
systemEventKinds: [
|
|
69425
|
+
systemEventKinds: [
|
|
69426
|
+
...PACKAGE_UPDATES,
|
|
69427
|
+
"node-updating",
|
|
69428
|
+
"server-updated"
|
|
69429
|
+
]
|
|
69404
69430
|
},
|
|
69405
69431
|
{
|
|
69406
69432
|
name: "nodes",
|
|
@@ -69452,7 +69478,7 @@ var NC_TEMPLATE_VARS = [
|
|
|
69452
69478
|
families: ["rule"],
|
|
69453
69479
|
fields: [...RULE_TEXT],
|
|
69454
69480
|
kinds: ["system"],
|
|
69455
|
-
systemEventKinds: ["server-updated"]
|
|
69481
|
+
systemEventKinds: ["node-updating", "server-updated"]
|
|
69456
69482
|
},
|
|
69457
69483
|
{
|
|
69458
69484
|
name: "toVersion",
|
|
@@ -69462,7 +69488,7 @@ var NC_TEMPLATE_VARS = [
|
|
|
69462
69488
|
families: ["rule"],
|
|
69463
69489
|
fields: [...RULE_TEXT],
|
|
69464
69490
|
kinds: ["system"],
|
|
69465
|
-
systemEventKinds: ["server-updated"]
|
|
69491
|
+
systemEventKinds: ["node-updating", "server-updated"]
|
|
69466
69492
|
},
|
|
69467
69493
|
{
|
|
69468
69494
|
name: "destinationsOk",
|
|
@@ -69731,7 +69757,9 @@ var NC_TEMPLATE_VARS = [
|
|
|
69731
69757
|
var NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS = [
|
|
69732
69758
|
"device-tank-low",
|
|
69733
69759
|
"device-tank-full",
|
|
69734
|
-
"device-tank-normal"
|
|
69760
|
+
"device-tank-normal",
|
|
69761
|
+
"node-restarting",
|
|
69762
|
+
"node-updating"
|
|
69735
69763
|
];
|
|
69736
69764
|
/**
|
|
69737
69765
|
* The catalog as `getTemplateCatalog` SERVES it: every descriptor, with the
|
|
@@ -70904,10 +70932,9 @@ function cameraOwnsMotionViaSensor(motionSources) {
|
|
|
70904
70932
|
}
|
|
70905
70933
|
//#endregion
|
|
70906
70934
|
//#region src/device/hub-motion-read.ts
|
|
70907
|
-
async function
|
|
70908
|
-
let slice;
|
|
70935
|
+
async function readSlice(deviceState, deviceId) {
|
|
70909
70936
|
try {
|
|
70910
|
-
|
|
70937
|
+
return await deviceState.getCapSlice.query({
|
|
70911
70938
|
deviceId,
|
|
70912
70939
|
capName: "motion"
|
|
70913
70940
|
});
|
|
@@ -70915,10 +70942,44 @@ async function readHubMotionDetected(deviceState, deviceId) {
|
|
|
70915
70942
|
const reason = err instanceof Error ? err.message : String(err);
|
|
70916
70943
|
throw new Error(`motion state of device ${deviceId} is unreadable: ${reason}`, { cause: err });
|
|
70917
70944
|
}
|
|
70918
|
-
|
|
70945
|
+
}
|
|
70946
|
+
/**
|
|
70947
|
+
* The hub's `motion` slice as a `MotionStatus`, or `null` when nobody has
|
|
70948
|
+
* published it since the hub started. Throws when the hub does not answer or
|
|
70949
|
+
* the slice is malformed — never a made-up "no motion".
|
|
70950
|
+
*/
|
|
70951
|
+
async function readHubMotionStatus(deviceState, deviceId) {
|
|
70952
|
+
const slice = await readSlice(deviceState, deviceId);
|
|
70953
|
+
if (slice === null) return null;
|
|
70954
|
+
const parsed = MotionStatusSchema.safeParse(slice);
|
|
70955
|
+
if (!parsed.success) throw new Error(`motion state of device ${deviceId} is malformed on the hub: ${parsed.error.message}`);
|
|
70956
|
+
return parsed.data;
|
|
70957
|
+
}
|
|
70958
|
+
async function readHubMotionDetected(deviceState, deviceId) {
|
|
70959
|
+
const detected = (await readSlice(deviceState, deviceId))?.["detected"];
|
|
70919
70960
|
if (typeof detected !== "boolean") throw new Error(`motion state of device ${deviceId} is not published yet (unknown)`);
|
|
70920
70961
|
return detected;
|
|
70921
70962
|
}
|
|
70963
|
+
/**
|
|
70964
|
+
* The native `motion` provider of a camera whose slice the orchestrator writes
|
|
70965
|
+
* (D696): `isDetected` AND `getStatus`, both from the hub. `owner` names the
|
|
70966
|
+
* provider class in the deviceId-mismatch error.
|
|
70967
|
+
*/
|
|
70968
|
+
function hubMotionNativeProvider(deviceState, deviceId, owner) {
|
|
70969
|
+
const ownDevice = (asked) => {
|
|
70970
|
+
if (asked !== deviceId) throw new Error(`${owner}: motion deviceId mismatch, expected ${deviceId}, got ${asked}`);
|
|
70971
|
+
};
|
|
70972
|
+
return {
|
|
70973
|
+
isDetected: async ({ deviceId: asked }) => {
|
|
70974
|
+
ownDevice(asked);
|
|
70975
|
+
return readHubMotionDetected(deviceState, deviceId);
|
|
70976
|
+
},
|
|
70977
|
+
getStatus: async ({ deviceId: asked }) => {
|
|
70978
|
+
ownDevice(asked);
|
|
70979
|
+
return readHubMotionStatus(deviceState, deviceId);
|
|
70980
|
+
}
|
|
70981
|
+
};
|
|
70982
|
+
}
|
|
70922
70983
|
//#endregion
|
|
70923
70984
|
//#region src/pipeline/provider-motion.ts
|
|
70924
70985
|
/** The motion event's data without `triggeredBy`: only the bridge names a trigger. */
|
|
@@ -70944,6 +71005,45 @@ function stepModelRunsOnFormat(models, modelId, format) {
|
|
|
70944
71005
|
return models.some((m) => m.legacy !== true && hasBuild(m, format));
|
|
70945
71006
|
}
|
|
70946
71007
|
//#endregion
|
|
71008
|
+
//#region src/pipeline/removed-model-ids.ts
|
|
71009
|
+
/**
|
|
71010
|
+
* Model ids DELETED from a step's catalog (D703, D710, D719), per step — and
|
|
71011
|
+
* the one question asked of them: is a stored pin to this id a pin to a model
|
|
71012
|
+
* that no longer exists? (D725)
|
|
71013
|
+
*
|
|
71014
|
+
* This is NOT a resolver input. `resolveModelForFormat` still returns an
|
|
71015
|
+
* unknown id unchanged (a custom model), and a bulk pass pinned to one still
|
|
71016
|
+
* refuses rather than substitutes (D54). The ONE reader is the orchestrator's
|
|
71017
|
+
* stored-pin reset (`removed-model-pin-reset.ts`), which clears such a pin from
|
|
71018
|
+
* the store so the step follows its default again — unless a registered custom
|
|
71019
|
+
* model carries the same id.
|
|
71020
|
+
*
|
|
71021
|
+
* `removed-model-ids.spec.ts` (addon-pipeline) pins that every id here is
|
|
71022
|
+
* really absent from its step's catalog. A model deleted from a catalog is
|
|
71023
|
+
* added here in the same change, or its stored pins stay behind as custom ids.
|
|
71024
|
+
*/
|
|
71025
|
+
/** `stepId → ids deleted from that step's catalog`. */
|
|
71026
|
+
var REMOVED_MODEL_IDS = {
|
|
71027
|
+
"object-detection": ["efficientdet-lite0-edgetpu", "ssdlite-mobiledet-coco-edgetpu"],
|
|
71028
|
+
"face-detection": [
|
|
71029
|
+
"scrypted-yolov9t-face",
|
|
71030
|
+
"scrfd-2.5g",
|
|
71031
|
+
"ssd-mobilenet-v2-face-edgetpu"
|
|
71032
|
+
],
|
|
71033
|
+
"face-embedding": ["arcface-r100", "inception-resnet-v1"],
|
|
71034
|
+
"plate-detection": ["yolov8n-plate"],
|
|
71035
|
+
"plate-ocr": ["vgg-english-g2"],
|
|
71036
|
+
"clip-embedding": ["mobileclip-s1", "mobileclip-s2"],
|
|
71037
|
+
"package-detection": ["yolov8n-package"],
|
|
71038
|
+
"bird-classifier": ["bird-classifier-aiy-edgetpu", "bird-nabirds-404"],
|
|
71039
|
+
"animal-classifier": ["animals-10"],
|
|
71040
|
+
"vehicle-classifier": ["vehicle-type-efficientnet"]
|
|
71041
|
+
};
|
|
71042
|
+
/** True when `modelId` was deleted from `stepId`'s catalog. */
|
|
71043
|
+
function isRemovedModelId(stepId, modelId) {
|
|
71044
|
+
return REMOVED_MODEL_IDS[stepId]?.includes(modelId) ?? false;
|
|
71045
|
+
}
|
|
71046
|
+
//#endregion
|
|
70947
71047
|
//#region src/pipeline/detail-crop.ts
|
|
70948
71048
|
/**
|
|
70949
71049
|
* THE detail-crop convention — the single derivation of the rectangle a
|
|
@@ -74174,6 +74274,7 @@ exports.RECORDING_SOURCE_CAMSTACK = RECORDING_SOURCE_CAMSTACK;
|
|
|
74174
74274
|
exports.RECORDING_SOURCE_CAMSTACK_ADDON = RECORDING_SOURCE_CAMSTACK_ADDON;
|
|
74175
74275
|
exports.RECORDING_TIMELINE_BATCH_MAX = RECORDING_TIMELINE_BATCH_MAX;
|
|
74176
74276
|
exports.REDACTED_SECRET = REDACTED_SECRET;
|
|
74277
|
+
exports.REMOVED_MODEL_IDS = REMOVED_MODEL_IDS;
|
|
74177
74278
|
exports.RESERVED_BINDING_NAMES = require_composition.RESERVED_BINDING_NAMES;
|
|
74178
74279
|
exports.RESERVED_COLLECTION_SOURCES = RESERVED_COLLECTION_SOURCES;
|
|
74179
74280
|
exports.RESTORED_CAP_NAMES = RESTORED_CAP_NAMES;
|
|
@@ -74833,6 +74934,7 @@ exports.gifFromMp4Args = gifFromMp4Args;
|
|
|
74833
74934
|
exports.hasMotionTrigger = hasMotionTrigger;
|
|
74834
74935
|
exports.hfModelUrl = hfModelUrl;
|
|
74835
74936
|
exports.htmlToText = htmlToText;
|
|
74937
|
+
exports.hubMotionNativeProvider = hubMotionNativeProvider;
|
|
74836
74938
|
exports.humidifierCapability = humidifierCapability;
|
|
74837
74939
|
exports.humiditySensorCapability = humiditySensorCapability;
|
|
74838
74940
|
exports.hydrateSchema = require_sleep.hydrateSchema;
|
|
@@ -74883,6 +74985,7 @@ exports.isNode = isNode;
|
|
|
74883
74985
|
exports.isObjectInput = isObjectInput;
|
|
74884
74986
|
exports.isOccupancyRule = isOccupancyRule;
|
|
74885
74987
|
exports.isOwnerOnlyEventCategory = require_event_category.isOwnerOnlyEventCategory;
|
|
74988
|
+
exports.isRemovedModelId = isRemovedModelId;
|
|
74886
74989
|
exports.isRestoredCap = isRestoredCap;
|
|
74887
74990
|
exports.isRetiredClearKey = isRetiredClearKey;
|
|
74888
74991
|
exports.isSameAddonId = isSameAddonId;
|
|
@@ -75039,6 +75142,7 @@ exports.readClusterStepSettings = readClusterStepSettings;
|
|
|
75039
75142
|
exports.readDetailCropConvention = readDetailCropConvention;
|
|
75040
75143
|
exports.readDeviceStateFrom = readDeviceStateFrom;
|
|
75041
75144
|
exports.readHubMotionDetected = readHubMotionDetected;
|
|
75145
|
+
exports.readHubMotionStatus = readHubMotionStatus;
|
|
75042
75146
|
exports.readLabelLinkPolicy = readLabelLinkPolicy;
|
|
75043
75147
|
exports.readMotionTriggeredBy = readMotionTriggeredBy;
|
|
75044
75148
|
exports.readNativeLeaseOverride = readNativeLeaseOverride;
|