@camstack/addon-model-studio 1.1.289 → 1.1.291

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.
Files changed (19) hide show
  1. package/dist/{MotionZonesSettings-mlU-VSe5.mjs → MotionZonesSettings-DXxWq7vE.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-Cx5oEsjP.mjs → PrivacyMaskSettings-DvOLfWNI.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-GMAcbbJ0.mjs → SceneMonitorEditor-DqBJBxj1.mjs} +3 -3
  4. package/dist/_stub.js +4019 -3997
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DvHxq6CH.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-BPa3rRsT.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BNQVBn-8.mjs +26 -0
  7. package/dist/addon-model-studio.css +1 -1
  8. package/dist/{hostInit-Beh8D27N.mjs → hostInit-7KFbe0cc.mjs} +2 -2
  9. package/dist/model-studio.addon.js +293 -155
  10. package/dist/model-studio.addon.mjs +293 -155
  11. package/dist/{player-overlays-BNm3QxNX.mjs → player-overlays-DfIeB2mX.mjs} +1 -1
  12. package/dist/remoteEntry.js +1 -1
  13. package/dist/{responsive-BBGHW8J6.mjs → responsive-CISBqF_G.mjs} +1 -1
  14. package/dist/{scene-monitor-copy-BEIH363L.mjs → scene-monitor-copy-CScGmaG7.mjs} +1 -1
  15. package/dist/{square-DiTXshc8.mjs → square-BtvqwHZc.mjs} +1 -1
  16. package/dist/{trash-2-BVSkUDtB.mjs → trash-2-DIqyhuDF.mjs} +1 -1
  17. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-ohPGd04S.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-C-xXOFlf.mjs} +1 -1
  18. package/package.json +1 -1
  19. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BL63cAWe.mjs +0 -26
@@ -394,7 +394,7 @@ function buildScryptedRegistryDescriptor(entry) {
394
394
  };
395
395
  }
396
396
  //#endregion
397
- //#region ../types/dist/event-category-fDPduoeC.mjs
397
+ //#region ../types/dist/event-category-Ceif8n-v.mjs
398
398
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
399
399
  EventCategory["SystemBoot"] = "system.boot";
400
400
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -866,6 +866,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
866
866
  * on the device detail page.
867
867
  */
868
868
  EventCategory["DoorbellOnPressed"] = "doorbell.onPressed";
869
+ /** Mirrors `runningStateCapability.events.onStarted`. */
870
+ EventCategory["RunningStarted"] = "running.started";
871
+ /** Mirrors `runningStateCapability.events.onFinished`. */
872
+ EventCategory["RunningFinished"] = "running.finished";
869
873
  /**
870
874
  * Cap event fired by every device that registers the `event-emitter`
871
875
  * capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
@@ -5825,7 +5829,7 @@ var ZodIssueCode = {
5825
5829
  var ZodFirstPartyTypeKind;
5826
5830
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5827
5831
  //#endregion
5828
- //#region ../types/dist/sleep-CHIEEJkY.mjs
5832
+ //#region ../types/dist/sleep-CYfIZzGv.mjs
5829
5833
  /**
5830
5834
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5831
5835
  * window to float samples (D455).
@@ -6164,7 +6168,7 @@ Object.fromEntries([
6164
6168
  * `hydrateSchema` to skip the `value` injection for structural-only fields.
6165
6169
  */
6166
6170
  function isValuelessField(field) {
6167
- return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
6171
+ return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
6168
6172
  }
6169
6173
  function hydrateSchema(schema, values, options = {}) {
6170
6174
  return {
@@ -9206,7 +9210,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
9206
9210
  return DeviceRole;
9207
9211
  }({});
9208
9212
  //#endregion
9209
- //#region ../types/dist/composition-CB6PMT9p.mjs
9213
+ //#region ../types/dist/composition-xz-ud5EQ.mjs
9210
9214
  /**
9211
9215
  * The ffmpeg build every CamStack node downloads, per platform and arch.
9212
9216
  *
@@ -9507,6 +9511,20 @@ var table = {
9507
9511
  apply: () => {
9508
9512
  throw new ExpressionEvalError("count: stateful evaluation context is required");
9509
9513
  }
9514
+ },
9515
+ dwell: {
9516
+ minArgs: 3,
9517
+ maxArgs: 3,
9518
+ apply: () => {
9519
+ throw new ExpressionEvalError("dwell: stateful evaluation context is required");
9520
+ }
9521
+ },
9522
+ latchedAt: {
9523
+ minArgs: 1,
9524
+ maxArgs: 1,
9525
+ apply: () => {
9526
+ throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
9527
+ }
9510
9528
  }
9511
9529
  };
9512
9530
  Object.freeze(Object.assign(Object.create(null), table));
@@ -16506,7 +16524,15 @@ Object.freeze({
16506
16524
  kind: "fixed",
16507
16525
  result: ["number", "null"]
16508
16526
  },
16509
- count: NUMBER
16527
+ count: NUMBER,
16528
+ dwell: {
16529
+ kind: "fixed",
16530
+ result: ["boolean", "null"]
16531
+ },
16532
+ latchedAt: {
16533
+ kind: "fixed",
16534
+ result: ["number", "null"]
16535
+ }
16510
16536
  });
16511
16537
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
16512
16538
  /**
@@ -42734,9 +42760,6 @@ var NcSystemEventKindSchema = _enum([
42734
42760
  "device-battery-normal",
42735
42761
  "device-consumable-low",
42736
42762
  "device-consumable-normal",
42737
- "device-tank-low",
42738
- "device-tank-full",
42739
- "device-tank-normal",
42740
42763
  "stream-online",
42741
42764
  "stream-offline",
42742
42765
  "node-online",
@@ -42783,13 +42806,14 @@ var NcSystemEventKindSchema = _enum([
42783
42806
  "camera-enabled"
42784
42807
  ]);
42785
42808
  /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
42786
- var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
42809
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = [
42787
42810
  "camera-online",
42788
42811
  "camera-offline",
42789
42812
  "camera-disabled",
42790
42813
  "camera-enabled"
42791
- ]);
42792
- NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
42814
+ ];
42815
+ var NC_LEGACY_SYSTEM_EVENT_KIND_SET = new Set(NC_LEGACY_SYSTEM_EVENT_KINDS);
42816
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KIND_SET.has(kind));
42793
42817
  /**
42794
42818
  * The panel's transitions, as ONE list.
42795
42819
  *
@@ -43908,18 +43932,11 @@ var NcRuleSchema = NcRuleInputSchema.extend({
43908
43932
  */
43909
43933
  disabledTargetIds: array(string()).default([])
43910
43934
  });
43911
- /**
43912
- * The state-summary SECTIONS (D647 / D698 / D708): the D637 kind groups that
43913
- * report a still-true state. `addons` is the crash-looped addons only and
43914
- * `addon-updates` the addons that are behind (D708 split them). `backups-exports` and `alarm` are not sections — a completed
43915
- * job is not an open state, and the alarm stays instant.
43916
- */
43917
43935
  var NcStateSummarySectionIdSchema = _enum([
43918
43936
  "device-state",
43919
43937
  "streams",
43920
43938
  "battery",
43921
43939
  "consumables",
43922
- "tanks",
43923
43940
  "detection-blind",
43924
43941
  "nodes",
43925
43942
  "addons",
@@ -45220,6 +45237,18 @@ Object.freeze({
45220
45237
  reason: "camera sensor mappings not loaded"
45221
45238
  });
45222
45239
  /**
45240
+ * What the vision model must answer before a package event is emitted
45241
+ * when a packages rule has "Confirm with the LLM" on.
45242
+ *
45243
+ * `package` is the verdict. `confidence` is 0..1. `reason` is the model's
45244
+ * one-line explanation, stored on the event so a drop is not silent.
45245
+ */
45246
+ var PackageLlmVerdictSchema = object({
45247
+ package: boolean(),
45248
+ confidence: number().min(0).max(1),
45249
+ reason: string().min(1)
45250
+ });
45251
+ /**
45223
45252
  * A model choice has a SCOPE, and a scope change has a workflow.
45224
45253
  *
45225
45254
  * ## The two scopes
@@ -46156,6 +46185,21 @@ var ObjectEventSchema = object({
46156
46185
  * pick-up written before D684 — UNKNOWN, never 0 and never `timestamp`.
46157
46186
  */
46158
46187
  observedAt: number().optional(),
46188
+ /**
46189
+ * The delivery was emitted without a vision-model yes (D931).
46190
+ *
46191
+ * Set only when the packages rule asked for an LLM confirm and the model
46192
+ * was unreachable, timed out, or answered something that did not parse.
46193
+ * A notification reads it so it can say "possible" instead of a definite
46194
+ * delivery. Absent on every other row, and on a confirm that said yes.
46195
+ */
46196
+ packagePossible: boolean().optional(),
46197
+ /**
46198
+ * The vision model's verdict, when a packages rule asked for one and the
46199
+ * model answered the schema (D931). A "no" never becomes a row — the
46200
+ * detector drops it and logs the reason. Present on a yes.
46201
+ */
46202
+ packageLlmVerdict: PackageLlmVerdictSchema.optional(),
46159
46203
  /** The parent track's key-event importance [0,1], propagated to every object
46160
46204
  * event of the track (so an event row can be sorted by importance without a
46161
46205
  * track join). Absent on legacy rows / before the track was scored. */
@@ -48363,11 +48407,18 @@ var KeptReasonSchema = _enum(["custom-pin"]);
48363
48407
  * Where a choice's latency came from (D791): this node's own benchmark
48364
48408
  * result, or the hardware-class table. Measured on the node beats the table.
48365
48409
  */
48366
- var LatencySourceSchema = discriminatedUnion("kind", [object({ kind: literal("table") }), object({
48367
- kind: literal("node-benchmark"),
48368
- resultId: string(),
48369
- measuredAtMs: number()
48370
- })]);
48410
+ var LatencySourceSchema = discriminatedUnion("kind", [
48411
+ object({ kind: literal("table") }),
48412
+ object({
48413
+ kind: literal("node-benchmark"),
48414
+ resultId: string(),
48415
+ measuredAtMs: number()
48416
+ }),
48417
+ object({
48418
+ kind: literal("estimated"),
48419
+ estimatedFrom: HardwareClassIdSchema
48420
+ })
48421
+ ]);
48371
48422
  var DeviceModelChoiceSchema = object({
48372
48423
  modelId: string(),
48373
48424
  p50Ms: number(),
@@ -48375,6 +48426,11 @@ var DeviceModelChoiceSchema = object({
48375
48426
  measured: boolean(),
48376
48427
  /** Absent on a plan from before D791 — read as the table. */
48377
48428
  source: LatencySourceSchema.optional(),
48429
+ /**
48430
+ * The measured class this latency was scaled from (D930). Absent when the
48431
+ * cell is the table or a node benchmark.
48432
+ */
48433
+ estimatedFrom: HardwareClassIdSchema.optional(),
48378
48434
  /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
48379
48435
  capacitySessions: number(),
48380
48436
  personRecall: number()
@@ -58604,6 +58660,30 @@ includeCrops: boolean().optional() }).optional(), array(VehicleSchema).readonly(
58604
58660
  kind: "mutation",
58605
58661
  auth: "admin"
58606
58662
  });
58663
+ var CORE_ULTRA_265K_IGPU_CLOCK_MHZ = 2e3;
58664
+ var positiveOrNull = number().nullable().transform((value) => value !== null && Number.isFinite(value) && value > 0 ? value : null);
58665
+ var textOrNull = string().nullable().transform((value) => value !== null && value.trim() !== "" ? value : null);
58666
+ var PrecisionGopsSchema = object({
58667
+ int8: positiveOrNull,
58668
+ fp16: positiveOrNull
58669
+ });
58670
+ /** What one accelerator device reported. Every failed query is null. */
58671
+ var AcceleratorComputeSchema = object({
58672
+ deviceKey: string(),
58673
+ fullDeviceName: textOrNull,
58674
+ executionUnits: positiveOrNull,
58675
+ clockMHz: positiveOrNull,
58676
+ gops: PrecisionGopsSchema.nullable(),
58677
+ architecture: textOrNull,
58678
+ npuName: textOrNull,
58679
+ tops: positiveOrNull,
58680
+ vendor: textOrNull,
58681
+ webgpuArchitecture: textOrNull,
58682
+ webgpuDevice: textOrNull,
58683
+ computeUnits: positiveOrNull
58684
+ });
58685
+ object({ accelerators: array(AcceleratorComputeSchema).nullable() });
58686
+ 64 * CORE_ULTRA_265K_IGPU_CLOCK_MHZ;
58607
58687
  var ModelFormatSchema = _enum(MODEL_FORMATS);
58608
58688
  var HwAccelBackendInputSchema = _enum([
58609
58689
  "videotoolbox",
@@ -58717,7 +58797,12 @@ var HardwareInfoSchema = object({
58717
58797
  availableRAM_MB: number(),
58718
58798
  gpu: GpuInfoSchema.nullable(),
58719
58799
  npu: NpuInfoSchema.nullable(),
58720
- coral: CoralInfoSchema.nullable().optional()
58800
+ coral: CoralInfoSchema.nullable().optional(),
58801
+ /**
58802
+ * Per-accelerator compute (D930). Omitted by a node that has not probed it.
58803
+ * `null` fields inside an entry are a failed query, never a zero.
58804
+ */
58805
+ accelerators: array(AcceleratorComputeSchema).readonly().optional()
58721
58806
  });
58722
58807
  var PlatformScoreSchema = object({
58723
58808
  runtime: literal("python"),
@@ -59250,6 +59335,22 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
59250
59335
  deviceId: number(),
59251
59336
  status: PtzAutotrackStatusSchema
59252
59337
  });
59338
+ var RunningStateSourceSchema = _enum(["native", "assigned"]);
59339
+ object({
59340
+ /** null = unknown — never coerced to false (D393). */
59341
+ running: boolean().nullable(),
59342
+ /** Epoch ms the current boolean began; null while `running` is null. */
59343
+ since: number().nullable(),
59344
+ source: RunningStateSourceSchema,
59345
+ phase: string().nullable(),
59346
+ lastFetchedAt: number()
59347
+ });
59348
+ object({
59349
+ deviceId: number(),
59350
+ since: number().nullable(),
59351
+ phase: string().nullable()
59352
+ });
59353
+ Object.values(DeviceType);
59253
59354
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
59254
59355
  kind: "mutation",
59255
59356
  auth: "admin"
@@ -61089,7 +61190,20 @@ var ZoneRuleSchema = object({
61089
61190
  * Defaults to `true` so operators creating a rule via the UI
61090
61191
  * see it active immediately.
61091
61192
  */
61092
- enabled: boolean().default(true)
61193
+ enabled: boolean().default(true),
61194
+ /**
61195
+ * Package stage only. When true, a package candidate may open from a
61196
+ * scene difference in this rule's zone after a person leaves. The
61197
+ * package model, when it boxes something overlapping, is extra evidence
61198
+ * and is not the gate. Absent or false keeps today's model path.
61199
+ */
61200
+ detectBySceneDifference: boolean().optional(),
61201
+ /**
61202
+ * Package stage only. When true, a promoted package is shown to the
61203
+ * `llm` cap before the delivery event is emitted. Absent or false emits
61204
+ * as today. Usable with or without `detectBySceneDifference`.
61205
+ */
61206
+ confirmWithLlm: boolean().optional()
61093
61207
  });
61094
61208
  array(ZoneRuleSchema).readonly();
61095
61209
  object({
@@ -70629,6 +70743,13 @@ Object.freeze({
70629
70743
  access: "create",
70630
70744
  role: "admin"
70631
70745
  },
70746
+ "runningState.getStatus": {
70747
+ capName: "running-state",
70748
+ capScope: "device",
70749
+ addonId: null,
70750
+ access: "view",
70751
+ role: "viewer"
70752
+ },
70632
70753
  "sceneMonitor.captureReference": {
70633
70754
  capName: "scene-monitor",
70634
70755
  capScope: "device",
@@ -75343,6 +75464,32 @@ var APPLIANCE_CAP_VOCABULARY = {
75343
75464
  }],
75344
75465
  events: { onSent: { notOperatorFacing: "a delivery receipt of a send this system made — not a fact about the world" } }
75345
75466
  },
75467
+ "running-state": {
75468
+ scope: "device",
75469
+ noun: t("Running", "In funzione"),
75470
+ state: [{
75471
+ kind: "boolean",
75472
+ field: "running",
75473
+ label: t("Running", "In funzione"),
75474
+ whenTrue: t("When {device} starts", "Quando {device} inizia"),
75475
+ whenFalse: t("When {device} finishes", "Quando {device} finisce"),
75476
+ icon: "play"
75477
+ }],
75478
+ events: {
75479
+ onStarted: {
75480
+ category: EventCategory.RunningStarted,
75481
+ label: t("Started running", "Ha iniziato a funzionare"),
75482
+ phrase: t("When {device} starts running", "Quando {device} inizia a funzionare"),
75483
+ icon: "play"
75484
+ },
75485
+ onFinished: {
75486
+ category: EventCategory.RunningFinished,
75487
+ label: t("Finished", "Ha finito"),
75488
+ phrase: t("When {device} finishes", "Quando {device} finisce"),
75489
+ icon: "square"
75490
+ }
75491
+ }
75492
+ },
75346
75493
  update: {
75347
75494
  scope: "device",
75348
75495
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -78883,6 +79030,11 @@ Object.freeze({
78883
79030
  form: "single",
78884
79031
  optional: true
78885
79032
  }],
79033
+ "runningState.getStatus": [{
79034
+ name: "deviceId",
79035
+ form: "single",
79036
+ optional: false
79037
+ }],
78886
79038
  "sceneMonitor.captureReference": [{
78887
79039
  name: "deviceId",
78888
79040
  form: "single",
@@ -79433,40 +79585,7 @@ var NC_AUDIO_DEFAULTS = {
79433
79585
  samplingSeconds: 10
79434
79586
  };
79435
79587
  new Set(["devices", "classes"]);
79436
- /**
79437
- * WHICH narrowing filter speaks about WHICH system-event kind — one predicate,
79438
- * consumed by the rule ENGINE and by every rule EDITOR.
79439
- *
79440
- * ── The failure this file exists for ───────────────────────────────────────
79441
- * `NcSystemEventConditionSchema` carries four optional narrowing lists
79442
- * (`deviceIds`, `deviceTypes`, `nodeIds`, `packageNames`) beside a required
79443
- * `kinds` gate. They are not four filters over one vocabulary: each belongs to
79444
- * a FAMILY of kinds and is meaningless outside it. A node going away has no
79445
- * device type; a completed export has no package; `stream-offline` deliberately
79446
- * carries no device type at all (a stream belongs to a camera by construction).
79447
- *
79448
- * The engine applied all four to every kind, so a filter from one family failed
79449
- * a kind from another family CLOSED. The operator's live rule "Eventi di
79450
- * sistema" selected eleven kinds and set `deviceTypes: ['camera']` — the only
79451
- * way to say "only my cameras" about the two liveness kinds — and NINE of the
79452
- * eleven silently stopped being deliverable. Four days of history contained
79453
- * `device-online` and `device-offline` and nothing else, across a window in
79454
- * which agents were restarted and addons were updated.
79455
- *
79456
- * Both editors already computed this scoping, to decide which filter boxes to
79457
- * render; the cap's own docblock already promised it ("Narrow a `device-*` kind
79458
- * to these device TYPES"). Only the engine disagreed, and it disagreed in the
79459
- * destructive direction. So the rule is stated ONCE, here, and the engine and
79460
- * the editors are readers of it rather than three independent authors.
79461
- *
79462
- * ── The direction ─────────────────────────────────────────────────────────
79463
- * Out of family ⇒ the filter is IGNORED, never fail-closed. An editor that
79464
- * hides a box has already told the operator this filter does not speak about
79465
- * these kinds, so honouring it as an exclusion contradicts the only
79466
- * explanation the operator was ever given. Inside its family the filter still
79467
- * narrows, and still fails CLOSED on a subject that cannot produce the identity
79468
- * it tests (a device the mirror cannot name is not evidence of a camera).
79469
- */
79588
+ new Set(NC_LEGACY_SYSTEM_EVENT_KINDS);
79470
79589
  /**
79471
79590
  * Every filter, for the callers that must cover all of them (guards, tests).
79472
79591
  *
@@ -79492,9 +79611,6 @@ new Map(Object.entries({
79492
79611
  "device-battery-normal": "device-events",
79493
79612
  "device-consumable-low": "device-events",
79494
79613
  "device-consumable-normal": "device-events",
79495
- "device-tank-low": "device-events",
79496
- "device-tank-full": "device-events",
79497
- "device-tank-normal": "device-events",
79498
79614
  "stream-online": "device-events",
79499
79615
  "stream-offline": "device-events",
79500
79616
  "detection-blind": "device-events",
@@ -79571,16 +79687,6 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
79571
79687
  label: "Consumables",
79572
79688
  kinds: ["device-consumable-low", "device-consumable-normal"]
79573
79689
  },
79574
- {
79575
- id: "tanks",
79576
- family: "device-events",
79577
- label: "Tanks",
79578
- kinds: [
79579
- "device-tank-low",
79580
- "device-tank-full",
79581
- "device-tank-normal"
79582
- ]
79583
- },
79584
79690
  {
79585
79691
  id: "detection-blind",
79586
79692
  family: "device-events",
@@ -79738,11 +79844,6 @@ var RULE_BODY_ONLY = ["body"];
79738
79844
  var RULE_TEXT = ["title", "body"];
79739
79845
  var BATTERY = ["device-battery-low", "device-battery-normal"];
79740
79846
  var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
79741
- var TANK = [
79742
- "device-tank-low",
79743
- "device-tank-full",
79744
- "device-tank-normal"
79745
- ];
79746
79847
  var ALERT_EPISODE = [
79747
79848
  "alert-critical",
79748
79849
  "alert-error",
@@ -79774,7 +79875,6 @@ var DEVICE_EVENTS = [
79774
79875
  "device-enabled",
79775
79876
  ...BATTERY,
79776
79877
  ...CONSUMABLE,
79777
- ...TANK,
79778
79878
  "stream-online",
79779
79879
  "stream-offline",
79780
79880
  "detection-blind",
@@ -79820,12 +79920,6 @@ var STATE_SUMMARY_SECTION_VARS = [
79820
79920
  example: "Robot — filter 10 %",
79821
79921
  kinds: CONSUMABLE
79822
79922
  },
79823
- {
79824
- name: "summaryTanks",
79825
- label: "Summary: tanks",
79826
- example: "Robot — clean water low",
79827
- kinds: TANK
79828
- },
79829
79923
  {
79830
79924
  name: "summaryDetection",
79831
79925
  label: "Summary: cameras detecting nothing",
@@ -79941,8 +80035,7 @@ var STATE_SUMMARY_VARS = [
79941
80035
  ([...RULE_TEXT], [...COMBINED_ALARM]),
79942
80036
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
79943
80037
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
79944
- ([...RULE_TEXT], [...CONSUMABLE, ...TANK]),
79945
- ([...RULE_TEXT], [...TANK]),
80038
+ ([...RULE_TEXT], [...CONSUMABLE]),
79946
80039
  [...RULE_TEXT],
79947
80040
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79948
80041
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
@@ -80046,15 +80139,6 @@ new Map([
80046
80139
  snapshotLabel: "Consumables low now",
80047
80140
  snapshotSection: "consumables"
80048
80141
  },
80049
- {
80050
- id: "tanks",
80051
- family: "device-events",
80052
- label: "Tanks (low or full / back to normal)",
80053
- bad: ["device-tank-low", "device-tank-full"],
80054
- recovery: ["device-tank-normal"],
80055
- snapshotLabel: "Tanks low or full now",
80056
- snapshotSection: "tanks"
80057
- },
80058
80142
  {
80059
80143
  id: "motion-noise",
80060
80144
  family: "device-events",
@@ -80456,6 +80540,10 @@ TimelapseRuleInputSchema.extend({
80456
80540
  updatedAt: number()
80457
80541
  });
80458
80542
  MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
80543
+ Object.freeze({
80544
+ person: .8,
80545
+ vehicle: .8
80546
+ });
80459
80547
  object({
80460
80548
  /**
80461
80549
  * Fraction of the box's own size added on EACH side before cutting.
@@ -81603,6 +81691,91 @@ async function moveInto(source, target) {
81603
81691
  }
81604
81692
  }
81605
81693
  //#endregion
81694
+ //#region src/frigate/plus-decode.ts
81695
+ var UnsupportedPlusDecodeError = class extends Error {
81696
+ type;
81697
+ format;
81698
+ detectors;
81699
+ constructor(type, format, detectors) {
81700
+ const detList = detectors.length > 0 ? detectors.join(", ") : "(none)";
81701
+ super(`Frigate+ import refused — no decoder for type "${type}", format "${format}", detectors ${detList}`);
81702
+ this.name = "UnsupportedPlusDecodeError";
81703
+ this.type = type;
81704
+ this.format = format;
81705
+ this.detectors = detectors;
81706
+ }
81707
+ };
81708
+ var YOLO_FAMILIES = new Set(["yolo-generic", "yolov9"]);
81709
+ var SSD_FAMILIES = new Set(["mobiledet", "ssd"]);
81710
+ var YOLONAS_FAMILIES = new Set(["yolonas"]);
81711
+ function familyDefaultArtifact(type) {
81712
+ if (YOLO_FAMILIES.has(type) || YOLONAS_FAMILIES.has(type)) return "onnx";
81713
+ if (SSD_FAMILIES.has(type)) return "tflite";
81714
+ return null;
81715
+ }
81716
+ function matrixDecode(type, format) {
81717
+ if (YOLO_FAMILIES.has(type)) {
81718
+ if (format === "onnx") return {
81719
+ format: "onnx",
81720
+ extension: ".onnx",
81721
+ postprocessor: "yolo"
81722
+ };
81723
+ return {
81724
+ format: "tflite",
81725
+ extension: ".tflite",
81726
+ postprocessor: "yolo-split-dfl"
81727
+ };
81728
+ }
81729
+ if (YOLONAS_FAMILIES.has(type)) {
81730
+ if (format === "onnx") return {
81731
+ format: "onnx",
81732
+ extension: ".onnx",
81733
+ postprocessor: "yolonas"
81734
+ };
81735
+ return null;
81736
+ }
81737
+ if (SSD_FAMILIES.has(type)) {
81738
+ if (format === "tflite") return {
81739
+ format: "tflite",
81740
+ extension: ".tflite",
81741
+ postprocessor: "ssd"
81742
+ };
81743
+ return null;
81744
+ }
81745
+ return null;
81746
+ }
81747
+ function assertOverrideBacked(type, formatOverride, detectors) {
81748
+ if (formatOverride === "onnx") {
81749
+ if (!detectors.includes("onnx") && !detectors.includes("openvino")) throw new UnsupportedPlusDecodeError(type, formatOverride, detectors);
81750
+ return;
81751
+ }
81752
+ if (!detectors.includes("edgetpu")) throw new UnsupportedPlusDecodeError(type, formatOverride, detectors);
81753
+ }
81754
+ function plusArtifactFormat(format) {
81755
+ if (format === "onnx" || format === "tflite") return format;
81756
+ return null;
81757
+ }
81758
+ function resolvePlusDecode(info, formatOverride) {
81759
+ const type = info.type;
81760
+ const detectors = info.supportedDetectors ?? [];
81761
+ let format;
81762
+ if (formatOverride !== void 0) {
81763
+ const artifact = plusArtifactFormat(formatOverride);
81764
+ if (artifact === null) throw new UnsupportedPlusDecodeError(type, formatOverride, detectors);
81765
+ if (detectors.length > 0) assertOverrideBacked(type, artifact, detectors);
81766
+ format = artifact;
81767
+ } else if (detectors.includes("onnx") || detectors.includes("openvino")) format = "onnx";
81768
+ else if (detectors.includes("edgetpu")) format = "tflite";
81769
+ else if (detectors.length === 0) {
81770
+ const fallback = familyDefaultArtifact(type);
81771
+ if (fallback === null) throw new UnsupportedPlusDecodeError(type, "(default)", detectors);
81772
+ format = fallback;
81773
+ } else throw new UnsupportedPlusDecodeError(type, "(detectors)", detectors);
81774
+ const decode = matrixDecode(type, format);
81775
+ if (decode === null) throw new UnsupportedPlusDecodeError(type, format, detectors);
81776
+ return decode;
81777
+ }
81778
+ //#endregion
81606
81779
  //#region src/frigate/frigate-plus.ts
81607
81780
  /**
81608
81781
  * Frigate+ API client — the REAL api.frigate.video contract, verified against
@@ -81697,12 +81870,17 @@ function toModelInfo(raw, modelId) {
81697
81870
  if (isRecord(raw.labelMap)) {
81698
81871
  for (const [k, v] of Object.entries(raw.labelMap)) if (typeof v === "string") labelMap[k] = v;
81699
81872
  }
81873
+ const supportedDetectors = [];
81874
+ if (Array.isArray(raw.supportedDetectors)) {
81875
+ for (const d of raw.supportedDetectors) if (typeof d === "string") supportedDetectors.push(d);
81876
+ }
81700
81877
  return {
81701
81878
  id: typeof raw.id === "string" ? raw.id : modelId,
81702
81879
  type: typeof raw.type === "string" ? raw.type : "unknown",
81703
81880
  width: typeof raw.width === "number" ? raw.width : 320,
81704
81881
  height: typeof raw.height === "number" ? raw.height : 320,
81705
- labelMap
81882
+ labelMap,
81883
+ supportedDetectors
81706
81884
  };
81707
81885
  }
81708
81886
  /** Resolve one model's metadata + presigned artifact URL. */
@@ -81717,39 +81895,6 @@ async function requestPlusModelDownload(fetchFn, apiKey, plusModelId) {
81717
81895
  downloadUrl: url
81718
81896
  };
81719
81897
  }
81720
- /** Frigate+ model type → our format + decode. Mirrors the Frigate presets. */
81721
- var PLUS_TYPE_MAP = {
81722
- mobiledet: {
81723
- format: "tflite",
81724
- postprocessor: "ssd",
81725
- extension: ".tflite"
81726
- },
81727
- /** List API uses `ssd` for MobileDet rows. */
81728
- ssd: {
81729
- format: "tflite",
81730
- postprocessor: "ssd",
81731
- extension: ".tflite"
81732
- },
81733
- yolonas: {
81734
- format: "onnx",
81735
- postprocessor: "yolonas",
81736
- extension: ".onnx"
81737
- },
81738
- yolov9: {
81739
- format: "onnx",
81740
- extension: ".onnx"
81741
- },
81742
- "yolo-generic": {
81743
- format: "onnx",
81744
- extension: ".onnx"
81745
- }
81746
- };
81747
- function plusTypeTraits(type) {
81748
- return PLUS_TYPE_MAP[type] ?? {
81749
- format: "onnx",
81750
- extension: ".onnx"
81751
- };
81752
- }
81753
81898
  /** Ordered labels from the API's `index → label` map; holes keep alignment. */
81754
81899
  function orderedLabels(labelMap) {
81755
81900
  const indices = Object.keys(labelMap).map((k) => Number.parseInt(k, 10)).filter((n) => Number.isInteger(n) && n >= 0);
@@ -81766,16 +81911,7 @@ function orderedLabels(labelMap) {
81766
81911
  * Distribute.
81767
81912
  */
81768
81913
  function plusInfoToDescriptor(info, opts) {
81769
- const base = plusTypeTraits(info.type);
81770
- const traits = opts.format === "tflite" ? {
81771
- format: "tflite",
81772
- extension: ".tflite",
81773
- ...info.type === "ssd" || info.type === "mobiledet" ? { postprocessor: "ssd" } : {}
81774
- } : opts.format === "onnx" ? {
81775
- format: "onnx",
81776
- extension: ".onnx",
81777
- ...base.postprocessor !== void 0 ? { postprocessor: base.postprocessor } : {}
81778
- } : base;
81914
+ const decode = resolvePlusDecode(info, opts.format);
81779
81915
  const labels = orderedLabels(info.labelMap);
81780
81916
  return {
81781
81917
  stepId: "object-detection",
@@ -81783,7 +81919,7 @@ function plusInfoToDescriptor(info, opts) {
81783
81919
  id: opts.modelId,
81784
81920
  name: opts.name,
81785
81921
  description: `Frigate+ personal model (${info.type}) — imported via Model Studio`,
81786
- formats: { [traits.format]: {
81922
+ formats: { [decode.format]: {
81787
81923
  url: `camstack-local://${opts.modelId}/${opts.filename}`,
81788
81924
  sizeMB: opts.sizeMB,
81789
81925
  runtimes: ["python"]
@@ -81801,7 +81937,7 @@ function plusInfoToDescriptor(info, opts) {
81801
81937
  preprocessMode: "letterbox",
81802
81938
  provider: "frigate",
81803
81939
  group: frigateVariantGroup(info.type, info.width),
81804
- ...traits.postprocessor !== void 0 ? { postprocessor: traits.postprocessor } : {}
81940
+ postprocessor: decode.postprocessor
81805
81941
  }
81806
81942
  };
81807
81943
  }
@@ -82816,17 +82952,19 @@ var ModelStudioAddon = class ModelStudioAddon extends BaseAddon {
82816
82952
  const operatorName = optionalImportName(input.name);
82817
82953
  const key = this.config.frigatePlusApiKey ?? "";
82818
82954
  const { info, downloadUrl } = await requestPlusModelDownload(plusFetch, key, input.plusModelId);
82819
- const typeTraits = plusTypeTraits(info.type);
82820
- const traits = input.format === "tflite" ? {
82821
- format: "tflite",
82822
- extension: ".tflite",
82823
- ...info.type === "ssd" || info.type === "mobiledet" ? { postprocessor: "ssd" } : {}
82824
- } : input.format === "onnx" ? {
82825
- format: "onnx",
82826
- extension: ".onnx",
82827
- ...typeTraits.postprocessor !== void 0 ? { postprocessor: typeTraits.postprocessor } : {}
82828
- } : typeTraits;
82829
- const filename = `${modelId}${traits.extension}`;
82955
+ let decode;
82956
+ try {
82957
+ decode = resolvePlusDecode(info, input.format);
82958
+ } catch (err) {
82959
+ if (err instanceof UnsupportedPlusDecodeError) this.ctx.logger.warn("Frigate+ model import refused — no decoder", { meta: {
82960
+ plusModelId: input.plusModelId,
82961
+ type: err.type,
82962
+ format: err.format,
82963
+ detectors: [...err.detectors]
82964
+ } });
82965
+ throw err;
82966
+ }
82967
+ const filename = `${modelId}${decode.extension}`;
82830
82968
  const modelsDir = await this.resolveModelsDir();
82831
82969
  const destPath = node_path.default.join(modelsDir, filename);
82832
82970
  await (0, _camstack_system_addon_utils.downloadFile)(downloadUrl, destPath);
@@ -82848,7 +82986,7 @@ var ModelStudioAddon = class ModelStudioAddon extends BaseAddon {
82848
82986
  ...nameOriginOf(operatorName)
82849
82987
  });
82850
82988
  await this.availability_.update((prev) => upsertAvailability(prev, modelId, "hub", {
82851
- format: traits.format,
82989
+ format: decode.format,
82852
82990
  sha256,
82853
82991
  bytes,
82854
82992
  at: Date.now()
@@ -82858,11 +82996,11 @@ var ModelStudioAddon = class ModelStudioAddon extends BaseAddon {
82858
82996
  modelId,
82859
82997
  type: info.type,
82860
82998
  bytes,
82861
- format: traits.format
82999
+ format: decode.format
82862
83000
  } });
82863
83001
  const wanted = input.ensureFormats ?? [];
82864
83002
  let conversions = [];
82865
- if (traits.format === "onnx" && wanted.length > 0) {
83003
+ if (decode.format === "onnx" && wanted.length > 0) {
82866
83004
  conversions = (await ensureEngineFormats(descriptor.entry, this.plusConversionDeps(async () => (await requestPlusModelDownload(plusFetch, key, input.plusModelId)).downloadUrl, descriptor.stepId), { targetFormats: wanted })).conversions;
82867
83005
  this.ctx.logger.info("Frigate+ import — engine conversions", { meta: {
82868
83006
  modelId,