@camstack/types 1.2.307 → 1.2.309

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 (34) hide show
  1. package/dist/capabilities/custom-model-registry.cap.d.ts +38 -4
  2. package/dist/capabilities/device-manager.cap.d.ts +8 -8
  3. package/dist/capabilities/hub-address.d.ts +76 -0
  4. package/dist/capabilities/index.d.ts +4 -3
  5. package/dist/capabilities/local-network.cap.d.ts +93 -0
  6. package/dist/capabilities/model-convert.cap.d.ts +19 -2
  7. package/dist/capabilities/model-distributor.cap.d.ts +38 -4
  8. package/dist/capabilities/pipeline-executor.cap.d.ts +124 -10
  9. package/dist/capabilities/pipeline-runner.cap.d.ts +13 -0
  10. package/dist/catalogs/frigate-plus-classmap.d.ts +10 -7
  11. package/dist/catalogs/index.d.ts +1 -1
  12. package/dist/catalogs/root-model-supply.d.ts +202 -0
  13. package/dist/client.js +51 -49
  14. package/dist/client.mjs +51 -49
  15. package/dist/device/location-icon.d.ts +4 -4
  16. package/dist/device/site-zone.d.ts +2 -2
  17. package/dist/ffmpeg/pinned-spawn.d.ts +1 -1
  18. package/dist/generated/addon-api.d.ts +14 -0
  19. package/dist/generated/method-access-map.d.ts +1 -1
  20. package/dist/generated/system-proxy.d.ts +1 -1
  21. package/dist/index.d.ts +3 -1
  22. package/dist/index.js +1002 -512
  23. package/dist/index.mjs +970 -500
  24. package/dist/interfaces/event-bus.d.ts +12 -6
  25. package/dist/interfaces/pipeline-executor-capability.d.ts +6 -1
  26. package/dist/node.js +1 -1
  27. package/dist/node.mjs +1 -1
  28. package/dist/pipeline/removed-model-ids.d.ts +20 -0
  29. package/dist/pipeline/root-face-crop.d.ts +31 -0
  30. package/dist/types/detection.d.ts +9 -0
  31. package/dist/types/models.d.ts +69 -8
  32. package/dist/types/pipeline-step.d.ts +6 -0
  33. package/package.json +1 -1
  34. package/dist/catalogs/classifier-fill.d.ts +0 -104
@@ -4,6 +4,23 @@ import type { InferenceCapabilities, ModelAvailability } from '../interfaces/inf
4
4
  import type { AudioResult, FrameResult } from '../types/detection.js';
5
5
  import type { PipelineConfig } from '../types/pipeline.js';
6
6
  import { type InferProvider } from './capability-definition.js';
7
+ /**
8
+ * A root model's boxes standing in for one crop-kind step's own inference
9
+ * (D730) — see `runPipeline.suppliedRoot`.
10
+ */
11
+ export declare const SuppliedRootOutputSchema: z.ZodObject<{
12
+ stepId: z.ZodString;
13
+ modelId: z.ZodString;
14
+ detections: z.ZodArray<z.ZodObject<{
15
+ bbox: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
16
+ score: z.ZodNumber;
17
+ landmarks: z.ZodOptional<z.ZodArray<z.ZodObject<{
18
+ x: z.ZodNumber;
19
+ y: z.ZodNumber;
20
+ }, z.core.$strip>>>;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ export type SuppliedRootOutput = z.infer<typeof SuppliedRootOutputSchema>;
7
24
  /**
8
25
  * Reference to the frame's retained NATIVE surface + the parent crop's placement
9
26
  * within the frame, so the executor can re-cut a leaf child ROI at native
@@ -204,7 +221,8 @@ declare const PipelineModelOptionSchema: z.ZodObject<{
204
221
  scrypted: "scrypted";
205
222
  }>>;
206
223
  defaultConfidence: z.ZodOptional<z.ZodNumber>;
207
- fillsClassifierEffects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
224
+ suppliesSteps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
225
+ kind: z.ZodLiteral<"label">;
208
226
  stepId: z.ZodEnum<{
209
227
  "animal-classifier": "animal-classifier";
210
228
  "vehicle-classifier": "vehicle-classifier";
@@ -212,7 +230,23 @@ declare const PipelineModelOptionSchema: z.ZodObject<{
212
230
  }>;
213
231
  labelToEffect: z.ZodRecord<z.ZodString, z.ZodString>;
214
232
  uncovered: z.ZodReadonly<z.ZodArray<z.ZodString>>;
215
- }, z.core.$strip>>>>;
233
+ }, z.core.$strip>, z.ZodObject<{
234
+ kind: z.ZodLiteral<"crop">;
235
+ stepId: z.ZodEnum<{
236
+ "plate-detection": "plate-detection";
237
+ "face-detection": "face-detection";
238
+ }>;
239
+ rootLabels: z.ZodReadonly<z.ZodArray<z.ZodString>>;
240
+ parentMacro: z.ZodEnum<{
241
+ person: "person";
242
+ vehicle: "vehicle";
243
+ }>;
244
+ childClass: z.ZodEnum<{
245
+ face: "face";
246
+ plate: "plate";
247
+ }>;
248
+ rootInputPx: z.ZodOptional<z.ZodNumber>;
249
+ }, z.core.$strip>], "kind">>>>;
216
250
  }, z.core.$strip>;
217
251
  declare const PipelineAddonSchemaSchema: z.ZodObject<{
218
252
  id: z.ZodString;
@@ -261,7 +295,8 @@ declare const PipelineAddonSchemaSchema: z.ZodObject<{
261
295
  scrypted: "scrypted";
262
296
  }>>;
263
297
  defaultConfidence: z.ZodOptional<z.ZodNumber>;
264
- fillsClassifierEffects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
298
+ suppliesSteps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
299
+ kind: z.ZodLiteral<"label">;
265
300
  stepId: z.ZodEnum<{
266
301
  "animal-classifier": "animal-classifier";
267
302
  "vehicle-classifier": "vehicle-classifier";
@@ -269,7 +304,23 @@ declare const PipelineAddonSchemaSchema: z.ZodObject<{
269
304
  }>;
270
305
  labelToEffect: z.ZodRecord<z.ZodString, z.ZodString>;
271
306
  uncovered: z.ZodReadonly<z.ZodArray<z.ZodString>>;
272
- }, z.core.$strip>>>>;
307
+ }, z.core.$strip>, z.ZodObject<{
308
+ kind: z.ZodLiteral<"crop">;
309
+ stepId: z.ZodEnum<{
310
+ "plate-detection": "plate-detection";
311
+ "face-detection": "face-detection";
312
+ }>;
313
+ rootLabels: z.ZodReadonly<z.ZodArray<z.ZodString>>;
314
+ parentMacro: z.ZodEnum<{
315
+ person: "person";
316
+ vehicle: "vehicle";
317
+ }>;
318
+ childClass: z.ZodEnum<{
319
+ face: "face";
320
+ plate: "plate";
321
+ }>;
322
+ rootInputPx: z.ZodOptional<z.ZodNumber>;
323
+ }, z.core.$strip>], "kind">>>>;
273
324
  }, z.core.$strip>>>;
274
325
  defaultModelId: z.ZodString;
275
326
  defaultModelIdByFormat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -343,7 +394,8 @@ declare const PipelineSlotSchemaSchema: z.ZodObject<{
343
394
  scrypted: "scrypted";
344
395
  }>>;
345
396
  defaultConfidence: z.ZodOptional<z.ZodNumber>;
346
- fillsClassifierEffects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
397
+ suppliesSteps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
398
+ kind: z.ZodLiteral<"label">;
347
399
  stepId: z.ZodEnum<{
348
400
  "animal-classifier": "animal-classifier";
349
401
  "vehicle-classifier": "vehicle-classifier";
@@ -351,7 +403,23 @@ declare const PipelineSlotSchemaSchema: z.ZodObject<{
351
403
  }>;
352
404
  labelToEffect: z.ZodRecord<z.ZodString, z.ZodString>;
353
405
  uncovered: z.ZodReadonly<z.ZodArray<z.ZodString>>;
354
- }, z.core.$strip>>>>;
406
+ }, z.core.$strip>, z.ZodObject<{
407
+ kind: z.ZodLiteral<"crop">;
408
+ stepId: z.ZodEnum<{
409
+ "plate-detection": "plate-detection";
410
+ "face-detection": "face-detection";
411
+ }>;
412
+ rootLabels: z.ZodReadonly<z.ZodArray<z.ZodString>>;
413
+ parentMacro: z.ZodEnum<{
414
+ person: "person";
415
+ vehicle: "vehicle";
416
+ }>;
417
+ childClass: z.ZodEnum<{
418
+ face: "face";
419
+ plate: "plate";
420
+ }>;
421
+ rootInputPx: z.ZodOptional<z.ZodNumber>;
422
+ }, z.core.$strip>], "kind">>>>;
355
423
  }, z.core.$strip>>>;
356
424
  defaultModelId: z.ZodString;
357
425
  defaultModelIdByFormat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -461,7 +529,8 @@ declare const PipelineSchemaSchema: z.ZodObject<{
461
529
  scrypted: "scrypted";
462
530
  }>>;
463
531
  defaultConfidence: z.ZodOptional<z.ZodNumber>;
464
- fillsClassifierEffects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
532
+ suppliesSteps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
533
+ kind: z.ZodLiteral<"label">;
465
534
  stepId: z.ZodEnum<{
466
535
  "animal-classifier": "animal-classifier";
467
536
  "vehicle-classifier": "vehicle-classifier";
@@ -469,7 +538,23 @@ declare const PipelineSchemaSchema: z.ZodObject<{
469
538
  }>;
470
539
  labelToEffect: z.ZodRecord<z.ZodString, z.ZodString>;
471
540
  uncovered: z.ZodReadonly<z.ZodArray<z.ZodString>>;
472
- }, z.core.$strip>>>>;
541
+ }, z.core.$strip>, z.ZodObject<{
542
+ kind: z.ZodLiteral<"crop">;
543
+ stepId: z.ZodEnum<{
544
+ "plate-detection": "plate-detection";
545
+ "face-detection": "face-detection";
546
+ }>;
547
+ rootLabels: z.ZodReadonly<z.ZodArray<z.ZodString>>;
548
+ parentMacro: z.ZodEnum<{
549
+ person: "person";
550
+ vehicle: "vehicle";
551
+ }>;
552
+ childClass: z.ZodEnum<{
553
+ face: "face";
554
+ plate: "plate";
555
+ }>;
556
+ rootInputPx: z.ZodOptional<z.ZodNumber>;
557
+ }, z.core.$strip>], "kind">>>>;
473
558
  }, z.core.$strip>>>;
474
559
  defaultModelId: z.ZodString;
475
560
  defaultModelIdByFormat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -825,7 +910,8 @@ export declare const pipelineExecutorCapability: {
825
910
  scrypted: "scrypted";
826
911
  }>>;
827
912
  defaultConfidence: z.ZodOptional<z.ZodNumber>;
828
- fillsClassifierEffects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
913
+ suppliesSteps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
914
+ kind: z.ZodLiteral<"label">;
829
915
  stepId: z.ZodEnum<{
830
916
  "animal-classifier": "animal-classifier";
831
917
  "vehicle-classifier": "vehicle-classifier";
@@ -833,7 +919,23 @@ export declare const pipelineExecutorCapability: {
833
919
  }>;
834
920
  labelToEffect: z.ZodRecord<z.ZodString, z.ZodString>;
835
921
  uncovered: z.ZodReadonly<z.ZodArray<z.ZodString>>;
836
- }, z.core.$strip>>>>;
922
+ }, z.core.$strip>, z.ZodObject<{
923
+ kind: z.ZodLiteral<"crop">;
924
+ stepId: z.ZodEnum<{
925
+ "plate-detection": "plate-detection";
926
+ "face-detection": "face-detection";
927
+ }>;
928
+ rootLabels: z.ZodReadonly<z.ZodArray<z.ZodString>>;
929
+ parentMacro: z.ZodEnum<{
930
+ person: "person";
931
+ vehicle: "vehicle";
932
+ }>;
933
+ childClass: z.ZodEnum<{
934
+ face: "face";
935
+ plate: "plate";
936
+ }>;
937
+ rootInputPx: z.ZodOptional<z.ZodNumber>;
938
+ }, z.core.$strip>], "kind">>>>;
837
939
  }, z.core.$strip>>>;
838
940
  defaultModelId: z.ZodString;
839
941
  defaultModelIdByFormat: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1113,6 +1215,18 @@ export declare const pipelineExecutorCapability: {
1113
1215
  }, z.core.$strip>;
1114
1216
  }, z.core.$strip>>;
1115
1217
  replay: z.ZodOptional<z.ZodLiteral<true>>;
1218
+ suppliedRoot: z.ZodOptional<z.ZodObject<{
1219
+ stepId: z.ZodString;
1220
+ modelId: z.ZodString;
1221
+ detections: z.ZodArray<z.ZodObject<{
1222
+ bbox: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
1223
+ score: z.ZodNumber;
1224
+ landmarks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1225
+ x: z.ZodNumber;
1226
+ y: z.ZodNumber;
1227
+ }, z.core.$strip>>>;
1228
+ }, z.core.$strip>>;
1229
+ }, z.core.$strip>>;
1116
1230
  }, z.core.$strip>, z.ZodCustom<FrameResult, FrameResult>, "mutation">;
1117
1231
  /**
1118
1232
  * Batched run — N raw frames packed into one cap call. The provider
@@ -1085,6 +1085,19 @@ export declare const pipelineRunnerCapability: {
1085
1085
  className: z.ZodString;
1086
1086
  }, z.core.$strip>;
1087
1087
  steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
1088
+ supplied: z.ZodOptional<z.ZodObject<{
1089
+ stepId: z.ZodString;
1090
+ modelId: z.ZodString;
1091
+ boxes: z.ZodArray<z.ZodObject<{
1092
+ bbox: z.ZodObject<{
1093
+ x: z.ZodNumber;
1094
+ y: z.ZodNumber;
1095
+ w: z.ZodNumber;
1096
+ h: z.ZodNumber;
1097
+ }, z.core.$strip>;
1098
+ score: z.ZodNumber;
1099
+ }, z.core.$strip>>;
1100
+ }, z.core.$strip>>;
1088
1101
  }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
1089
1102
  details: z.ZodArray<z.ZodObject<{
1090
1103
  stepId: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import { CLASS_MAP_MACRO_TARGETS, type DetectionCatalogClassMap } from '../types/labels.js';
2
- import { type ClassifierFillDeclaration } from './classifier-fill.js';
2
+ import type { RootStepSupply } from '../types/models.js';
3
3
  /** A macro a detection catalog classMap may resolve to. */
4
4
  export type ClassMapMacroTarget = (typeof CLASS_MAP_MACRO_TARGETS)[number];
5
5
  /**
@@ -22,7 +22,9 @@ export declare const FRIGATE_PLUS_TO_MACRO: Readonly<Record<string, ClassMapMacr
22
22
  * - `attribute`: Frigate+ emits these INSIDE a parent box (a face inside a
23
23
  * person, a plate or a carrier logo on a vehicle). Mapping one to its
24
24
  * parent's macro would spawn a second, overlapping track for the same
25
- * subject; CamStack derives faces and plates with its own detail steps.
25
+ * subject. `face` and `license_plate` are instead declared as CROP supplies
26
+ * (D730): the box becomes a detail child of the person / vehicle containing
27
+ * it, when the face / plate step uses the root model.
26
28
  * - `no-macro`: an object with no detection macro to live under.
27
29
  */
28
30
  export declare const FRIGATE_PLUS_UNMAPPED_LABELS: Readonly<Record<string, 'attribute' | 'no-macro'>>;
@@ -38,12 +40,13 @@ export declare function buildFrigateClassMap(labels: readonly string[]): Detecti
38
40
  /** The label-derived fields of a Frigate catalog entry. */
39
41
  export interface FrigateLabelFields {
40
42
  readonly classMap: DetectionCatalogClassMap;
41
- readonly fillsClassifierEffects?: readonly ClassifierFillDeclaration[];
43
+ readonly suppliesSteps?: readonly RootStepSupply[];
42
44
  }
43
45
  /**
44
- * Everything a Frigate / Frigate+ entry derives from its labelmap: the classMap
45
- * and the steps it fills (D715). Every Frigate builder spreads this, so the two
46
- * cannot be derived from different label lists. A COCO labelmap gets its map
47
- * and no fill.
46
+ * Everything a Frigate / Frigate+ entry derives from ITS OWN labelmap: the
47
+ * classMap and the steps it can supply (D730) — label and crop kinds alike.
48
+ * Every Frigate builder spreads this at import, so the two cannot be derived
49
+ * from different label lists, and no family is assumed to carry a label it
50
+ * does not list.
48
51
  */
49
52
  export declare function frigateLabelFields(labels: readonly string[]): FrigateLabelFields;
@@ -1,6 +1,6 @@
1
1
  export * from './coco-classmap.js';
2
2
  export * from './frigate-plus-classmap.js';
3
- export * from './classifier-fill.js';
3
+ export * from './root-model-supply.js';
4
4
  export * from './sensor-active-state.js';
5
5
  export * from './audio-classmap.js';
6
6
  export * from './event-taxonomy.js';
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Root-model supply — the ONE place that says which pipeline steps a root
3
+ * detector can supply from its own output, how, and whether the camera uses it.
4
+ *
5
+ * A root detector's labels can already be the effect a step exists to produce:
6
+ * a Frigate+ model emits `deer`, `car`, `package`, a COCO model emits `dog`,
7
+ * `bus`. Some also emit the CHILD boxes a detail step exists to find: a
8
+ * Frigate+ `license_plate` inside a car, a `face` inside a person. Every root
9
+ * model DECLARES what it can supply (`ModelCatalogEntry.suppliesSteps`),
10
+ * derived from its own labelmap and classMap by {@link deriveRootSupplies} —
11
+ * never assumed per family. Whether a camera USES that is the step's own
12
+ * `useRootModel` flag, an operator intent kept beside the step's `modelId`
13
+ * and never touching it (D730). {@link resolveRootSupply} is the one decision
14
+ * the runner, the detail dispatcher and the admin UI all read.
15
+ *
16
+ * Two kinds of supply:
17
+ * - `label` — the root's raw class IS the step's answer (`deer` for the animal
18
+ * classifier). The detection carries it as a linked label.
19
+ * - `crop` — the root draws the box the step would have found (a plate inside
20
+ * a vehicle). The box becomes a detail child of the parent that contains it,
21
+ * never a track of its own (D683).
22
+ *
23
+ * Pure — no I/O, no clock.
24
+ */
25
+ import type { ModelCatalogEntry, RootStepSupply } from '../types/models.js';
26
+ /** Steps whose effect a root label can BE. */
27
+ export declare const LABEL_SUPPLY_STEP_IDS: readonly ["animal-classifier", "vehicle-classifier", "package-detection"];
28
+ export type LabelSupplyStepId = (typeof LABEL_SUPPLY_STEP_IDS)[number];
29
+ /** Steps whose box a root detection can BE. */
30
+ export declare const CROP_SUPPLY_STEP_IDS: readonly ["plate-detection", "face-detection"];
31
+ export type CropSupplyStepId = (typeof CROP_SUPPLY_STEP_IDS)[number];
32
+ /** Every step a root model can supply. */
33
+ export declare const ROOT_SUPPLIABLE_STEP_IDS: readonly ["animal-classifier", "vehicle-classifier", "package-detection", "plate-detection", "face-detection"];
34
+ export type RootSuppliableStepId = LabelSupplyStepId | CropSupplyStepId;
35
+ /** Narrow a step id to a suppliable one — type guard, not a cast. */
36
+ export declare function isRootSuppliableStepId(value: string): value is RootSuppliableStepId;
37
+ /** Narrow a step id to a label-kind one. */
38
+ export declare function isLabelSupplyStepId(value: string): value is LabelSupplyStepId;
39
+ /**
40
+ * The EFFECT vocabulary of each label-kind step: exactly the strings the step
41
+ * itself emits, in its own spelling. A linked label is one of these and nothing
42
+ * else, so a tier-1 value means the same thing whichever writer produced it.
43
+ *
44
+ * - `animal-classifier`: the PRIMARY model's `-labels.json` (Open Images V7,
45
+ * 8 classes) — also the species allow-list the step offers.
46
+ * - `vehicle-classifier`: the classifier's labels, capitalised as it emits them
47
+ * (it writes `winner.class` verbatim).
48
+ * - `package-detection`: its one output class.
49
+ *
50
+ * `scripts/check-label-link-vocabulary.ts` fails the build if a declared
51
+ * `labelToEffect` names anything outside this table.
52
+ */
53
+ export declare const LABEL_SUPPLY_VOCABULARIES: Readonly<Record<LabelSupplyStepId, readonly string[]>>;
54
+ /** The macro a detection must carry for a label-kind step to apply to it. */
55
+ export declare const LABEL_SUPPLY_MACRO: Readonly<Record<LabelSupplyStepId, string>>;
56
+ /** What a crop-kind supply is made of. */
57
+ export interface CropSupplySource {
58
+ /** Raw root labels that ARE this step's box. */
59
+ readonly rootLabels: readonly string[];
60
+ /** The macro of the parent the box must lie inside. */
61
+ readonly parentMacro: 'vehicle' | 'person';
62
+ /** The detail class the box becomes. */
63
+ readonly childClass: 'plate' | 'face';
64
+ /**
65
+ * The step's own children that still run on the root's box: `plate-ocr`
66
+ * reads a root plate, `face-embedding` embeds a refined root face.
67
+ */
68
+ readonly servedChildSteps: readonly string[];
69
+ /**
70
+ * How the root's box stands in for the step's inference.
71
+ * - `as-output`: the box IS the step's output (a plate box goes straight to
72
+ * the reader).
73
+ * - `refine`: the box is only a LOCATION. The step's own detector re-finds
74
+ * the subject inside a square around it (`deriveRootFaceRefineRect`) so
75
+ * its children get what they need — a face's landmarks — and nothing
76
+ * unaligned ever reaches the embedder. No face found ⇒ nothing.
77
+ */
78
+ readonly use: 'as-output' | 'refine';
79
+ /**
80
+ * The root's smallest input side for the supply to be in force. A root that
81
+ * sees the frame smaller than this misses too many of these boxes to be the
82
+ * source (a 320 px root loses ~60% of the faces a 640 one finds on 4K
83
+ * cameras). Absent ⇒ any root.
84
+ */
85
+ readonly minRootInputPx?: number;
86
+ }
87
+ export declare const CROP_SUPPLY_SOURCES: Readonly<Record<CropSupplyStepId, CropSupplySource>>;
88
+ /**
89
+ * Whether an operator intends a step to take the root's output when the
90
+ * root declares it — the default of the `useRootModel` flag. The label kinds
91
+ * default ON: the detector's answer is the cheaper one and the classifier
92
+ * keeps its model for the day the root changes. The crop kinds default OFF: a
93
+ * root plate box has an uncalibrated OCR margin, and root-face refinement has
94
+ * not run on live traffic yet.
95
+ */
96
+ export declare const USE_ROOT_MODEL_DEFAULTS: Readonly<Record<RootSuppliableStepId, boolean>>;
97
+ /** The step-settings key the flag is stored under (DeviceStepConfig.settings, camera overrides). */
98
+ export declare const USE_ROOT_MODEL_SETTING_KEY = "useRootModel";
99
+ /** `ScoredLabel.stepId` prefix of a label the detector wrote for a step. */
100
+ export declare const LINKED_LABEL_STEP_PREFIX = "detector-link:";
101
+ /** `detector-link:<stepId>` — the attribution of a linked label. */
102
+ export declare function linkedLabelStepId(stepId: LabelSupplyStepId): string;
103
+ /** The step a linked label stands in for, or `undefined` for any other attribution. */
104
+ export declare function linkedStepOf(attributionStepId: string | undefined): LabelSupplyStepId | undefined;
105
+ /** The classMap shape the derivation reads. */
106
+ export interface SupplyClassMap {
107
+ readonly mapping: Readonly<Record<string, string>>;
108
+ }
109
+ /**
110
+ * Which steps a root detector can supply, from its labelmap and classMap.
111
+ *
112
+ * - label kind: a label counts for a step only when the classMap sends it to
113
+ * that step's macro AND it names a vocabulary entry. Every root is judged
114
+ * the same way — a COCO model supplies the animal classifier with the six
115
+ * species COCO names, exactly as a Frigate+ model supplies seven.
116
+ * - crop kind: the labelmap carries one of the step's root labels. Those
117
+ * labels are deliberately left out of the classMap, so they never make a
118
+ * track of their own.
119
+ *
120
+ * No classMap ⇒ no label supply (nothing says which macro a label lives under).
121
+ */
122
+ export declare function deriveRootSupplies(labels: readonly string[], classMap: SupplyClassMap | undefined): readonly RootStepSupply[];
123
+ /** What a step definition contributes when a model entry carries no labels/classMap of its own. */
124
+ export interface RootSupplyStepDefaults {
125
+ readonly labels: readonly string[];
126
+ readonly classMap?: SupplyClassMap;
127
+ }
128
+ /**
129
+ * The supplies a root model declares. A row registered with a declaration
130
+ * carries it (`suppliesSteps`, computed at import from the model's own
131
+ * labelmap); a row without one — a built-in entry, or a custom row registered
132
+ * before the field existed — is derived here, on read, from the same inputs.
133
+ */
134
+ export declare function rootSuppliesOf(entry: Pick<ModelCatalogEntry, 'labels' | 'classMap' | 'suppliesSteps' | 'inputSize'> | undefined, stepDefaults: RootSupplyStepDefaults): readonly RootStepSupply[];
135
+ /** The supply a root declares for one step, if any. */
136
+ export declare function supplyFor(supplies: readonly RootStepSupply[] | undefined, stepId: string): RootStepSupply | undefined;
137
+ /**
138
+ * Read the `useRootModel` flag off a step's settings bag. Absent ⇒ the
139
+ * retired `labelLink` value if one is stored, else the step's default.
140
+ */
141
+ export declare function readUseRootModel(stepId: RootSuppliableStepId, settings: Readonly<Record<string, unknown>> | undefined): boolean;
142
+ /** One step's root-supply state for one camera (or one node/device column). */
143
+ export interface RootSupplyState {
144
+ readonly stepId: RootSuppliableStepId;
145
+ /** What the current root declares for this step, if anything. */
146
+ readonly supply: RootStepSupply | undefined;
147
+ /** The operator's `useRootModel` intent (stored or default). */
148
+ readonly intent: boolean;
149
+ /**
150
+ * The root's output IS this step's result: the step's own inference does
151
+ * not run and the root's linked label / child box is authoritative.
152
+ * `intent && supply && nothing blocks it`.
153
+ */
154
+ readonly effective: boolean;
155
+ /** Intent is on but the current root cannot supply the step. */
156
+ readonly inactive: boolean;
157
+ /** Why an intended supply is not in force — present iff `inactive`. */
158
+ readonly inactiveReason?: RootSupplyInactiveReason;
159
+ }
160
+ /**
161
+ * Why an intended root supply is not in force.
162
+ * - `root-does-not-declare`: the root's labels cannot supply the step.
163
+ * - `root-input-too-small`: they can, but the root sees the frame smaller than
164
+ * the step's `minRootInputPx` (or its input size is unknown).
165
+ */
166
+ export type RootSupplyInactiveReason = 'root-does-not-declare' | 'root-input-too-small';
167
+ /**
168
+ * THE decision. Effective = the operator intends it AND the current root
169
+ * declares it. It never looks at, changes or clears the step's `modelId`: a
170
+ * root that cannot supply the step leaves the step running its own model, and
171
+ * switching back to a root that can re-activates the supply by itself.
172
+ */
173
+ export declare function resolveRootSupply(stepId: RootSuppliableStepId, settings: Readonly<Record<string, unknown>> | undefined, rootSupplies: readonly RootStepSupply[] | undefined): RootSupplyState;
174
+ /**
175
+ * The fine label a supplied root class becomes for a step whose supply is
176
+ * effective, or `undefined` when the step's `enabledClasses` switched it off —
177
+ * the detection then stays at its macro (`animal`). Empty / absent allow-list
178
+ * = every class.
179
+ */
180
+ export declare function allowedSuppliedEffect(effect: string, settings: Readonly<Record<string, unknown>> | undefined): boolean;
181
+ /** The child steps of a crop-kind step that still run on the root's box. */
182
+ export declare function rootSupplyServes(stepId: CropSupplyStepId): readonly string[];
183
+ /** Minimum fraction of a child box's area that must lie inside its parent. */
184
+ export declare const ROOT_CHILD_CONTAINMENT_MIN = 0.9;
185
+ /** An axis-aligned box in one pixel space. */
186
+ export interface SupplyBox {
187
+ readonly x: number;
188
+ readonly y: number;
189
+ readonly w: number;
190
+ readonly h: number;
191
+ }
192
+ /**
193
+ * The parent a root child box belongs to: among `parents`, the SMALLEST whose
194
+ * box holds at least {@link ROOT_CHILD_CONTAINMENT_MIN} of the child's area
195
+ * (a plate inside the car, not inside the bus behind it). `-1` when none does
196
+ * — the box then belongs to nobody and makes nothing.
197
+ */
198
+ export declare function containingParentIndex(child: SupplyBox, parents: readonly SupplyBox[]): number;
199
+ /** One short phrase per supply — `animals 6/8`, `plates`. */
200
+ export declare function describeRootSupply(supply: RootStepSupply): string;
201
+ /** `animals 6/8 · vehicles 5/8 · plates · faces` — empty string for none. */
202
+ export declare function describeRootSupplies(supplies: readonly RootStepSupply[] | undefined): string;
package/dist/client.js CHANGED
@@ -415,54 +415,6 @@ zod.z.object({
415
415
  resolution: CamStreamResolutionSchema.optional()
416
416
  });
417
417
  //#endregion
418
- //#region src/catalogs/coco-classmap.ts
419
- var MACRO_LABELS = [
420
- {
421
- id: "person",
422
- name: "Person"
423
- },
424
- {
425
- id: "vehicle",
426
- name: "Vehicle"
427
- },
428
- {
429
- id: "animal",
430
- name: "Animal"
431
- },
432
- {
433
- id: "package",
434
- name: "Package"
435
- }
436
- ];
437
- new Set(MACRO_LABELS.map((l) => l.id));
438
- var COCO_TO_MACRO = {
439
- mapping: {
440
- person: "person",
441
- bicycle: "vehicle",
442
- car: "vehicle",
443
- motorcycle: "vehicle",
444
- airplane: "vehicle",
445
- bus: "vehicle",
446
- train: "vehicle",
447
- truck: "vehicle",
448
- boat: "vehicle",
449
- bird: "animal",
450
- cat: "animal",
451
- dog: "animal",
452
- horse: "animal",
453
- sheep: "animal",
454
- cow: "animal",
455
- elephant: "animal",
456
- bear: "animal",
457
- zebra: "animal",
458
- giraffe: "animal",
459
- suitcase: "package",
460
- backpack: "package",
461
- handbag: "package"
462
- },
463
- preserveOriginal: false
464
- };
465
- //#endregion
466
418
  //#region src/catalogs/sensor-active-state.ts
467
419
  /**
468
420
  * THE table "which boolean of this device type counts as HIGH", and the
@@ -1044,6 +996,54 @@ method(zod.z.object({}), zod.z.array(TargetKindSchema)), method(zod.z.object({})
1044
996
  auth: "admin"
1045
997
  });
1046
998
  //#endregion
999
+ //#region src/catalogs/coco-classmap.ts
1000
+ var MACRO_LABELS = [
1001
+ {
1002
+ id: "person",
1003
+ name: "Person"
1004
+ },
1005
+ {
1006
+ id: "vehicle",
1007
+ name: "Vehicle"
1008
+ },
1009
+ {
1010
+ id: "animal",
1011
+ name: "Animal"
1012
+ },
1013
+ {
1014
+ id: "package",
1015
+ name: "Package"
1016
+ }
1017
+ ];
1018
+ new Set(MACRO_LABELS.map((l) => l.id));
1019
+ var COCO_TO_MACRO = {
1020
+ mapping: {
1021
+ person: "person",
1022
+ bicycle: "vehicle",
1023
+ car: "vehicle",
1024
+ motorcycle: "vehicle",
1025
+ airplane: "vehicle",
1026
+ bus: "vehicle",
1027
+ train: "vehicle",
1028
+ truck: "vehicle",
1029
+ boat: "vehicle",
1030
+ bird: "animal",
1031
+ cat: "animal",
1032
+ dog: "animal",
1033
+ horse: "animal",
1034
+ sheep: "animal",
1035
+ cow: "animal",
1036
+ elephant: "animal",
1037
+ bear: "animal",
1038
+ zebra: "animal",
1039
+ giraffe: "animal",
1040
+ suitcase: "package",
1041
+ backpack: "package",
1042
+ handbag: "package"
1043
+ },
1044
+ preserveOriginal: false
1045
+ };
1046
+ //#endregion
1047
1047
  //#region src/catalogs/audio-classmap.ts
1048
1048
  var AUDIO_MACRO_LABELS = [
1049
1049
  {
@@ -7305,6 +7305,8 @@ function createSystemProxy(api) {
7305
7305
  setNotificationEndpoint: (input) => dispatch("localNetwork", "setNotificationEndpoint", "mutation", input),
7306
7306
  getViewerEndpoints: (input) => dispatch("localNetwork", "getViewerEndpoints", "query", input),
7307
7307
  setViewerEndpoints: (input) => dispatch("localNetwork", "setViewerEndpoints", "mutation", input),
7308
+ getHubAddresses: (input) => dispatch("localNetwork", "getHubAddresses", "query", input),
7309
+ setHubAddress: (input) => dispatch("localNetwork", "setHubAddress", "mutation", input),
7308
7310
  getAllowedAddresses: (input) => dispatch("localNetwork", "getAllowedAddresses", "query", input),
7309
7311
  setAllowedAddresses: (input) => dispatch("localNetwork", "setAllowedAddresses", "mutation", input),
7310
7312
  resetAllowlistToBestMatch: (input) => dispatch("localNetwork", "resetAllowlistToBestMatch", "mutation", input),
@@ -9068,7 +9070,7 @@ var STATE_SUMMARY_VARS = [
9068
9070
  {
9069
9071
  name: "summarySection",
9070
9072
  label: "Summary: this section",
9071
- description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
9073
+ description: "The section a per-section summary row is about; on a summary sent as one message, every section it reports, comma-separated.",
9072
9074
  example: "Batterie scariche",
9073
9075
  group: "system",
9074
9076
  families: ["rule"],