@camstack/system 1.1.55 → 1.1.57
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-CD5HJkAg.js → dist-Bg795EQF.js} +367 -1
- package/dist/{dist-RlzjLezj.mjs → dist-JAF9YR1q.mjs} +367 -1
- package/dist/index.js +12 -4
- package/dist/index.mjs +12 -4
- package/dist/kernel/addon-loader.d.ts +7 -2
- package/dist/{manifest-python-deps-BMKlyabv.mjs → manifest-python-deps-9wuRyL-k.mjs} +1 -1
- package/dist/{manifest-python-deps-BpDOYWC2.js → manifest-python-deps-eI3-3FeW.js} +1 -1
- package/package.json +1 -1
|
@@ -3742,6 +3742,160 @@ function readNodePin(context) {
|
|
|
3742
3742
|
const value = Reflect.get(context, CAP_NODE_PIN_CONTEXT_KEY);
|
|
3743
3743
|
return typeof value === "string" ? value : void 0;
|
|
3744
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
|
+
];
|
|
3745
3899
|
var YAMNET_TO_MACRO = {
|
|
3746
3900
|
mapping: {
|
|
3747
3901
|
Speech: "speech",
|
|
@@ -4008,6 +4162,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
|
|
|
4008
4162
|
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
4009
4163
|
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
4010
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
|
+
/**
|
|
4011
4284
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
4012
4285
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
4013
4286
|
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
@@ -15876,17 +16149,30 @@ var EventKindCategorySchema = z.enum([
|
|
|
15876
16149
|
"audio",
|
|
15877
16150
|
"detection",
|
|
15878
16151
|
"sensor",
|
|
16152
|
+
"control",
|
|
15879
16153
|
"custom",
|
|
15880
16154
|
"package"
|
|
15881
16155
|
]);
|
|
16156
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
16157
|
+
var EventKindLevelSchema = z.enum(["macro", "sub"]);
|
|
15882
16158
|
var EventKindDescriptorSchema = z.object({
|
|
15883
|
-
/** Stable kind id (e.g. 'motion', '
|
|
16159
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
15884
16160
|
kind: z.string(),
|
|
16161
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16162
|
+
labelKey: z.string(),
|
|
16163
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
15885
16164
|
label: z.string(),
|
|
15886
16165
|
/** Hex color for timeline/legend rendering. */
|
|
15887
16166
|
color: z.string(),
|
|
16167
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
16168
|
+
iconId: z.string(),
|
|
16169
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
15888
16170
|
icon: EventKindIconSchema,
|
|
15889
16171
|
category: EventKindCategorySchema,
|
|
16172
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16173
|
+
parentKind: z.string().nullable(),
|
|
16174
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16175
|
+
level: EventKindLevelSchema,
|
|
15890
16176
|
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15891
16177
|
* itself; for sensor kinds the LINKED source device. */
|
|
15892
16178
|
source: z.object({
|
|
@@ -15959,11 +16245,21 @@ var TrackAudioLabelSchema = z.object({
|
|
|
15959
16245
|
firstAt: z.number(),
|
|
15960
16246
|
lastAt: z.number()
|
|
15961
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 = z.enum(["pipeline", "sensor"]);
|
|
15962
16256
|
var TrackSchema = z.object({
|
|
15963
16257
|
trackId: z.string(),
|
|
15964
16258
|
deviceId: z.number(),
|
|
15965
16259
|
className: z.string(),
|
|
15966
16260
|
label: z.string().optional(),
|
|
16261
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
16262
|
+
source: TrackSourceSchema.optional(),
|
|
15967
16263
|
firstSeen: z.number(),
|
|
15968
16264
|
lastSeen: z.number(),
|
|
15969
16265
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
@@ -16491,6 +16787,76 @@ var pipelineAnalyticsCapability = {
|
|
|
16491
16787
|
}) }
|
|
16492
16788
|
}
|
|
16493
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)])));
|
|
16494
16860
|
var CameraPipelineConfigSchema = z.object({
|
|
16495
16861
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
16496
16862
|
steps: z.array(PipelineStepInputSchema).readonly(),
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-Bg795EQF.js");
|
|
4
4
|
const require_model_download_service = require("./model-download-service-hf0ookyy.js");
|
|
5
|
-
const require_manifest_python_deps = require("./manifest-python-deps-
|
|
5
|
+
const require_manifest_python_deps = require("./manifest-python-deps-eI3-3FeW.js");
|
|
6
6
|
const require_resource_monitor = require("./resource-monitor-DNNomR-i.js");
|
|
7
7
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
8
8
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
@@ -2308,9 +2308,15 @@ var AddonLoader = class {
|
|
|
2308
2308
|
else i++;
|
|
2309
2309
|
}
|
|
2310
2310
|
/** Scan addons directory and load all addon packages.
|
|
2311
|
-
* Supports scoped layout: addons/@scope/package-name/
|
|
2312
|
-
|
|
2311
|
+
* Supports scoped layout: addons/@scope/package-name/
|
|
2312
|
+
*
|
|
2313
|
+
* `skipPackages` names scoped packages (e.g. `@camstack/system`) that the
|
|
2314
|
+
* caller loads from elsewhere — the single-copy model loads the framework
|
|
2315
|
+
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
2316
|
+
* the addons-dir `@camstack/system` must NOT be double-loaded here. */
|
|
2317
|
+
async loadFromDirectory(addonsDir, skipPackages = []) {
|
|
2313
2318
|
if (!node_fs.existsSync(addonsDir)) return;
|
|
2319
|
+
const skip = new Set(skipPackages);
|
|
2314
2320
|
const entries = node_fs.readdirSync(addonsDir, { withFileTypes: true });
|
|
2315
2321
|
for (const entry of entries) {
|
|
2316
2322
|
if (!isDirectoryEntry(entry, addonsDir)) continue;
|
|
@@ -2319,10 +2325,12 @@ var AddonLoader = class {
|
|
|
2319
2325
|
const scopeEntries = node_fs.readdirSync(scopeDir, { withFileTypes: true });
|
|
2320
2326
|
for (const scopeEntry of scopeEntries) {
|
|
2321
2327
|
if (!isDirectoryEntry(scopeEntry, scopeDir)) continue;
|
|
2328
|
+
if (skip.has(`${entry.name}/${scopeEntry.name}`)) continue;
|
|
2322
2329
|
await this.tryLoadAddon(node_path.join(scopeDir, scopeEntry.name));
|
|
2323
2330
|
}
|
|
2324
2331
|
continue;
|
|
2325
2332
|
}
|
|
2333
|
+
if (skip.has(entry.name)) continue;
|
|
2326
2334
|
await this.tryLoadAddon(node_path.join(addonsDir, entry.name));
|
|
2327
2335
|
}
|
|
2328
2336
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as isArrayOutputSchema, Ct as parseJsonObject, D as extractNestedAddonId, Dt as scopeKey, Et as resolveCapMount, F as lifecycleJobSchema, G as procedureAuthKey, H as objectInputDeclaresAddonId, M as isObjectInput, N as isVoidInput, P as kebabToCamel, R as looseSchema, Tt as readinessKey, _t as createEvent, at as DATAPLANE_SECRET_HEADER$1, bt as expandCapMethods, dt as ReadinessRegistry, ft as ReadinessTimeoutError, gt as asString$1, ht as asNumber, j as isCollectionArrayMethod, kt as EventCategory$1, mt as asJsonObject$1, o as METHOD_ACCESS_MAP, ot as DEVICE_SETTINGS_CONTRIBUTION_METHODS, p as addonSettingsCapability, rt as errMsg$1, s as RUNTIME_DEFAULTS, st as DEVICE_STATUS_METHOD, t as ALL_CAPABILITY_DEFINITIONS, vt as emitDownForOwnedCaps, wt as parseJsonUnknown$1 } from "./dist-
|
|
1
|
+
import { A as isArrayOutputSchema, Ct as parseJsonObject, D as extractNestedAddonId, Dt as scopeKey, Et as resolveCapMount, F as lifecycleJobSchema, G as procedureAuthKey, H as objectInputDeclaresAddonId, M as isObjectInput, N as isVoidInput, P as kebabToCamel, R as looseSchema, Tt as readinessKey, _t as createEvent, at as DATAPLANE_SECRET_HEADER$1, bt as expandCapMethods, dt as ReadinessRegistry, ft as ReadinessTimeoutError, gt as asString$1, ht as asNumber, j as isCollectionArrayMethod, kt as EventCategory$1, mt as asJsonObject$1, o as METHOD_ACCESS_MAP, ot as DEVICE_SETTINGS_CONTRIBUTION_METHODS, p as addonSettingsCapability, rt as errMsg$1, s as RUNTIME_DEFAULTS, st as DEVICE_STATUS_METHOD, t as ALL_CAPABILITY_DEFINITIONS, vt as emitDownForOwnedCaps, wt as parseJsonUnknown$1 } from "./dist-JAF9YR1q.mjs";
|
|
2
2
|
import { a as downloadModel, c as getModelFilePath, d as contentTypeFor, f as createAuthenticatedFileServer, h as resolveFilePath, i as downloadFile, l as isModelDownloaded, m as parseTokenizedUrl, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, s as fetchJson, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-Cp9f4dk6.mjs";
|
|
3
|
-
import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, B as AGENT_CAP_FWD_SERVICE, C as buildLinkChain, D as HUB_CAP_FWD_ACTION, E as localProviderLink, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, N as udsChildLogToWorkerEntry, O as HUB_CAP_FWD_SERVICE, P as createUdsLogger, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerTransportLink, T as ipcParentLink, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as resolveHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as getCapUsageRegistry, bt as resolveAddonClass, c as setHubConnected, ct as capActionName, d as getMoleculerEventStats, dt as capServiceName, et as createBrokerDeviceManagerApi, f as registerEventBusService, ft as parseCapAction, g as createKernelHwAccel, gt as CapabilityHandle, h as AddonDepsManager, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, k as createHubCapForwardService, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as subscribePassthrough, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as setNodeEventInterest, pt as deserializeTypedArrays, q as UdsLocalTransportServer, r as createAddonContext, rt as mountNativeCapService, s as getOrInitReadinessRegistryForClient, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestPythonDeps, u as getBrokerEventBus, ut as capBareAction, v as CapUsageRegistry, vt as installManifestNativeDeps, w as ipcChildLink, x as brokerCallForCap, xt as createAddonDataPlaneFacility, y as __resetCapUsageRegistryForTests, yt as runNpm, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-
|
|
3
|
+
import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, B as AGENT_CAP_FWD_SERVICE, C as buildLinkChain, D as HUB_CAP_FWD_ACTION, E as localProviderLink, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, N as udsChildLogToWorkerEntry, O as HUB_CAP_FWD_SERVICE, P as createUdsLogger, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerTransportLink, T as ipcParentLink, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as resolveHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as getCapUsageRegistry, bt as resolveAddonClass, c as setHubConnected, ct as capActionName, d as getMoleculerEventStats, dt as capServiceName, et as createBrokerDeviceManagerApi, f as registerEventBusService, ft as parseCapAction, g as createKernelHwAccel, gt as CapabilityHandle, h as AddonDepsManager, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, k as createHubCapForwardService, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as subscribePassthrough, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as setNodeEventInterest, pt as deserializeTypedArrays, q as UdsLocalTransportServer, r as createAddonContext, rt as mountNativeCapService, s as getOrInitReadinessRegistryForClient, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestPythonDeps, u as getBrokerEventBus, ut as capBareAction, v as CapUsageRegistry, vt as installManifestNativeDeps, w as ipcChildLink, x as brokerCallForCap, xt as createAddonDataPlaneFacility, y as __resetCapUsageRegistryForTests, yt as runNpm, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-9wuRyL-k.mjs";
|
|
4
4
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Le3l0qS2.mjs";
|
|
5
5
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
6
6
|
import { SqliteSettingsAddon, t as SqliteSettingsBackend } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
@@ -2300,9 +2300,15 @@ var AddonLoader = class {
|
|
|
2300
2300
|
else i++;
|
|
2301
2301
|
}
|
|
2302
2302
|
/** Scan addons directory and load all addon packages.
|
|
2303
|
-
* Supports scoped layout: addons/@scope/package-name/
|
|
2304
|
-
|
|
2303
|
+
* Supports scoped layout: addons/@scope/package-name/
|
|
2304
|
+
*
|
|
2305
|
+
* `skipPackages` names scoped packages (e.g. `@camstack/system`) that the
|
|
2306
|
+
* caller loads from elsewhere — the single-copy model loads the framework
|
|
2307
|
+
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
2308
|
+
* the addons-dir `@camstack/system` must NOT be double-loaded here. */
|
|
2309
|
+
async loadFromDirectory(addonsDir, skipPackages = []) {
|
|
2305
2310
|
if (!fs$17.existsSync(addonsDir)) return;
|
|
2311
|
+
const skip = new Set(skipPackages);
|
|
2306
2312
|
const entries = fs$17.readdirSync(addonsDir, { withFileTypes: true });
|
|
2307
2313
|
for (const entry of entries) {
|
|
2308
2314
|
if (!isDirectoryEntry(entry, addonsDir)) continue;
|
|
@@ -2311,10 +2317,12 @@ var AddonLoader = class {
|
|
|
2311
2317
|
const scopeEntries = fs$17.readdirSync(scopeDir, { withFileTypes: true });
|
|
2312
2318
|
for (const scopeEntry of scopeEntries) {
|
|
2313
2319
|
if (!isDirectoryEntry(scopeEntry, scopeDir)) continue;
|
|
2320
|
+
if (skip.has(`${entry.name}/${scopeEntry.name}`)) continue;
|
|
2314
2321
|
await this.tryLoadAddon(path$39.join(scopeDir, scopeEntry.name));
|
|
2315
2322
|
}
|
|
2316
2323
|
continue;
|
|
2317
2324
|
}
|
|
2325
|
+
if (skip.has(entry.name)) continue;
|
|
2318
2326
|
await this.tryLoadAddon(path$39.join(addonsDir, entry.name));
|
|
2319
2327
|
}
|
|
2320
2328
|
}
|
|
@@ -72,8 +72,13 @@ export declare class AddonLoader {
|
|
|
72
72
|
/** Forget any tracked failures for a given package — uninstall path. */
|
|
73
73
|
clearLoadFailures(packageName: string): void;
|
|
74
74
|
/** Scan addons directory and load all addon packages.
|
|
75
|
-
* Supports scoped layout: addons/@scope/package-name/
|
|
76
|
-
|
|
75
|
+
* Supports scoped layout: addons/@scope/package-name/
|
|
76
|
+
*
|
|
77
|
+
* `skipPackages` names scoped packages (e.g. `@camstack/system`) that the
|
|
78
|
+
* caller loads from elsewhere — the single-copy model loads the framework
|
|
79
|
+
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
80
|
+
* the addons-dir `@camstack/system` must NOT be double-loaded here. */
|
|
81
|
+
loadFromDirectory(addonsDir: string, skipPackages?: readonly string[]): Promise<void>;
|
|
77
82
|
private tryLoadAddon;
|
|
78
83
|
/** Load addon from a specific directory (package.json + dist/) */
|
|
79
84
|
loadFromAddonDir(addonDir: string): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as readNodePin } from "./dist-
|
|
1
|
+
import { K as readNodePin } from "./dist-JAF9YR1q.mjs";
|
|
2
2
|
import { ensureBinary, ensureFfmpeg, ensurePython, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
import * as fs from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-Bg795EQF.js");
|
|
3
3
|
let _camstack_types_node = require("@camstack/types/node");
|
|
4
4
|
let node_http = require("node:http");
|
|
5
5
|
let node_fs = require("node:fs");
|