@camstack/system 1.1.54 → 1.1.56
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/addon-runner.js +2 -2
- package/dist/addon-runner.mjs +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/doorbell/trigger-engine.d.ts +18 -0
- package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +8 -14
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +37 -30
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +37 -30
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-B5C4dVvO.js → dist-Bg795EQF.js} +553 -6
- package/dist/{dist-DssImRC5.mjs → dist-JAF9YR1q.mjs} +553 -6
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{manifest-python-deps-CWom-eqp.mjs → manifest-python-deps-9wuRyL-k.mjs} +1 -1
- package/dist/{manifest-python-deps-kkvku9yU.js → manifest-python-deps-eI3-3FeW.js} +1 -1
- package/package.json +1 -1
|
@@ -3343,6 +3343,62 @@ var RecordingConfigSchema = zod.z.object({
|
|
|
3343
3343
|
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
3344
3344
|
});
|
|
3345
3345
|
/**
|
|
3346
|
+
* Ops-log — the durable, append-only operations audit shared by the
|
|
3347
|
+
* recordings and events management surfaces.
|
|
3348
|
+
*
|
|
3349
|
+
* ONE row shape is reused for both domains so a single "Activity" view can
|
|
3350
|
+
* merge the recorder's DurableState ring (recordings ops-log) and the
|
|
3351
|
+
* pipeline-analytics SQLite collection (events ops-log). Each row records a
|
|
3352
|
+
* management operation, WHY it ran (reason), and its measurable effect
|
|
3353
|
+
* (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
|
|
3354
|
+
* never fail the operation it records.
|
|
3355
|
+
*/
|
|
3356
|
+
/** Which management domain the operation belongs to. */
|
|
3357
|
+
var OpsLogDomainSchema = zod.z.enum(["recording", "events"]);
|
|
3358
|
+
/** The kind of management operation performed. */
|
|
3359
|
+
var OpsLogOpSchema = zod.z.enum([
|
|
3360
|
+
"prune",
|
|
3361
|
+
"manual-delete",
|
|
3362
|
+
"rescan",
|
|
3363
|
+
"retention-run"
|
|
3364
|
+
]);
|
|
3365
|
+
/** Why the operation ran. */
|
|
3366
|
+
var OpsLogReasonSchema = zod.z.enum([
|
|
3367
|
+
"retention",
|
|
3368
|
+
"quota",
|
|
3369
|
+
"manual",
|
|
3370
|
+
"operator"
|
|
3371
|
+
]);
|
|
3372
|
+
/** One audit row, shared verbatim by both domains. */
|
|
3373
|
+
var OpsLogEntrySchema = zod.z.object({
|
|
3374
|
+
/** Unique row id. */
|
|
3375
|
+
id: zod.z.string(),
|
|
3376
|
+
/** Epoch ms the operation completed. */
|
|
3377
|
+
at: zod.z.number(),
|
|
3378
|
+
domain: OpsLogDomainSchema,
|
|
3379
|
+
op: OpsLogOpSchema,
|
|
3380
|
+
reason: OpsLogReasonSchema,
|
|
3381
|
+
/** The camera the op targeted; null for a cluster/global op. */
|
|
3382
|
+
deviceId: zod.z.number().nullable(),
|
|
3383
|
+
/** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
|
|
3384
|
+
nodeId: zod.z.string(),
|
|
3385
|
+
/** Buckets / rows deleted (op-specific unit). */
|
|
3386
|
+
itemsAffected: zod.z.number(),
|
|
3387
|
+
/** Bytes reclaimed by the op (0 when not measurable). */
|
|
3388
|
+
bytesReclaimed: zod.z.number(),
|
|
3389
|
+
/** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
|
|
3390
|
+
detail: zod.z.string().nullable(),
|
|
3391
|
+
/** Who/what triggered the op. */
|
|
3392
|
+
actor: zod.z.string()
|
|
3393
|
+
});
|
|
3394
|
+
/** Shared query input for the per-domain `listOpsLog` cap methods. */
|
|
3395
|
+
var OpsLogQueryInputSchema = zod.z.object({
|
|
3396
|
+
/** Restrict to a single camera; omit for every row. */
|
|
3397
|
+
deviceId: zod.z.number().optional(),
|
|
3398
|
+
/** Max rows returned, newest-first. */
|
|
3399
|
+
limit: zod.z.number().int().min(1).max(1e3).optional()
|
|
3400
|
+
});
|
|
3401
|
+
/**
|
|
3346
3402
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
3347
3403
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
3348
3404
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -3686,6 +3742,160 @@ function readNodePin(context) {
|
|
|
3686
3742
|
const value = Reflect.get(context, CAP_NODE_PIN_CONTEXT_KEY);
|
|
3687
3743
|
return typeof value === "string" ? value : void 0;
|
|
3688
3744
|
}
|
|
3745
|
+
var COCO_TO_MACRO = {
|
|
3746
|
+
mapping: {
|
|
3747
|
+
person: "person",
|
|
3748
|
+
bicycle: "vehicle",
|
|
3749
|
+
car: "vehicle",
|
|
3750
|
+
motorcycle: "vehicle",
|
|
3751
|
+
airplane: "vehicle",
|
|
3752
|
+
bus: "vehicle",
|
|
3753
|
+
train: "vehicle",
|
|
3754
|
+
truck: "vehicle",
|
|
3755
|
+
boat: "vehicle",
|
|
3756
|
+
bird: "animal",
|
|
3757
|
+
cat: "animal",
|
|
3758
|
+
dog: "animal",
|
|
3759
|
+
horse: "animal",
|
|
3760
|
+
sheep: "animal",
|
|
3761
|
+
cow: "animal",
|
|
3762
|
+
elephant: "animal",
|
|
3763
|
+
bear: "animal",
|
|
3764
|
+
zebra: "animal",
|
|
3765
|
+
giraffe: "animal",
|
|
3766
|
+
suitcase: "package",
|
|
3767
|
+
backpack: "package",
|
|
3768
|
+
handbag: "package"
|
|
3769
|
+
},
|
|
3770
|
+
preserveOriginal: false
|
|
3771
|
+
};
|
|
3772
|
+
var AUDIO_MACRO_LABELS = [
|
|
3773
|
+
{
|
|
3774
|
+
id: "speech",
|
|
3775
|
+
name: "Speech",
|
|
3776
|
+
icon: "🗣️"
|
|
3777
|
+
},
|
|
3778
|
+
{
|
|
3779
|
+
id: "scream",
|
|
3780
|
+
name: "Scream / Shout",
|
|
3781
|
+
icon: "😱"
|
|
3782
|
+
},
|
|
3783
|
+
{
|
|
3784
|
+
id: "crying",
|
|
3785
|
+
name: "Crying / Baby",
|
|
3786
|
+
icon: "😢"
|
|
3787
|
+
},
|
|
3788
|
+
{
|
|
3789
|
+
id: "laughter",
|
|
3790
|
+
name: "Laughter",
|
|
3791
|
+
icon: "😂"
|
|
3792
|
+
},
|
|
3793
|
+
{
|
|
3794
|
+
id: "music",
|
|
3795
|
+
name: "Music",
|
|
3796
|
+
icon: "🎵"
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
id: "dog",
|
|
3800
|
+
name: "Dog",
|
|
3801
|
+
icon: "🐕"
|
|
3802
|
+
},
|
|
3803
|
+
{
|
|
3804
|
+
id: "cat",
|
|
3805
|
+
name: "Cat",
|
|
3806
|
+
icon: "🐈"
|
|
3807
|
+
},
|
|
3808
|
+
{
|
|
3809
|
+
id: "bird",
|
|
3810
|
+
name: "Bird",
|
|
3811
|
+
icon: "🐦"
|
|
3812
|
+
},
|
|
3813
|
+
{
|
|
3814
|
+
id: "animal",
|
|
3815
|
+
name: "Animal (other)",
|
|
3816
|
+
icon: "🐾"
|
|
3817
|
+
},
|
|
3818
|
+
{
|
|
3819
|
+
id: "alarm",
|
|
3820
|
+
name: "Alarm / Siren",
|
|
3821
|
+
icon: "🚨"
|
|
3822
|
+
},
|
|
3823
|
+
{
|
|
3824
|
+
id: "doorbell",
|
|
3825
|
+
name: "Doorbell / Knock",
|
|
3826
|
+
icon: "🔔"
|
|
3827
|
+
},
|
|
3828
|
+
{
|
|
3829
|
+
id: "glass_breaking",
|
|
3830
|
+
name: "Glass Breaking",
|
|
3831
|
+
icon: "💥"
|
|
3832
|
+
},
|
|
3833
|
+
{
|
|
3834
|
+
id: "gunshot",
|
|
3835
|
+
name: "Gunshot / Explosion",
|
|
3836
|
+
icon: "💣"
|
|
3837
|
+
},
|
|
3838
|
+
{
|
|
3839
|
+
id: "vehicle",
|
|
3840
|
+
name: "Vehicle",
|
|
3841
|
+
icon: "🚗"
|
|
3842
|
+
},
|
|
3843
|
+
{
|
|
3844
|
+
id: "siren",
|
|
3845
|
+
name: "Emergency Siren",
|
|
3846
|
+
icon: "🚑"
|
|
3847
|
+
},
|
|
3848
|
+
{
|
|
3849
|
+
id: "fire",
|
|
3850
|
+
name: "Fire / Smoke",
|
|
3851
|
+
icon: "🔥"
|
|
3852
|
+
},
|
|
3853
|
+
{
|
|
3854
|
+
id: "water",
|
|
3855
|
+
name: "Water",
|
|
3856
|
+
icon: "💧"
|
|
3857
|
+
},
|
|
3858
|
+
{
|
|
3859
|
+
id: "wind",
|
|
3860
|
+
name: "Wind / Weather",
|
|
3861
|
+
icon: "🌬️"
|
|
3862
|
+
},
|
|
3863
|
+
{
|
|
3864
|
+
id: "door",
|
|
3865
|
+
name: "Door",
|
|
3866
|
+
icon: "🚪"
|
|
3867
|
+
},
|
|
3868
|
+
{
|
|
3869
|
+
id: "footsteps",
|
|
3870
|
+
name: "Footsteps",
|
|
3871
|
+
icon: "👣"
|
|
3872
|
+
},
|
|
3873
|
+
{
|
|
3874
|
+
id: "crowd",
|
|
3875
|
+
name: "Crowd / Chatter",
|
|
3876
|
+
icon: "👥"
|
|
3877
|
+
},
|
|
3878
|
+
{
|
|
3879
|
+
id: "telephone",
|
|
3880
|
+
name: "Telephone",
|
|
3881
|
+
icon: "📞"
|
|
3882
|
+
},
|
|
3883
|
+
{
|
|
3884
|
+
id: "engine",
|
|
3885
|
+
name: "Engine / Motor",
|
|
3886
|
+
icon: "⚙️"
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
id: "tools",
|
|
3890
|
+
name: "Tools / Construction",
|
|
3891
|
+
icon: "🔨"
|
|
3892
|
+
},
|
|
3893
|
+
{
|
|
3894
|
+
id: "silence",
|
|
3895
|
+
name: "Silence",
|
|
3896
|
+
icon: "🤫"
|
|
3897
|
+
}
|
|
3898
|
+
];
|
|
3689
3899
|
var YAMNET_TO_MACRO = {
|
|
3690
3900
|
mapping: {
|
|
3691
3901
|
Speech: "speech",
|
|
@@ -3952,6 +4162,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
|
|
|
3952
4162
|
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
3953
4163
|
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
3954
4164
|
/**
|
|
4165
|
+
* Unified event-kind taxonomy — THE single source of truth for
|
|
4166
|
+
* `kind → { parentKind, category, level, color, iconId, labelKey, label,
|
|
4167
|
+
* icon }`.
|
|
4168
|
+
*
|
|
4169
|
+
* This dictionary folds together what used to be scattered across four
|
|
4170
|
+
* copies:
|
|
4171
|
+
* - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
|
|
4172
|
+
* - `addon-post-analysis/.../services/event-kinds.ts`
|
|
4173
|
+
* (MOTION/PERSON/VEHICLE… _COLOR constants)
|
|
4174
|
+
* - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
|
|
4175
|
+
* - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
|
|
4176
|
+
* - the COCO / audio class maps (macro ↔ sub relationships)
|
|
4177
|
+
*
|
|
4178
|
+
* The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
|
|
4179
|
+
* `@camstack/types`. The UI-side mapping `iconId → lucide component` and
|
|
4180
|
+
* `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
|
|
4181
|
+
* color or an icon: they read this dictionary (server descriptors carry the
|
|
4182
|
+
* fields inline; the client resolves color/icon/label from `iconId`/`kind`).
|
|
4183
|
+
*
|
|
4184
|
+
* Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
|
|
4185
|
+
*/
|
|
4186
|
+
var TAXONOMY_COLORS = {
|
|
4187
|
+
motion: "#f59e0b",
|
|
4188
|
+
audio: "#06b6d4",
|
|
4189
|
+
person: "#22c55e",
|
|
4190
|
+
vehicle: "#3b82f6",
|
|
4191
|
+
animal: "#f97316",
|
|
4192
|
+
package: "#a855f7",
|
|
4193
|
+
sensor: "#8b5cf6",
|
|
4194
|
+
control: "#10b981",
|
|
4195
|
+
genericDetection: "#64748b"
|
|
4196
|
+
};
|
|
4197
|
+
var DETECTION_SUB_COLORS = {
|
|
4198
|
+
car: "#f59e0b",
|
|
4199
|
+
truck: "#d97706",
|
|
4200
|
+
bus: "#b45309",
|
|
4201
|
+
motorcycle: "#eab308",
|
|
4202
|
+
bicycle: "#ca8a04",
|
|
4203
|
+
airplane: "#60a5fa",
|
|
4204
|
+
boat: "#2563eb",
|
|
4205
|
+
train: "#1d4ed8",
|
|
4206
|
+
bird: "#14b8a6",
|
|
4207
|
+
dog: "#84cc16",
|
|
4208
|
+
cat: "#f97316",
|
|
4209
|
+
horse: "#a16207",
|
|
4210
|
+
sheep: "#a3a3a3",
|
|
4211
|
+
cow: "#78716c",
|
|
4212
|
+
elephant: "#6b7280",
|
|
4213
|
+
bear: "#7c2d12",
|
|
4214
|
+
zebra: "#404040",
|
|
4215
|
+
giraffe: "#d4a373"
|
|
4216
|
+
};
|
|
4217
|
+
function titleCase(id) {
|
|
4218
|
+
return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
4219
|
+
}
|
|
4220
|
+
var entries = /* @__PURE__ */ new Map();
|
|
4221
|
+
function macro(kind, category, color, iconId, label) {
|
|
4222
|
+
entries.set(kind, {
|
|
4223
|
+
kind,
|
|
4224
|
+
parentKind: null,
|
|
4225
|
+
level: "macro",
|
|
4226
|
+
category,
|
|
4227
|
+
color,
|
|
4228
|
+
iconId,
|
|
4229
|
+
labelKey: `eventKind.${kind}`,
|
|
4230
|
+
label
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
function sub(kind, parentKind, category, color, iconId, label) {
|
|
4234
|
+
entries.set(kind, {
|
|
4235
|
+
kind,
|
|
4236
|
+
parentKind,
|
|
4237
|
+
level: "sub",
|
|
4238
|
+
category,
|
|
4239
|
+
color,
|
|
4240
|
+
iconId,
|
|
4241
|
+
labelKey: `eventKind.${kind}`,
|
|
4242
|
+
label
|
|
4243
|
+
});
|
|
4244
|
+
}
|
|
4245
|
+
macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
|
|
4246
|
+
macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
|
|
4247
|
+
macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
|
|
4248
|
+
macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
|
|
4249
|
+
macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
|
|
4250
|
+
macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
|
|
4251
|
+
macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
|
|
4252
|
+
macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
|
|
4253
|
+
for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
|
|
4254
|
+
if (macroClass !== "vehicle" && macroClass !== "animal") continue;
|
|
4255
|
+
if (entries.has(cocoClass)) continue;
|
|
4256
|
+
sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
|
|
4257
|
+
}
|
|
4258
|
+
sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
|
|
4259
|
+
sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
|
|
4260
|
+
sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
|
|
4261
|
+
sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
|
|
4262
|
+
sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
|
|
4263
|
+
sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
|
|
4264
|
+
sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
|
|
4265
|
+
sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
|
|
4266
|
+
sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
|
|
4267
|
+
sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
|
|
4268
|
+
sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
|
|
4269
|
+
sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
|
|
4270
|
+
sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
|
|
4271
|
+
sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
|
|
4272
|
+
sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
|
|
4273
|
+
sub("siren", "control", "control", "#dc2626", "siren", "Siren");
|
|
4274
|
+
sub("button", "control", "control", "#10b981", "button", "Button");
|
|
4275
|
+
sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
|
|
4276
|
+
for (const l of AUDIO_MACRO_LABELS) {
|
|
4277
|
+
const kind = `audio-${l.id}`;
|
|
4278
|
+
if (entries.has(kind)) continue;
|
|
4279
|
+
sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
|
|
4280
|
+
}
|
|
4281
|
+
/** The complete taxonomy dictionary, keyed by kind. */
|
|
4282
|
+
var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
|
|
4283
|
+
/**
|
|
3955
4284
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
3956
4285
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
3957
4286
|
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
@@ -11238,9 +11567,10 @@ var zoneRulesCapability = {
|
|
|
11238
11567
|
* `package` backs the package-drop detector — a package zone is a
|
|
11239
11568
|
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
11240
11569
|
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
11241
|
-
* The orchestrator provider
|
|
11242
|
-
*
|
|
11243
|
-
* consumers read
|
|
11570
|
+
* The orchestrator provider writes this stage as a first-class slice
|
|
11571
|
+
* (Phase 4): every mutation mirrors the full `{motion, detection,
|
|
11572
|
+
* package}` shape, so consumers read the current package rules directly
|
|
11573
|
+
* off `device.state.zoneRules.value.package`.
|
|
11244
11574
|
*/
|
|
11245
11575
|
runtimeState: zod.z.object({
|
|
11246
11576
|
motion: zod.z.array(ZoneRuleSchema).readonly(),
|
|
@@ -15819,17 +16149,30 @@ var EventKindCategorySchema = zod.z.enum([
|
|
|
15819
16149
|
"audio",
|
|
15820
16150
|
"detection",
|
|
15821
16151
|
"sensor",
|
|
16152
|
+
"control",
|
|
15822
16153
|
"custom",
|
|
15823
16154
|
"package"
|
|
15824
16155
|
]);
|
|
16156
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
16157
|
+
var EventKindLevelSchema = zod.z.enum(["macro", "sub"]);
|
|
15825
16158
|
var EventKindDescriptorSchema = zod.z.object({
|
|
15826
|
-
/** Stable kind id (e.g. 'motion', '
|
|
16159
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
15827
16160
|
kind: zod.z.string(),
|
|
16161
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16162
|
+
labelKey: zod.z.string(),
|
|
16163
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
15828
16164
|
label: zod.z.string(),
|
|
15829
16165
|
/** Hex color for timeline/legend rendering. */
|
|
15830
16166
|
color: zod.z.string(),
|
|
16167
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
16168
|
+
iconId: zod.z.string(),
|
|
16169
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
15831
16170
|
icon: EventKindIconSchema,
|
|
15832
16171
|
category: EventKindCategorySchema,
|
|
16172
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16173
|
+
parentKind: zod.z.string().nullable(),
|
|
16174
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16175
|
+
level: EventKindLevelSchema,
|
|
15833
16176
|
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15834
16177
|
* itself; for sensor kinds the LINKED source device. */
|
|
15835
16178
|
source: zod.z.object({
|
|
@@ -15902,11 +16245,21 @@ var TrackAudioLabelSchema = zod.z.object({
|
|
|
15902
16245
|
firstAt: zod.z.number(),
|
|
15903
16246
|
lastAt: zod.z.number()
|
|
15904
16247
|
});
|
|
16248
|
+
/**
|
|
16249
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
16250
|
+
* detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
|
|
16251
|
+
* linked sensor/control state change (no positions; carries a snapshot). The
|
|
16252
|
+
* spatial subsystems (tracker association, occupancy count, re-id/embedding,
|
|
16253
|
+
* resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
|
|
16254
|
+
*/
|
|
16255
|
+
var TrackSourceSchema = zod.z.enum(["pipeline", "sensor"]);
|
|
15905
16256
|
var TrackSchema = zod.z.object({
|
|
15906
16257
|
trackId: zod.z.string(),
|
|
15907
16258
|
deviceId: zod.z.number(),
|
|
15908
16259
|
className: zod.z.string(),
|
|
15909
16260
|
label: zod.z.string().optional(),
|
|
16261
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
16262
|
+
source: TrackSourceSchema.optional(),
|
|
15910
16263
|
firstSeen: zod.z.number(),
|
|
15911
16264
|
lastSeen: zod.z.number(),
|
|
15912
16265
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
@@ -16161,6 +16514,26 @@ var TrackCascadeCountsSchema = zod.z.object({
|
|
|
16161
16514
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
16162
16515
|
embeddings: zod.z.number().int()
|
|
16163
16516
|
});
|
|
16517
|
+
/** Event-store footprint for one camera. */
|
|
16518
|
+
var EventStoreDeviceFootprintSchema = zod.z.object({
|
|
16519
|
+
deviceId: zod.z.number(),
|
|
16520
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
16521
|
+
rows: zod.z.number().int(),
|
|
16522
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
16523
|
+
bytes: zod.z.number().int()
|
|
16524
|
+
});
|
|
16525
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
16526
|
+
var EventStoreFootprintSchema = zod.z.object({
|
|
16527
|
+
totalRows: zod.z.number().int(),
|
|
16528
|
+
totalBytes: zod.z.number().int(),
|
|
16529
|
+
devices: zod.z.array(EventStoreDeviceFootprintSchema).readonly()
|
|
16530
|
+
});
|
|
16531
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
16532
|
+
var EventPruneCountsSchema = zod.z.object({
|
|
16533
|
+
motion: zod.z.number().int(),
|
|
16534
|
+
object: zod.z.number().int(),
|
|
16535
|
+
audio: zod.z.number().int()
|
|
16536
|
+
});
|
|
16164
16537
|
var pipelineAnalyticsCapability = {
|
|
16165
16538
|
name: "pipeline-analytics",
|
|
16166
16539
|
scope: "device",
|
|
@@ -16322,6 +16695,45 @@ var pipelineAnalyticsCapability = {
|
|
|
16322
16695
|
kind: "mutation",
|
|
16323
16696
|
auth: "admin"
|
|
16324
16697
|
}),
|
|
16698
|
+
/**
|
|
16699
|
+
* Durable event-store footprint for the management UI: event rows
|
|
16700
|
+
* (motion + object + audio) counted per camera + total, plus the
|
|
16701
|
+
* event-owned media bytes on disk per camera + total. Stat/count-based,
|
|
16702
|
+
* computed on demand.
|
|
16703
|
+
*/
|
|
16704
|
+
getEventStoreFootprint: method(zod.z.object({}), EventStoreFootprintSchema, {
|
|
16705
|
+
kind: "query",
|
|
16706
|
+
auth: "admin"
|
|
16707
|
+
}),
|
|
16708
|
+
/**
|
|
16709
|
+
* Cluster-wide prune of events older than `olderThanMs` (exclusive) across
|
|
16710
|
+
* every camera, deleting each event's media in lockstep. Logged to the
|
|
16711
|
+
* events ops-log with `reason` (default `'retention'`). Returns the summed
|
|
16712
|
+
* per-kind deleted counts.
|
|
16713
|
+
*/
|
|
16714
|
+
pruneEvents: method(zod.z.object({
|
|
16715
|
+
olderThanMs: zod.z.number(),
|
|
16716
|
+
reason: OpsLogReasonSchema.optional()
|
|
16717
|
+
}), EventPruneCountsSchema, {
|
|
16718
|
+
kind: "mutation",
|
|
16719
|
+
auth: "admin"
|
|
16720
|
+
}),
|
|
16721
|
+
/**
|
|
16722
|
+
* Manually delete EVERY event (motion + object + audio) for one camera and
|
|
16723
|
+
* its event-owned media in lockstep. Logged to the events ops-log as
|
|
16724
|
+
* `op:'manual-delete', reason:'manual'`. Destructive — the admin UI guards
|
|
16725
|
+
* it behind a confirm.
|
|
16726
|
+
*/
|
|
16727
|
+
deleteDeviceEvents: method(zod.z.object({ deviceId: zod.z.number() }), EventPruneCountsSchema, {
|
|
16728
|
+
kind: "mutation",
|
|
16729
|
+
auth: "admin"
|
|
16730
|
+
}),
|
|
16731
|
+
/** The events ops-log rows (newest-first), optionally scoped to one camera.
|
|
16732
|
+
* Backed by a declared pipeline-analytics SQLite collection. */
|
|
16733
|
+
listOpsLog: method(OpsLogQueryInputSchema, zod.z.array(OpsLogEntrySchema).readonly(), {
|
|
16734
|
+
kind: "query",
|
|
16735
|
+
auth: "admin"
|
|
16736
|
+
}),
|
|
16325
16737
|
getEventMedia: method(zod.z.object({
|
|
16326
16738
|
eventId: zod.z.string(),
|
|
16327
16739
|
kind: MediaFileKindEnum.optional()
|
|
@@ -16375,6 +16787,76 @@ var pipelineAnalyticsCapability = {
|
|
|
16375
16787
|
}) }
|
|
16376
16788
|
}
|
|
16377
16789
|
};
|
|
16790
|
+
/**
|
|
16791
|
+
* Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
|
|
16792
|
+
* `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
|
|
16793
|
+
* caps into per-camera event-kind descriptors.
|
|
16794
|
+
*
|
|
16795
|
+
* The descriptor DATA (color / iconId / labelKey / parentKind / category)
|
|
16796
|
+
* is NOT duplicated here — every entry is derived from the single
|
|
16797
|
+
* `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
|
|
16798
|
+
* ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
|
|
16799
|
+
* control cap means adding one line here (and a taxonomy entry); the anti-
|
|
16800
|
+
* drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
|
|
16801
|
+
* eventful cap is missing.
|
|
16802
|
+
*/
|
|
16803
|
+
/** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
|
|
16804
|
+
var LEGACY_ICON = {
|
|
16805
|
+
motion: "motion",
|
|
16806
|
+
audio: "audio",
|
|
16807
|
+
person: "person",
|
|
16808
|
+
vehicle: "vehicle",
|
|
16809
|
+
animal: "animal",
|
|
16810
|
+
package: "package",
|
|
16811
|
+
door: "door",
|
|
16812
|
+
pir: "pir",
|
|
16813
|
+
smoke: "smoke",
|
|
16814
|
+
water: "water",
|
|
16815
|
+
button: "button",
|
|
16816
|
+
generic: "generic",
|
|
16817
|
+
gas: "smoke",
|
|
16818
|
+
vibration: "generic",
|
|
16819
|
+
tamper: "generic",
|
|
16820
|
+
presence: "person",
|
|
16821
|
+
lock: "generic",
|
|
16822
|
+
siren: "generic",
|
|
16823
|
+
switch: "generic",
|
|
16824
|
+
doorbell: "button"
|
|
16825
|
+
};
|
|
16826
|
+
function legacyIcon(iconId) {
|
|
16827
|
+
return LEGACY_ICON[iconId] ?? "generic";
|
|
16828
|
+
}
|
|
16829
|
+
/**
|
|
16830
|
+
* Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
|
|
16831
|
+
* The anti-drift guard cross-checks this against the eventful caps declared
|
|
16832
|
+
* in `packages/types/src/capabilities/*.cap.ts`.
|
|
16833
|
+
*/
|
|
16834
|
+
var CAP_TO_KIND = {
|
|
16835
|
+
contact: "contact",
|
|
16836
|
+
motion: "motion-sensor",
|
|
16837
|
+
smoke: "smoke",
|
|
16838
|
+
flood: "flood",
|
|
16839
|
+
gas: "gas",
|
|
16840
|
+
"carbon-monoxide": "carbon-monoxide",
|
|
16841
|
+
vibration: "vibration",
|
|
16842
|
+
tamper: "tamper",
|
|
16843
|
+
presence: "presence",
|
|
16844
|
+
"enum-sensor": "enum-sensor",
|
|
16845
|
+
"event-emitter": "device-event",
|
|
16846
|
+
"lock-control": "lock",
|
|
16847
|
+
switch: "switch",
|
|
16848
|
+
button: "button",
|
|
16849
|
+
doorbell: "doorbell"
|
|
16850
|
+
};
|
|
16851
|
+
function buildDescriptor(capName, kind) {
|
|
16852
|
+
const t = EVENT_TAXONOMY[kind];
|
|
16853
|
+
if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
|
|
16854
|
+
return {
|
|
16855
|
+
...t,
|
|
16856
|
+
icon: legacyIcon(t.iconId)
|
|
16857
|
+
};
|
|
16858
|
+
}
|
|
16859
|
+
Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
16378
16860
|
var CameraPipelineConfigSchema = zod.z.object({
|
|
16379
16861
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
16380
16862
|
steps: zod.z.array(PipelineStepInputSchema).readonly(),
|
|
@@ -20945,14 +21427,43 @@ var recordingCapability = {
|
|
|
20945
21427
|
auth: "admin"
|
|
20946
21428
|
}),
|
|
20947
21429
|
/** Apply this device's retention policy to footage now; returns the oldest
|
|
20948
|
-
* surviving footage start (the retention floor) or null if no footage.
|
|
20949
|
-
|
|
21430
|
+
* surviving footage start (the retention floor) or null if no footage. The
|
|
21431
|
+
* prune is logged to the recordings ops-log with `reason` (default
|
|
21432
|
+
* `'retention'` — the policy-driven prune; `'quota'` when disk-pressure
|
|
21433
|
+
* triggered). */
|
|
21434
|
+
pruneFootage: method(zod.z.object({
|
|
21435
|
+
deviceId: zod.z.number(),
|
|
21436
|
+
reason: OpsLogReasonSchema.optional()
|
|
21437
|
+
}), zod.z.object({
|
|
20950
21438
|
floorMs: zod.z.number().nullable(),
|
|
20951
21439
|
deletedBuckets: zod.z.number().int(),
|
|
20952
21440
|
reclaimedBytes: zod.z.number().int()
|
|
20953
21441
|
}), {
|
|
20954
21442
|
kind: "mutation",
|
|
20955
21443
|
auth: "admin"
|
|
21444
|
+
}),
|
|
21445
|
+
/**
|
|
21446
|
+
* Manually delete a camera's footage — the whole footprint, or a
|
|
21447
|
+
* `[fromMs, toMs)` window when either bound is given. Logged to the
|
|
21448
|
+
* recordings ops-log as `op:'manual-delete', reason:'manual'`. Destructive:
|
|
21449
|
+
* the admin UI guards it behind a confirm.
|
|
21450
|
+
*/
|
|
21451
|
+
deleteFootprint: method(zod.z.object({
|
|
21452
|
+
deviceId: zod.z.number(),
|
|
21453
|
+
fromMs: zod.z.number().optional(),
|
|
21454
|
+
toMs: zod.z.number().optional()
|
|
21455
|
+
}), zod.z.object({
|
|
21456
|
+
deletedBuckets: zod.z.number().int(),
|
|
21457
|
+
reclaimedBytes: zod.z.number().int()
|
|
21458
|
+
}), {
|
|
21459
|
+
kind: "mutation",
|
|
21460
|
+
auth: "admin"
|
|
21461
|
+
}),
|
|
21462
|
+
/** The recordings ops-log rows (newest-first), optionally scoped to one
|
|
21463
|
+
* camera. Backed by the recorder's bounded DurableState ring. */
|
|
21464
|
+
listOpsLog: method(OpsLogQueryInputSchema, zod.z.array(OpsLogEntrySchema).readonly(), {
|
|
21465
|
+
kind: "query",
|
|
21466
|
+
auth: "admin"
|
|
20956
21467
|
})
|
|
20957
21468
|
}
|
|
20958
21469
|
};
|
|
@@ -24655,6 +25166,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
24655
25166
|
addonId: null,
|
|
24656
25167
|
access: "delete"
|
|
24657
25168
|
},
|
|
25169
|
+
"pipelineAnalytics.deleteDeviceEvents": {
|
|
25170
|
+
capName: "pipeline-analytics",
|
|
25171
|
+
capScope: "device",
|
|
25172
|
+
addonId: null,
|
|
25173
|
+
access: "delete"
|
|
25174
|
+
},
|
|
24658
25175
|
"pipelineAnalytics.deleteTracks": {
|
|
24659
25176
|
capName: "pipeline-analytics",
|
|
24660
25177
|
capScope: "device",
|
|
@@ -24685,6 +25202,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
24685
25202
|
addonId: null,
|
|
24686
25203
|
access: "view"
|
|
24687
25204
|
},
|
|
25205
|
+
"pipelineAnalytics.getEventStoreFootprint": {
|
|
25206
|
+
capName: "pipeline-analytics",
|
|
25207
|
+
capScope: "device",
|
|
25208
|
+
addonId: null,
|
|
25209
|
+
access: "view"
|
|
25210
|
+
},
|
|
24688
25211
|
"pipelineAnalytics.getKeyEvents": {
|
|
24689
25212
|
capName: "pipeline-analytics",
|
|
24690
25213
|
capScope: "device",
|
|
@@ -24727,6 +25250,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
24727
25250
|
addonId: null,
|
|
24728
25251
|
access: "view"
|
|
24729
25252
|
},
|
|
25253
|
+
"pipelineAnalytics.listOpsLog": {
|
|
25254
|
+
capName: "pipeline-analytics",
|
|
25255
|
+
capScope: "device",
|
|
25256
|
+
addonId: null,
|
|
25257
|
+
access: "view"
|
|
25258
|
+
},
|
|
24730
25259
|
"pipelineAnalytics.listRecentTracks": {
|
|
24731
25260
|
capName: "pipeline-analytics",
|
|
24732
25261
|
capScope: "device",
|
|
@@ -24739,6 +25268,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
24739
25268
|
addonId: null,
|
|
24740
25269
|
access: "view"
|
|
24741
25270
|
},
|
|
25271
|
+
"pipelineAnalytics.pruneEvents": {
|
|
25272
|
+
capName: "pipeline-analytics",
|
|
25273
|
+
capScope: "device",
|
|
25274
|
+
addonId: null,
|
|
25275
|
+
access: "create"
|
|
25276
|
+
},
|
|
24742
25277
|
"pipelineAnalytics.pruneEventsBefore": {
|
|
24743
25278
|
capName: "pipeline-analytics",
|
|
24744
25279
|
capScope: "device",
|
|
@@ -25501,6 +26036,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
25501
26036
|
addonId: null,
|
|
25502
26037
|
access: "create"
|
|
25503
26038
|
},
|
|
26039
|
+
"recording.deleteFootprint": {
|
|
26040
|
+
capName: "recording",
|
|
26041
|
+
capScope: "system",
|
|
26042
|
+
addonId: null,
|
|
26043
|
+
access: "delete"
|
|
26044
|
+
},
|
|
25504
26045
|
"recording.getAvailability": {
|
|
25505
26046
|
capName: "recording",
|
|
25506
26047
|
capScope: "system",
|
|
@@ -25531,6 +26072,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
25531
26072
|
addonId: null,
|
|
25532
26073
|
access: "view"
|
|
25533
26074
|
},
|
|
26075
|
+
"recording.listOpsLog": {
|
|
26076
|
+
capName: "recording",
|
|
26077
|
+
capScope: "system",
|
|
26078
|
+
addonId: null,
|
|
26079
|
+
access: "view"
|
|
26080
|
+
},
|
|
25534
26081
|
"recording.locateSegment": {
|
|
25535
26082
|
capName: "recording",
|
|
25536
26083
|
capScope: "system",
|