@camstack/types 1.2.43 → 1.2.45

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 (38) hide show
  1. package/dist/addon.js +8 -2
  2. package/dist/addon.mjs +8 -2
  3. package/dist/capabilities/index.d.ts +21 -3
  4. package/dist/capabilities/osd-manager.cap.d.ts +900 -0
  5. package/dist/capabilities/pipeline-analytics.cap.d.ts +1192 -74
  6. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +10 -0
  7. package/dist/capabilities/pipeline-runner.cap.d.ts +6 -0
  8. package/dist/capabilities/schemas/streaming-shared.d.ts +2 -0
  9. package/dist/capabilities/server-management.cap.d.ts +3 -3
  10. package/dist/capabilities/stream-broker.cap.d.ts +32 -0
  11. package/dist/ffmpeg/fmp4-box-splitter.d.ts +113 -0
  12. package/dist/ffmpeg/fmp4-fragment-child.d.ts +85 -0
  13. package/dist/ffmpeg/fmp4-fragment-plane.d.ts +142 -0
  14. package/dist/ffmpeg/invocation.d.ts +4 -2
  15. package/dist/fmp4-box-splitter-B53u9-Nu.mjs +615 -0
  16. package/dist/fmp4-box-splitter-BkWH7O3L.js +686 -0
  17. package/dist/generated/addon-api.d.ts +162 -0
  18. package/dist/generated/cap-input-defaults.d.ts +1 -1
  19. package/dist/generated/capability-router-map.d.ts +5 -2
  20. package/dist/generated/device-proxy.d.ts +3 -1
  21. package/dist/generated/method-access-map.d.ts +1 -1
  22. package/dist/generated/system-proxy.d.ts +2 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +1114 -407
  25. package/dist/index.mjs +1075 -397
  26. package/dist/interfaces/camera-switches.d.ts +48 -0
  27. package/dist/interfaces/stream-broker.d.ts +19 -49
  28. package/dist/node.d.ts +4 -0
  29. package/dist/node.js +509 -3
  30. package/dist/node.mjs +507 -3
  31. package/dist/notification/schedule.d.ts +20 -0
  32. package/dist/{sleep-Bx9IIoT0.js → sleep-BOI-sVEA.js} +37 -1
  33. package/dist/{sleep-DtstvzWm.mjs → sleep-Bf5fBs7u.mjs} +37 -1
  34. package/dist/types/detection.d.ts +31 -0
  35. package/dist/types/pipeline-step.d.ts +22 -1
  36. package/package.json +1 -1
  37. package/dist/canonical-hash-7nfBbEqR.mjs +0 -35
  38. package/dist/canonical-hash-BcZHRHIx.js +0 -40
@@ -70,6 +70,24 @@ export interface ScoredLabel {
70
70
  * that carries it.
71
71
  */
72
72
  readonly detectionId?: string;
73
+ /**
74
+ * WHICH label slot this text may occupy on a track / ObjectEvent, copied
75
+ * VERBATIM from the producing step's `StepDefinition.labelTier` (roadmap
76
+ * 4g). 1 = sub-class (`dog`), 2 = instance (`Turdus migratorius`, `Alice`,
77
+ * a plate read).
78
+ *
79
+ * Absent means the producing step declares no tier — an internal marker
80
+ * (`embedding:512d`), or a step that was never given a declaration. The
81
+ * persistence write rule REFUSES an undeclared label rather than inferring
82
+ * a tier from the text or the step name, and says so in the log. Inheriting
83
+ * a label onto a parent copies the tier unchanged: the tier belongs to the
84
+ * step that decided the text, not to the entry that carries it.
85
+ */
86
+ readonly tier?: 1 | 2;
87
+ /** Step that decided this text — the tier's attribution. */
88
+ readonly stepId?: string;
89
+ /** Model that decided this text — the tier's attribution. */
90
+ readonly modelId?: string;
73
91
  }
74
92
  /** What kind of entry a detection is at the root of `detections[]`. */
75
93
  export type DetectionKind = 'first-level' | 'detail' | 'audio';
@@ -110,6 +128,19 @@ export interface DetectionDebug {
110
128
  * mapped to `macroClass: 'animal'`).
111
129
  */
112
130
  readonly originalClass?: string;
131
+ /**
132
+ * The label tier {@link originalClass} may occupy, from the ROOT detector
133
+ * step's `StepDefinition.labelTier` (roadmap 4g). Ships in the same
134
+ * `verbosity: 'full'` bag as the value it qualifies, so it costs nothing
135
+ * where `originalClass` costs nothing.
136
+ *
137
+ * Without it the raw class is a label with no declared tier and the write
138
+ * rule refuses it — which is the correct outcome, because outside
139
+ * `verbosity: 'full'` the FrameProcessor substitutes `det.macroClass` for a
140
+ * missing `originalClass` and a tier guessed here would put a MACRO class in
141
+ * a label slot. That is the exact regression the 2026-08-07 rule refuses.
142
+ */
143
+ readonly originalClassTier?: 1 | 2;
113
144
  /**
114
145
  * Full top-N ranked alternatives per source (classifier / recognizer).
115
146
  * The winner of each list already appears in `detection.labels[]` —
@@ -12,7 +12,7 @@ export interface IPipelineStep {
12
12
  readonly definition: StepDefinition;
13
13
  getConfigSchema(): readonly ConfigField[];
14
14
  }
15
- export type PostprocessorType = 'yolo' | 'ssd' | 'yolo-seg' | 'scrfd' | 'arcface' | 'clip' | 'softmax' | 'ctc' | 'saliency' | 'yamnet';
15
+ export type PostprocessorType = 'yolo' | 'ssd' | 'rfdetr' | 'yolo-seg' | 'scrfd' | 'arcface' | 'clip' | 'softmax' | 'ctc' | 'saliency' | 'yamnet';
16
16
  export interface StepDefinition {
17
17
  /** Unique step identifier (e.g., 'object-detection', 'face-detection') */
18
18
  readonly id: string;
@@ -42,6 +42,27 @@ export interface StepDefinition {
42
42
  readonly inputClasses: readonly string[] | null;
43
43
  /** Classes this step outputs (e.g., ['person','vehicle','animal'] for YOLO) */
44
44
  readonly outputClasses: readonly string[];
45
+ /**
46
+ * WHICH label tier this step's answer occupies on a track / ObjectEvent
47
+ * (roadmap 4g). **Declared here and nowhere else** — a consumer never infers
48
+ * a tier from `outputClasses`, from the step id, or from the shape of the
49
+ * text. A step that produces a label and declares no tier has its answer
50
+ * REFUSED and logged, because a guess here is exactly how a species ends up
51
+ * in the coarse slot and blocks the sub-class that should have gone there.
52
+ *
53
+ * - `1` — a SUB-CLASS, finer than the macro class but still a taxonomy
54
+ * token: `animal-classifier` (`animal-type`), `vehicle-classifier`
55
+ * (`vehicle-type`), and `object-detection` itself (its raw class, when
56
+ * finer than the macro it maps to — `dog` under `animal`).
57
+ * - `2` — an INSTANCE, the finest thing sayable about this subject:
58
+ * `bird-classifier` (`species`), `face-embedding` (`identity`),
59
+ * `plate-ocr` (`plate-text`).
60
+ *
61
+ * Absent on a step that produces no label at all (a detector whose classes
62
+ * ARE macro classes, an embedder, a segmenter). Absence is not tier 0 — it
63
+ * means "this step never fills a label slot".
64
+ */
65
+ readonly labelTier?: 1 | 2;
45
66
  /** Available models for this step */
46
67
  readonly models: readonly ModelCatalogEntry[];
47
68
  /** Default model when no user preference is set */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.43",
3
+ "version": "1.2.45",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1,35 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- //#region src/utils/canonical-hash.ts
3
- /**
4
- * Deterministic SHA-256 hash of an arbitrary serialisable value. The
5
- * canonical form sorts object keys alphabetically at every depth so two
6
- * structurally-equal inputs with different key insertion orders produce
7
- * the same hash. Returns a 64-char lowercase hex digest.
8
- *
9
- * Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
10
- * accessory-rebuild work when the upstream shape is byte-identical to
11
- * the last applied state — preventing user-visible "re-discovery"
12
- * notifications on every addon-runner respawn. Each respawn re-fires
13
- * `DeviceBindingsChanged` for every cap registration, which without
14
- * this guard would propagate redundant pushes.
15
- *
16
- * Note: this is a SYMPTOMATIC fix layered on top of the binding-change
17
- * subscription. The proper fix is a single "device ready" lifecycle
18
- * barrier so exports react only when the full cap set has landed —
19
- * tracked separately for post-HA-integration work.
20
- */
21
- function canonicalHash(value) {
22
- const canonical = JSON.stringify(value, replaceWithSortedKeys);
23
- return createHash("sha256").update(canonical ?? "").digest("hex");
24
- }
25
- function replaceWithSortedKeys(_key, value) {
26
- if (value && typeof value === "object" && !Array.isArray(value)) {
27
- const obj = value;
28
- const out = {};
29
- for (const k of Object.keys(obj).toSorted()) out[k] = obj[k];
30
- return out;
31
- }
32
- return value;
33
- }
34
- //#endregion
35
- export { canonicalHash as t };
@@ -1,40 +0,0 @@
1
- let node_crypto = require("node:crypto");
2
- //#region src/utils/canonical-hash.ts
3
- /**
4
- * Deterministic SHA-256 hash of an arbitrary serialisable value. The
5
- * canonical form sorts object keys alphabetically at every depth so two
6
- * structurally-equal inputs with different key insertion orders produce
7
- * the same hash. Returns a 64-char lowercase hex digest.
8
- *
9
- * Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
10
- * accessory-rebuild work when the upstream shape is byte-identical to
11
- * the last applied state — preventing user-visible "re-discovery"
12
- * notifications on every addon-runner respawn. Each respawn re-fires
13
- * `DeviceBindingsChanged` for every cap registration, which without
14
- * this guard would propagate redundant pushes.
15
- *
16
- * Note: this is a SYMPTOMATIC fix layered on top of the binding-change
17
- * subscription. The proper fix is a single "device ready" lifecycle
18
- * barrier so exports react only when the full cap set has landed —
19
- * tracked separately for post-HA-integration work.
20
- */
21
- function canonicalHash(value) {
22
- const canonical = JSON.stringify(value, replaceWithSortedKeys);
23
- return (0, node_crypto.createHash)("sha256").update(canonical ?? "").digest("hex");
24
- }
25
- function replaceWithSortedKeys(_key, value) {
26
- if (value && typeof value === "object" && !Array.isArray(value)) {
27
- const obj = value;
28
- const out = {};
29
- for (const k of Object.keys(obj).toSorted()) out[k] = obj[k];
30
- return out;
31
- }
32
- return value;
33
- }
34
- //#endregion
35
- Object.defineProperty(exports, "canonicalHash", {
36
- enumerable: true,
37
- get: function() {
38
- return canonicalHash;
39
- }
40
- });