@camstack/addon-osd-manager 0.1.140 → 0.1.141

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-C80efbgF.mjs → MotionZonesSettings-DJKtseSs.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-CvVdYFwr.mjs → PrivacyMaskSettings-DGuTzxj8.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-CkIz3-13.mjs → SceneMonitorEditor-DmbBliPj.mjs} +3 -3
  4. package/dist/_stub.js +27 -27
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-DaUqGaKC.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-CFuJP8Er.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-3cAFRv9T.mjs +26 -0
  7. package/dist/addon-osd-manager.css +1 -1
  8. package/dist/{hostInit-Bkk-9STE.mjs → hostInit-CwuHzT6C.mjs} +2 -2
  9. package/dist/index.js +809 -189
  10. package/dist/index.mjs +809 -189
  11. package/dist/{player-overlays-CbLYEs-S.mjs → player-overlays-BeNrtbAl.mjs} +1 -1
  12. package/dist/remoteEntry.js +1 -1
  13. package/dist/{responsive-BghmipTp.mjs → responsive-CBuD1VHv.mjs} +1 -1
  14. package/dist/{scene-monitor-copy-Cpz17vjT.mjs → scene-monitor-copy-BzF_xKZH.mjs} +1 -1
  15. package/dist/{square-D-Qx_njd.mjs → square-Cz6wpss1.mjs} +1 -1
  16. package/dist/{trash-2-cC4gYobQ.mjs → trash-2-B9H3d-I8.mjs} +1 -1
  17. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-Dao979S_.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-vTWFpP59.mjs} +1 -1
  18. package/package.json +1 -1
  19. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DG3UFggb.mjs +0 -26
package/dist/index.js CHANGED
@@ -5363,7 +5363,7 @@ var ZodIssueCode = {
5363
5363
  var ZodFirstPartyTypeKind;
5364
5364
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5365
5365
  //#endregion
5366
- //#region ../types/dist/sleep-BaRu0bS5.mjs
5366
+ //#region ../types/dist/sleep-BXv0ZcRa.mjs
5367
5367
  /**
5368
5368
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5369
5369
  * window to float samples (D455).
@@ -6148,6 +6148,40 @@ var BaseAddon = class {
6148
6148
  const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6149
6149
  return keys.size > 0 ? projectStore(raw, keys, node) : raw;
6150
6150
  }
6151
+ /**
6152
+ * Whether ONE global key of this addon's store was written, read three-way
6153
+ * (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
6154
+ * reports `value ?? default`, so "the operator chose the default" and "nobody
6155
+ * chose" look the same, and a failed read looks like both. A `perNode` key is
6156
+ * not supported here: its stored name is scoped.
6157
+ */
6158
+ async readStoredGlobalKey(key) {
6159
+ const read = this._ctx?.settings?.readAddonStoreResult;
6160
+ if (read === void 0) return {
6161
+ kind: "unreadable",
6162
+ reason: "three-way-read-unavailable"
6163
+ };
6164
+ let result;
6165
+ try {
6166
+ result = await read.call(this._ctx?.settings);
6167
+ } catch (err) {
6168
+ return {
6169
+ kind: "unreadable",
6170
+ reason: "store-read-failed",
6171
+ error: err instanceof Error ? err.message : String(err)
6172
+ };
6173
+ }
6174
+ if (result.kind === "failed") return {
6175
+ kind: "unreadable",
6176
+ reason: "store-read-failed",
6177
+ error: result.error
6178
+ };
6179
+ if (result.kind === "missing" || !Object.prototype.hasOwnProperty.call(result.value, key)) return { kind: "absent" };
6180
+ return {
6181
+ kind: "present",
6182
+ value: result.value[key]
6183
+ };
6184
+ }
6151
6185
  async updateGlobalSettings(patch, nodeId) {
6152
6186
  const keys = this.perNodeKeys();
6153
6187
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
@@ -9502,6 +9536,43 @@ var LogChannelWindowSchema = object({
9502
9536
  /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9503
9537
  deviceIds: array(number().int()).readonly().nullable()
9504
9538
  });
9539
+ var ClipModelMetaSchema = object({
9540
+ /** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
9541
+ textModelId: string().min(1),
9542
+ /** Output dimension of BOTH towers. A vector of any other length is refused. */
9543
+ embeddingDim: number().int().positive(),
9544
+ /**
9545
+ * The `vector-store` index this model's vectors live in. ONE feature space
9546
+ * per index: two models share an index only when their vectors are ranked
9547
+ * against each other, which for CLIP means never across families. MobileCLIP
9548
+ * S1 and S2 share `object-clip` for history (separated by the row's
9549
+ * `modelId`); any other model gets its own.
9550
+ */
9551
+ vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
9552
+ /**
9553
+ * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
9554
+ * must be unique per tokenizer: every model's siblings land in ONE flat
9555
+ * models directory, so two different tokenizers under the same name would
9556
+ * silently overwrite each other (whichever model downloaded last wins, and
9557
+ * the other one tokenises with the wrong vocabulary).
9558
+ */
9559
+ tokenizerFile: string().min(1),
9560
+ /** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
9561
+ contextLength: number().int().positive(),
9562
+ /** Id the tokenizer pads with. */
9563
+ padId: number().int().nonnegative(),
9564
+ /**
9565
+ * The search cosine floor at `strictness: 'loose'` — calibrated per model,
9566
+ * because cosine bands are a property of the model: 0.2 keeps 96% of matched
9567
+ * COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
9568
+ */
9569
+ searchMinScore: number().min(0).max(1)
9570
+ });
9571
+ var ClipSearchStrictnessSchema = _enum([
9572
+ "loose",
9573
+ "balanced",
9574
+ "strict"
9575
+ ]);
9505
9576
  var MODEL_FORMATS = [
9506
9577
  "onnx",
9507
9578
  "coreml",
@@ -9705,7 +9776,14 @@ var ModelCatalogEntrySchema = object({
9705
9776
  * applies (Frigate / COCO public catalog). Set on a custom model whose raw
9706
9777
  * labels already ARE the CamStack macros (Scrypted identity map).
9707
9778
  */
9708
- classMap: DetectionCatalogClassMapSchema.optional()
9779
+ classMap: DetectionCatalogClassMapSchema.optional(),
9780
+ /**
9781
+ * The model's CLIP feature-space contract (text encoder, dimension, vector
9782
+ * index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
9783
+ * CLIP image encoder; its absence is what "not a CLIP model" means to the
9784
+ * embedding encoder and the semantic-search store (D649).
9785
+ */
9786
+ clip: ClipModelMetaSchema.optional()
9709
9787
  });
9710
9788
  var ConvertTargetSchema = discriminatedUnion("format", [object({
9711
9789
  format: literal("openvino"),
@@ -15307,6 +15385,28 @@ var LinkedDeviceSchema = object({
15307
15385
  features: array(string()),
15308
15386
  producesTrackedEvents: boolean().optional()
15309
15387
  });
15388
+ /**
15389
+ * The `linked-devices` extension slot's editable value (D648): the operator's
15390
+ * pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
15391
+ * in it — they are always linked and are not a pick.
15392
+ */
15393
+ var LinkedDevicesSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
15394
+ /**
15395
+ * The `linked-devices` slot — a camera's companion devices, owned by the
15396
+ * device manager over `_linkedDeviceIds` (D648, D356). Any device may be a
15397
+ * source except a container (its children are picked in its place) and the
15398
+ * camera itself.
15399
+ */
15400
+ var LINKED_DEVICES_SLOT = {
15401
+ id: "linked-devices",
15402
+ label: "Linked devices",
15403
+ description: "Companion devices of this camera: their controls appear with it, and the ones you opt in produce tracked events on it.",
15404
+ shape: "association",
15405
+ hostDeviceTypes: [DeviceType.Camera],
15406
+ sourceCaps: "any",
15407
+ cardinality: "many",
15408
+ value: LinkedDevicesSlotValueSchema
15409
+ };
15310
15410
  /** One camera's resolved linked set, tagged with the camera it belongs to.
15311
15411
  * The batch answer needs the tag; the single-device answer already has it
15312
15412
  * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
@@ -15456,6 +15556,7 @@ var deviceManagerCapability = {
15456
15556
  name: "device-manager",
15457
15557
  scope: "system",
15458
15558
  mode: "singleton",
15559
+ extensionSlots: [LINKED_DEVICES_SLOT],
15459
15560
  exposesDeviceSettings: true,
15460
15561
  methods: {
15461
15562
  /** Reserve (or re-resolve) a progressive numeric id for `(addonId, stableId)`.
@@ -15959,11 +16060,12 @@ var deviceManagerCapability = {
15959
16060
  /**
15960
16061
  * Resolve the devices LINKED to a camera — the single policy authority
15961
16062
  * both consumers call (viewer devices panel + pipeline-analytics event
15962
- * kinds/ingest). Device-tree children are ALWAYS included; mode 'auto'
15963
- * (default) adds every device sharing the camera's non-null `location`,
15964
- * mode 'manual' adds the persisted manual list instead. Excludes the
15965
- * camera itself; deduped. Configuration is standard per-device settings
15966
- * (see the module docblock) — there are no bespoke link mutations.
16063
+ * kinds/ingest). Device-tree children are ALWAYS included, plus the
16064
+ * operator's persisted pick list (`mode` is always `manual` since D356:
16065
+ * same-location devices are suggested by the picker, never linked on
16066
+ * their own). Excludes the camera itself; deduped. The list is written by
16067
+ * the settings section or the `linked-devices` extension slot, both over
16068
+ * `_linkedDeviceIds` (see the module docblock).
15967
16069
  */
15968
16070
  getLinkedDevices: method(object({ deviceId: number() }), object({
15969
16071
  mode: LinkedDevicesModeSchema,
@@ -16508,11 +16610,98 @@ var EmbeddingResultSchema = object({
16508
16610
  embedding: array(number()),
16509
16611
  inferenceMs: number()
16510
16612
  });
16613
+ /** The two CLIP towers the encoder runs; a crash budget is kept per tower. */
16614
+ var EmbeddingTowerSchema = _enum(["image", "text"]);
16615
+ /**
16616
+ * A tower in the terminal `failed` state (D649, D6): it crashed or failed to
16617
+ * load `crashes` times within `windowMs`, and is refused by name until an
16618
+ * operator `resetFailedModels` or a model change — never on a timer.
16619
+ *
16620
+ * `nodeId` is the node whose tower failed. The state lives in THAT node's
16621
+ * encoder process (in memory — a runner respawn clears it), and one node's
16622
+ * answer says nothing about another's.
16623
+ */
16624
+ var EmbeddingFailedModelSchema = object({
16625
+ modelId: string(),
16626
+ tower: EmbeddingTowerSchema,
16627
+ nodeId: string(),
16628
+ crashes: number(),
16629
+ windowMs: number(),
16630
+ sinceMs: number(),
16631
+ lastReason: string()
16632
+ });
16633
+ /**
16634
+ * A model whose REQUIREMENTS can never be met on this node (D649 round 5):
16635
+ * an id the catalog does not know, a model URL answering 404/410, a declared
16636
+ * sibling (the tokenizer) that is not there. After `attempts` failed builds
16637
+ * it is terminally `requirements-failed`, refused by name until an operator
16638
+ * `resetFailedModels` or a model change — the same exits as a crashed tower.
16639
+ */
16640
+ var EmbeddingFailedRequirementSchema = object({
16641
+ modelId: string(),
16642
+ tower: EmbeddingTowerSchema,
16643
+ nodeId: string(),
16644
+ attempts: number(),
16645
+ sinceMs: number(),
16646
+ lastReason: string()
16647
+ });
16511
16648
  var EmbeddingInfoSchema = object({
16512
16649
  modelId: string(),
16513
16650
  embeddingDim: number(),
16514
- ready: boolean()
16515
- });
16651
+ ready: boolean(),
16652
+ /**
16653
+ * The node that answered. Absent only from an encoder older than D649's
16654
+ * crash budget — whose `failedModels` is then UNKNOWN (D315), never "none".
16655
+ */
16656
+ nodeId: string().optional(),
16657
+ /**
16658
+ * Towers in `failed` on the answering node, each row naming it. `undefined`
16659
+ * means the node could not say (pre-budget encoder); a node that has the
16660
+ * budget always answers an array, empty included.
16661
+ */
16662
+ failedModels: array(EmbeddingFailedModelSchema).optional(),
16663
+ /** Models terminally `requirements-failed` on the answering node; same reading as above. */
16664
+ failedRequirements: array(EmbeddingFailedRequirementSchema).optional()
16665
+ });
16666
+ /**
16667
+ * The THREE codes an encoder refusal can carry (D649, D6). Same shape as
16668
+ * `VECTOR_INDEX_DIM_CONFLICT`: the code rides in the MESSAGE, because an
16669
+ * Error's own properties do not survive the UDS/tRPC hop and its message does,
16670
+ * and both sides go through the helpers below — the encoder builds the
16671
+ * refusal, the live detail plane classifies on it to count refusals per
16672
+ * camera instead of logging one warning per track. The bracketed token
16673
+ * carries the code, the model, the tower and the node so a consumer never
16674
+ * parses prose.
16675
+ *
16676
+ * - `EMBEDDING_MODEL_FAILED`: the tower crashed / failed to load past the crash
16677
+ * budget — terminal until `resetFailedModels` or a model change.
16678
+ * - `EMBEDDING_REQUIREMENTS_UNAVAILABLE`: files or runtime not there right now
16679
+ * (a download or Python that failed, or the cooldown after one) — the next
16680
+ * request past the cooldown tries again.
16681
+ * - `EMBEDDING_REQUIREMENTS_FAILED`: the requirements can never be met (unknown
16682
+ * id, 404/410, missing sibling) and the bounded attempts are spent —
16683
+ * terminal, same exits as a crashed tower.
16684
+ */
16685
+ var EMBEDDING_MODEL_FAILED = "embedding-model-failed";
16686
+ var EMBEDDING_REQUIREMENTS_UNAVAILABLE = "embedding-requirements-unavailable";
16687
+ var EMBEDDING_REQUIREMENTS_FAILED = "embedding-requirements-failed";
16688
+ _enum([
16689
+ EMBEDDING_MODEL_FAILED,
16690
+ EMBEDDING_REQUIREMENTS_UNAVAILABLE,
16691
+ EMBEDDING_REQUIREMENTS_FAILED
16692
+ ]);
16693
+ new RegExp(`\\[(${EMBEDDING_MODEL_FAILED}|${EMBEDDING_REQUIREMENTS_UNAVAILABLE}|${EMBEDDING_REQUIREMENTS_FAILED}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);
16694
+ /**
16695
+ * ONE provider per node (`placement: any-node`), addressed like every global
16696
+ * collection: the codegen injects a `{ nodeId?, addonId? }` selector on the
16697
+ * void methods and lifts a top-level `nodeId` off the object ones. A call
16698
+ * that names no node is answered by the HUB's provider — never by a merge
16699
+ * across nodes, because no global collection fans out across nodes (only the
16700
+ * providers of one node are `concatCollection`-fanned). So a fleet view of
16701
+ * `failedModels` is one `getInfo({ nodeId })` per node, and every answer
16702
+ * names the node it came from (D649 round 4); a node that cannot be asked is
16703
+ * UNKNOWN to the reader, never "no failures" (D315).
16704
+ */
16516
16705
  var embeddingEncoderCapability = {
16517
16706
  name: "embedding-encoder",
16518
16707
  scope: "system",
@@ -16531,8 +16720,30 @@ var embeddingEncoderCapability = {
16531
16720
  width: number(),
16532
16721
  height: number()
16533
16722
  }), EmbeddingResultSchema, { auth: "admin" }),
16534
- encodeText: method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }),
16535
- getInfo: method(_void(), EmbeddingInfoSchema, { auth: "admin" })
16723
+ /**
16724
+ * `modelId` (a CLIP IMAGE model id, whose catalog `clip.textModelId` names
16725
+ * the text tower) encodes in that model's space; absent, the cluster row's
16726
+ * `clip-embedding` model — the space every writer is in (D649).
16727
+ */
16728
+ encodeText: method(object({
16729
+ text: string(),
16730
+ modelId: string().min(1).optional()
16731
+ }), EmbeddingResultSchema, { auth: "admin" }),
16732
+ /** Answers for ONE node — the `nodeId` selector's, else the hub's. */
16733
+ getInfo: method(_void(), EmbeddingInfoSchema, { auth: "admin" }),
16734
+ /**
16735
+ * The operator's explicit clear of the `failed` state (one model, or all)
16736
+ * on ONE node — pass `nodeId` for an agent; the result names the node it
16737
+ * cleared. The only way out besides a model change: a crashing tower is
16738
+ * not retried on a timer.
16739
+ */
16740
+ resetFailedModels: method(object({ modelId: string().min(1).optional() }), object({
16741
+ cleared: array(string()),
16742
+ nodeId: string()
16743
+ }), {
16744
+ kind: "mutation",
16745
+ auth: "admin"
16746
+ })
16536
16747
  }
16537
16748
  };
16538
16749
  /**
@@ -20300,7 +20511,12 @@ var NcMediaPolicySchema = object({
20300
20511
  * the degrade engine, which drops the video and keeps the still.
20301
20512
  */
20302
20513
  clip: boolean().optional(),
20303
- /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
20514
+ /**
20515
+ * Seconds of footage BEFORE / AFTER the event instant. Absent =
20516
+ * {@link NC_CLIP_PRE_ROLL_DEFAULT_SEC} / {@link NC_CLIP_POST_ROLL_DEFAULT_SEC}
20517
+ * (4 / 6), resolved by the Notification Center at dispatch — deliberately not
20518
+ * a Zod default, so a rule that never chose keeps following the hub's.
20519
+ */
20304
20520
  clipPreRollSec: number().int().min(0).max(30).optional(),
20305
20521
  clipPostRollSec: number().int().min(0).max(30).optional(),
20306
20522
  /**
@@ -22398,6 +22614,130 @@ var oauthIntegrationCapability = {
22398
22614
  getDescriptor: method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" }) }
22399
22615
  };
22400
22616
  /**
22617
+ * A model choice has a SCOPE, and a scope change has a workflow.
22618
+ *
22619
+ * ## The two scopes
22620
+ *
22621
+ * Almost every pipeline step's model is a **node** question: which build runs
22622
+ * fastest on THIS accelerator. Two nodes may legitimately answer differently —
22623
+ * a Coral runs the tflite SSD, a Mac runs the coreml YOLO — because the answers
22624
+ * are compared against nothing. They produce boxes, and a box is a box.
22625
+ *
22626
+ * Two steps are not like that. `face-embedding` and `clip-embedding` produce
22627
+ * **vectors that land in ONE shared index** (`identity_samples`,
22628
+ * `vec_object_clip`) and are ranked against each other by cosine similarity.
22629
+ * Cosine similarity between two encoders is not a weak signal, it is a
22630
+ * meaningless number — and nothing inside a vector can tell you it happened.
22631
+ * So for those two steps the model is a **cluster** question with exactly one
22632
+ * answer, stored in exactly one row.
22633
+ *
22634
+ * That is the same argument [D52](../../../../docs/decisions/adr-0052.md) makes
22635
+ * for the crop convention (`detail-crop.ts`), one level up: the crop decides
22636
+ * WHAT pixels the encoder sees, this decides WHICH encoder sees them. Both are
22637
+ * cluster-wide for the same reason and neither may become per-node.
22638
+ *
22639
+ * ## Why the registry lives here and not in the step catalog
22640
+ *
22641
+ * The scope itself is declared on the step, in
22642
+ * `detection-pipeline/registry/step-definitions.ts` (`StepDefinition.modelScope`)
22643
+ * — that is where a new step declares what kind of choice its model is. But the
22644
+ * catalog lives inside `addon-pipeline`, and three packages that must NOT
22645
+ * import an addon need to know the set: the orchestrator (which renders and
22646
+ * stores the row), post-analysis (which pins the row for a re-embed pass) and
22647
+ * admin-ui (which mirrors it). So the set is mirrored here, and
22648
+ * `scripts/check-cluster-model-scope.ts` fails the build when the two disagree.
22649
+ * A hand-copied key that stops matching is exactly how a setting silently stops
22650
+ * arriving while both sides still look correct.
22651
+ *
22652
+ * ## The defaults ARE today's behaviour
22653
+ *
22654
+ * {@link DEFAULT_CLUSTER_STEP_MODELS} reproduces the catalog `defaultModelId`
22655
+ * of both steps. Declaring the scope therefore changes nothing on the day it
22656
+ * ships: the cluster row starts out saying what every node was already doing.
22657
+ * Changing it is legitimate — that is what the knob is for — but it invalidates
22658
+ * the stored vectors of that surface, and must be followed by a re-embed pass
22659
+ * (`face-reembed-pass.ts`, `embedding-rebuild.ts`).
22660
+ */
22661
+ /**
22662
+ * Why the orchestrator cannot say which model the operator chose for a
22663
+ * cluster-scoped step (D651).
22664
+ */
22665
+ var CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS = [
22666
+ "owner-not-ready",
22667
+ "store-read-failed",
22668
+ "three-way-read-unavailable",
22669
+ "invalid-stored",
22670
+ "not-cluster-scoped"
22671
+ ];
22672
+ Object.freeze(Object.fromEntries([{
22673
+ stepId: "face-embedding",
22674
+ label: "Face recognition model",
22675
+ defaultModelId: "auraface-r100",
22676
+ indexName: "the enrolled face gallery",
22677
+ options: [
22678
+ {
22679
+ id: "auraface-r100",
22680
+ label: "AuraFace R100"
22681
+ },
22682
+ {
22683
+ id: "arcface-r100",
22684
+ label: "ArcFace (ResNet34)"
22685
+ },
22686
+ {
22687
+ id: "inception-resnet-v1",
22688
+ label: "Inception ResNet V1"
22689
+ }
22690
+ ]
22691
+ }, {
22692
+ stepId: "clip-embedding",
22693
+ label: "Semantic search model",
22694
+ defaultModelId: "mobileclip-s1",
22695
+ indexName: "the object semantic-search index",
22696
+ options: [
22697
+ {
22698
+ id: "mobileclip-s1",
22699
+ label: "MobileCLIP S1"
22700
+ },
22701
+ {
22702
+ id: "mobileclip-s2",
22703
+ label: "MobileCLIP S2"
22704
+ },
22705
+ {
22706
+ id: "siglip2-b16-224",
22707
+ label: "SigLIP2 B/16 (Apache-2.0)"
22708
+ }
22709
+ ]
22710
+ }].map((s) => [s.stepId, s.defaultModelId])));
22711
+ var CLUSTER_STEP_SETTING_FIELDS = [{
22712
+ stepId: "face-embedding",
22713
+ key: "minLandmarkFaceSize",
22714
+ label: "Min face size for recognition (detection px)",
22715
+ description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",
22716
+ type: "slider",
22717
+ min: 0,
22718
+ max: 64,
22719
+ step: 2,
22720
+ default: 24
22721
+ }];
22722
+ function clusterStepSettingKey(stepId, fieldKey) {
22723
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
22724
+ }
22725
+ var ClusterSettingNumberSchema = number().finite();
22726
+ function readClusterStepSettings(config) {
22727
+ const out = {};
22728
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
22729
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
22730
+ const value = parsed.success ? parsed.data : field.default;
22731
+ const existing = out[field.stepId] ?? {};
22732
+ out[field.stepId] = {
22733
+ ...existing,
22734
+ [field.key]: value
22735
+ };
22736
+ }
22737
+ return out;
22738
+ }
22739
+ readClusterStepSettings({});
22740
+ /**
22401
22741
  * pipeline-analytics — device-scoped wrapper cap. Refines raw
22402
22742
  * per-frame detections emitted by the pipeline runner into tracked
22403
22743
  * objects, per-kind event collections (motion / object / audio), and
@@ -23213,7 +23553,8 @@ var MediaFileKindEnum = _enum([
23213
23553
  "thumbnailSmall",
23214
23554
  "confirmationCrop",
23215
23555
  "debugCrop",
23216
- "sceneFrame"
23556
+ "sceneFrame",
23557
+ "lastSceneFrame"
23217
23558
  ]);
23218
23559
  /**
23219
23560
  * One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
@@ -23765,7 +24106,23 @@ var SearchObjectEventsInput = object({
23765
24106
  until: number().optional(),
23766
24107
  classFilter: string().optional(),
23767
24108
  limit: number().default(50),
23768
- minScore: number().min(0).max(1).default(.2)
24109
+ /**
24110
+ * An ABSOLUTE cosine floor. Optional since D649: a floor is a property of the
24111
+ * model (0.2 kept 96% of matched pairs on MobileCLIP S1 and 2.7% on SigLIP2),
24112
+ * so an absent one resolves to the searched model's own `searchMinScore`
24113
+ * scaled by `strictness`. A number sent here is honoured verbatim.
24114
+ */
24115
+ minScore: number().min(0).max(1).optional(),
24116
+ /** Model-relative floor — see `resolveClipSearchMinScore`. Default `loose`. */
24117
+ strictness: ClipSearchStrictnessSchema.optional(),
24118
+ /**
24119
+ * Search THIS CLIP model's index instead of the cluster row's. Every index a
24120
+ * model ever wrote stays searchable until it is wiped (the MobileCLIP index
24121
+ * through a SigLIP2 cutover and its rollback window). An id with no CLIP
24122
+ * metadata is refused; an id other than the cluster row's is ADMIN-only
24123
+ * (`model-override-requires-admin`).
24124
+ */
24125
+ modelId: string().min(1).optional()
23769
24126
  });
23770
24127
  var TrackCascadeCountsSchema = object({
23771
24128
  /** Persisted track roots deleted (authoritative). */
@@ -23900,7 +24257,41 @@ var RebuildObjectEmbeddingsInput = object({
23900
24257
  * comparable, so wiping and rebuilding is the only way to be sure every vector
23901
24258
  * means the same thing.
23902
24259
  */
23903
- var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
24260
+ var WipeObjectEmbeddingsResultSchema = object({
24261
+ deleted: number(),
24262
+ /**
24263
+ * CLIP indexes that could NOT be emptied (unreachable, or refused at their
24264
+ * dimension) — not a clean slate. Additive and optional (D649).
24265
+ */
24266
+ failedIndexes: array(string()).optional()
24267
+ });
24268
+ /**
24269
+ * Why a rebuild did not start, BY NAME — ONE vocabulary for both gates in front
24270
+ * of a pass (D649 over D651). A bare `started: false` read the same for "the
24271
+ * stores are booting" and "the cluster row names a model with no CLIP
24272
+ * metadata", which need different fixes.
24273
+ * - `stores-unavailable` — the analytics stores or the API are not up yet.
24274
+ * - the owner's confirmation of the cluster model (D651, `ClusterPinConfirmer`):
24275
+ * a pass that rewrites an index needs two agreeing reads of the OWNER's
24276
+ * answer (`pipelineOrchestrator.getClusterModelChoice`) — a pass that cannot
24277
+ * name its model does not run (D54):
24278
+ * - the owner's own `unreadable` reasons (`owner-not-ready`,
24279
+ * `store-read-failed`, `three-way-read-unavailable`, `invalid-stored`,
24280
+ * `not-cluster-scoped`);
24281
+ * - `method-unavailable` — the orchestrator predates the method;
24282
+ * - `read-failed` — the call failed or answered something unparseable;
24283
+ * - `reads-disagree` — the two reads named different choices.
24284
+ * - `not-a-clip-model` — the CONFIRMED id has no CLIP metadata, so there is no
24285
+ * index to fill and no dimension to check against (D649).
24286
+ */
24287
+ var RebuildObjectEmbeddingsRefusalSchema = _enum([
24288
+ "stores-unavailable",
24289
+ ...CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS,
24290
+ "method-unavailable",
24291
+ "read-failed",
24292
+ "reads-disagree",
24293
+ "not-a-clip-model"
24294
+ ]);
23904
24295
  /**
23905
24296
  * Acknowledgement that a rebuild STARTED.
23906
24297
  *
@@ -23913,7 +24304,12 @@ var WipeObjectEmbeddingsResultSchema = object({ deleted: number() });
23913
24304
  var RebuildObjectEmbeddingsResultSchema = object({
23914
24305
  started: boolean(),
23915
24306
  /** True when a pass was already running; the new request is ignored. */
23916
- alreadyRunning: boolean()
24307
+ alreadyRunning: boolean(),
24308
+ /** Present when the pass refused to start — see `RebuildObjectEmbeddingsRefusalSchema`. */
24309
+ refusal: RebuildObjectEmbeddingsRefusalSchema.optional(),
24310
+ /** The CLIP model the pass pinned, and the index it fills (when it started). */
24311
+ modelId: string().optional(),
24312
+ index: string().optional()
23917
24313
  });
23918
24314
  var RebuildStatusSchema = object({
23919
24315
  running: boolean(),
@@ -23947,7 +24343,11 @@ var RebuildStatusSchema = object({
23947
24343
  startedAtMs: number().nullable(),
23948
24344
  finishedAtMs: number().nullable(),
23949
24345
  /** Present when the pass ended by throwing. */
23950
- error: string().nullable()
24346
+ error: string().nullable(),
24347
+ /** The CLIP model the current / last pass pinned (D54), `null` before any. */
24348
+ modelId: string().nullable(),
24349
+ /** The index that pass fills — `ClipModelMeta.vectorIndex` of `modelId` (D649). */
24350
+ index: string().nullable()
23951
24351
  });
23952
24352
  /**
23953
24353
  * Acknowledgement that a debug-media reclaim STARTED.
@@ -24891,7 +25291,7 @@ var pipelineAnalyticsCapability = {
24891
25291
  * ObjectEvents by trackId. Returns up to `limit` events scored ≥
24892
25292
  * `minScore`, sorted descending by score.
24893
25293
  */
24894
- searchObjectEvents: method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()),
25294
+ searchObjectEvents: method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly(), { caller: "required" }),
24895
25295
  wipeObjectEmbeddings: method(object({}), WipeObjectEmbeddingsResultSchema, {
24896
25296
  kind: "mutation",
24897
25297
  auth: "admin"
@@ -26184,6 +26584,17 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
26184
26584
  hubHostnameOverride: string().optional()
26185
26585
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
26186
26586
  /**
26587
+ * What ONE step runs with on ONE roster device for THIS camera (D650): the
26588
+ * device's per-(node,device) base with the camera's override for that device
26589
+ * on top — the same `override ?? base` merge the orchestrator applies to the
26590
+ * elected device (`applyDeviceProvisioning`). Absent `modelId` ⇒ the executor
26591
+ * resolves the device format's default, exactly as on the elected device.
26592
+ */
26593
+ var RunnerJumpStepProvisioningSchema = object({
26594
+ modelId: string().optional(),
26595
+ settings: record(string(), unknown()).optional()
26596
+ });
26597
+ /**
26187
26598
  * One ENABLED inference device on the runner's node, as the step-tree
26188
26599
  * device-jump resolver sees it (phase 1). The orchestrator populates this
26189
26600
  * roster on the attach payload whenever the camera is elected onto a specific
@@ -26195,7 +26606,16 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
26195
26606
  var RunnerInferenceDeviceSchema = object({
26196
26607
  deviceKey: string(),
26197
26608
  weight: number().positive().default(1),
26198
- maxSessions: number().int().positive().nullable().default(null)
26609
+ maxSessions: number().int().positive().nullable().default(null),
26610
+ /**
26611
+ * Per-step provisioning for this camera on THIS device (D650), keyed by step
26612
+ * id. A step the runner jumps here runs with these fields, never with the
26613
+ * elected device's: `modelId` / `settings` are REPLACED on the jumped subtree
26614
+ * (a step absent from the map runs with neither — the target format default).
26615
+ * Absent field ⇒ an orchestrator that predates D650: the jumped step keeps
26616
+ * the elected device's provisioning, as before.
26617
+ */
26618
+ steps: record(string(), RunnerJumpStepProvisioningSchema).optional()
26199
26619
  });
26200
26620
  /**
26201
26621
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
@@ -27262,6 +27682,28 @@ var NodeInferenceDeviceSchema = object({
27262
27682
  */
27263
27683
  exclusion: InferenceDeviceExclusionReasonSchema.nullable()
27264
27684
  });
27685
+ /**
27686
+ * The operator's model choice for one cluster-scoped step, answered by the
27687
+ * addon that OWNS the `clusterModel:*` settings (D651). Three answers, never
27688
+ * folded: a written choice, a key nobody wrote (the cluster runs the default
27689
+ * BY ABSENCE), or no answer. A caller that rewrites an index acts only on the
27690
+ * first two, read twice and agreeing.
27691
+ */
27692
+ var ClusterModelChoiceSchema = discriminatedUnion("kind", [
27693
+ object({
27694
+ kind: literal("stored"),
27695
+ modelId: string()
27696
+ }),
27697
+ object({
27698
+ kind: literal("absent"),
27699
+ defaultModelId: string()
27700
+ }),
27701
+ object({
27702
+ kind: literal("unreadable"),
27703
+ reason: _enum(CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS),
27704
+ error: string().optional()
27705
+ })
27706
+ ]);
27265
27707
  var NodeInferenceDevicesSchema = object({
27266
27708
  nodeId: string(),
27267
27709
  /** False when the node's platform-probe was unreachable (no live device set). */
@@ -27358,9 +27800,19 @@ var pipelineOrchestratorCapability = {
27358
27800
  * Trigger a full rebalance pass. Iterates over all assigned cameras,
27359
27801
  * recomputes the optimal agent for each one based on current load +
27360
27802
  * hardware affinity, and migrates cameras whose current agent is no
27361
- * longer optimal. Pinned cameras are never migrated.
27362
- */
27363
- rebalance: method(_void(), object({ migrated: number() }), {
27803
+ * longer optimal. Pinned cameras are never migrated. `skipped` names the
27804
+ * cameras the pass wanted to move and could not, with why — a target node
27805
+ * that has not answered its catalog / device health yet, or a device that
27806
+ * cannot run the camera's root (D650).
27807
+ */
27808
+ rebalance: method(_void(), object({
27809
+ migrated: number(),
27810
+ skipped: array(object({
27811
+ deviceId: number(),
27812
+ targetNodeId: string(),
27813
+ reason: string()
27814
+ })).default([])
27815
+ }), {
27364
27816
  kind: "mutation",
27365
27817
  auth: "admin"
27366
27818
  }),
@@ -27370,6 +27822,13 @@ var pipelineOrchestratorCapability = {
27370
27822
  getPipelineAssignment: method(object({ deviceId: number() }), PipelineAssignmentSchema.nullable()),
27371
27823
  /** Get per-agent load summaries used by the load balancer + dashboards. */
27372
27824
  getAgentLoad: method(_void(), array(AgentLoadSummarySchema).readonly()),
27825
+ /**
27826
+ * The operator's STORED model choice for one cluster-scoped step (D651).
27827
+ * Read three-way from this addon's own store, only once its boot has
27828
+ * settled. Unlike `addonSettings.getGlobalSettings`, it never answers a
27829
+ * default as though someone chose it.
27830
+ */
27831
+ getClusterModelChoice: method(object({ stepId: string() }), ClusterModelChoiceSchema),
27373
27832
  /** Aggregate global metrics across the whole detection cluster. */
27374
27833
  getGlobalMetrics: method(_void(), GlobalMetricsSchema),
27375
27834
  /**
@@ -30630,6 +31089,277 @@ var videoclipsCapability = {
30630
31089
  }
30631
31090
  };
30632
31091
  /**
31092
+ * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
31093
+ * valutatore puro del suo FRONTE.
31094
+ *
31095
+ * Viveva dentro il builtin virtual-doorbell
31096
+ * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
31097
+ * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
31098
+ * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
31099
+ * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
31100
+ * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
31101
+ * SPOSTA qui e il doorbell la ri-esporta.
31102
+ *
31103
+ * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
31104
+ * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
31105
+ * regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
31106
+ * booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
31107
+ */
31108
+ /**
31109
+ * Known binary / switch source caps → the boolean slice field whose
31110
+ * false→true rise counts as ACTIVE. Every entry is "fire on active".
31111
+ * Sensors whose "active" reading is not a plain boolean (presence's string
31112
+ * state, connectivity's connected flag) are deliberately excluded — a
31113
+ * reconnect is not a doorbell press, and it is not a recording either.
31114
+ */
31115
+ var SOURCE_CAP_ACTIVE_FIELD = {
31116
+ contact: "entryOpen",
31117
+ binary: "on",
31118
+ switch: "on",
31119
+ motion: "detected",
31120
+ flood: "flooded",
31121
+ gas: "detected",
31122
+ smoke: "detected",
31123
+ "carbon-monoxide": "detected",
31124
+ vibration: "detected",
31125
+ tamper: "tampered"
31126
+ };
31127
+ /** Cap names whose presence in a device's bindings qualify it as a source. */
31128
+ var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
31129
+ /**
31130
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
31131
+ * name (same pattern as `snapshot`):
31132
+ *
31133
+ * - **Native** providers: registered per-device by device-driver
31134
+ * addons via `ctx.registerNativeCap` — either on a
31135
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
31136
+ * or directly on the camera (Reolink registers at camera level).
31137
+ * Emits an `onPressed` event every time the firmware pushes a
31138
+ * ring; status tracks the last press and a pressCount since start
31139
+ * (diagnostic).
31140
+ *
31141
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
31142
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
31143
+ * device (contact / switch / event-emitter …) into a doorbell for
31144
+ * a camera. `defaultActive: false` — the operator explicitly binds
31145
+ * it per camera in the device-bindings UI, then picks the source
31146
+ * device + trigger in the per-device settings.
31147
+ *
31148
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent
31149
+ * — subscribers listening at the camera level receive ring events
31150
+ * with `via[]` populated. No code on the parent needed.
31151
+ */
31152
+ var DoorbellStatusSchema = object({
31153
+ /** Ms epoch of the last press. null = never observed since this provider started. */
31154
+ lastPressedAt: number().nullable(),
31155
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
31156
+ pressCountSinceStart: number()
31157
+ });
31158
+ var DoorbellPressEventSchema = object({
31159
+ deviceId: number(),
31160
+ timestamp: number()
31161
+ });
31162
+ /**
31163
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
31164
+ * virtual-doorbell trigger devices, exactly what the wrapper's
31165
+ * `doorbellSources` persists (as `{ deviceId }` records).
31166
+ */
31167
+ var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
31168
+ /**
31169
+ * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
31170
+ * doorbell, owned by the `virtual-doorbell` wrapper over its
31171
+ * `doorbellSources` store (D648). A source rings when one of its
31172
+ * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
31173
+ * different authority (`deviceManager.setWrapperActive`, D62) — the slot
31174
+ * reports it, it never writes it.
31175
+ */
31176
+ var DOORBELL_SOURCE_SLOT = {
31177
+ id: "doorbell-source",
31178
+ label: "Doorbell trigger devices",
31179
+ description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
31180
+ shape: "association",
31181
+ hostDeviceTypes: [DeviceType.Camera],
31182
+ sourceCaps: SOURCE_CAPS,
31183
+ cardinality: "many",
31184
+ value: DoorbellSourceSlotValueSchema
31185
+ };
31186
+ var doorbellCapability = {
31187
+ name: "doorbell",
31188
+ scope: "device",
31189
+ deviceNative: true,
31190
+ mode: "singleton",
31191
+ kind: "wrapper",
31192
+ defaultActive: false,
31193
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
31194
+ exposesDeviceSettings: true,
31195
+ extensionSlots: [DOORBELL_SOURCE_SLOT],
31196
+ methods: {},
31197
+ events: {
31198
+ /**
31199
+ * Fires once per physical press. Reolink delivers via Baichuan
31200
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
31201
+ * release/duration — it's a pulse.
31202
+ */
31203
+ onPressed: { data: DoorbellPressEventSchema } },
31204
+ status: {
31205
+ schema: DoorbellStatusSchema,
31206
+ kind: "push"
31207
+ },
31208
+ /**
31209
+ * Runtime-state slice — last press timestamp + lifetime press count.
31210
+ * Mirrored by the kernel and readable via
31211
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
31212
+ * without subscribing.
31213
+ */
31214
+ runtimeState: DoorbellStatusSchema,
31215
+ /**
31216
+ * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
31217
+ *
31218
+ * See `RuntimeStateDurability`. Enforced by
31219
+ * `scripts/check-runtime-state-durability.ts`.
31220
+ */
31221
+ durability: "restored"
31222
+ };
31223
+ var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
31224
+ DeviceType.Camera, DeviceType.Camera;
31225
+ /** A slot's editable value, discriminated on `slot`. */
31226
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
31227
+ /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
31228
+ var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
31229
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
31230
+ state: literal("unreachable"),
31231
+ reason: string()
31232
+ })]);
31233
+ /** One provider of slots — the D554 source-listing row. */
31234
+ var ExtensionSourceSchema = object({
31235
+ /** The routing prefix of every `slotRef` this provider serves. */
31236
+ source: string(),
31237
+ label: string(),
31238
+ /** Stamped by the dispatcher from the registry (D557). */
31239
+ addonId: string().optional(),
31240
+ availability: ExtensionSourceAvailabilitySchema
31241
+ });
31242
+ /**
31243
+ * How one picked source stands. `missing` — no such device (deleted, or an id
31244
+ * that never existed); `foreign` — a device the slot's owner cannot read from
31245
+ * (slice 2's cross-owner graft source); `unavailable` — it exists but is not a
31246
+ * valid source now (a container, which is never a pick). A source in any of
31247
+ * these states is SHOWN, never silently dropped or re-pointed.
31248
+ */
31249
+ var ExtensionSourceHealthSchema = _enum([
31250
+ "ok",
31251
+ "missing",
31252
+ "foreign",
31253
+ "unavailable"
31254
+ ]);
31255
+ var ExtensionSlotSourceSchema = object({
31256
+ deviceId: number().int(),
31257
+ /** The device's name, or null when it could not be resolved (`missing`). */
31258
+ name: string().nullable(),
31259
+ health: ExtensionSourceHealthSchema,
31260
+ detail: string().optional()
31261
+ });
31262
+ /**
31263
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
31264
+ * reported read-only, named, never written through this contract (D62). The
31265
+ * virtual doorbell's sources ring only while the wrapper is bound to the
31266
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
31267
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
31268
+ */
31269
+ var ExtensionSlotActivationSchema = object({
31270
+ state: _enum([
31271
+ "active",
31272
+ "inactive",
31273
+ "unknown"
31274
+ ]),
31275
+ authority: string(),
31276
+ detail: string().optional()
31277
+ });
31278
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
31279
+ state: literal("ok"),
31280
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
31281
+ slotRef: string(),
31282
+ slot: ExtensionSlotIdSchema,
31283
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
31284
+ authority: string(),
31285
+ /** graft: its switch. association: null — removing every source is "off". */
31286
+ enabled: boolean().nullable(),
31287
+ /** graft: the cap registered on the host. association: null. */
31288
+ projects: string().nullable(),
31289
+ activation: ExtensionSlotActivationSchema.nullable(),
31290
+ value: ExtensionSlotValueSchema,
31291
+ sources: array(ExtensionSlotSourceSchema)
31292
+ }), object({
31293
+ state: literal("unreachable"),
31294
+ addonId: string(),
31295
+ reason: string()
31296
+ })]);
31297
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
31298
+ deviceId: number().int(),
31299
+ name: string(),
31300
+ type: string(),
31301
+ location: string().nullable(),
31302
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
31303
+ parentName: string().nullable(),
31304
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
31305
+ suggested: boolean(),
31306
+ /** Why it is suggested ("same location"), null when it is not. */
31307
+ reason: string().nullable()
31308
+ })) });
31309
+ /**
31310
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
31311
+ * reloaded the host (or, for an accessory child, its parent) because the
31312
+ * write changed what the host REGISTERS (a graft switched on or off, slice 2).
31313
+ */
31314
+ var ExtensionSetResultSchema = object({
31315
+ applied: literal(true),
31316
+ reload: _enum([
31317
+ "none",
31318
+ "host",
31319
+ "parent"
31320
+ ])
31321
+ });
31322
+ var ExtensionSlotRefInputSchema = object({
31323
+ deviceId: number().int(),
31324
+ slotRef: string().min(1)
31325
+ });
31326
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
31327
+ var deviceExtensionCapability = {
31328
+ name: "device-extension",
31329
+ scope: "device",
31330
+ mode: "collection",
31331
+ kind: "wrapper",
31332
+ defaultActive: true,
31333
+ deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
31334
+ deviceConfig: { ui: {
31335
+ kind: "widget",
31336
+ widgetId: "host/extensions-panel",
31337
+ tab: "general",
31338
+ label: "Extensions",
31339
+ order: 72
31340
+ } },
31341
+ methods: {
31342
+ /** One row per slot owner — the D554 source listing `slotRef` routes by. */
31343
+ listSources: method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)),
31344
+ /**
31345
+ * Every slot this device is offered, read by each owner from its own
31346
+ * store. A provider that throws is ONE `unreachable` row (D554.4).
31347
+ */
31348
+ listSlots: method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)),
31349
+ /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
31350
+ listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
31351
+ /**
31352
+ * Write one slot through its owner's EXISTING write path. The owner
31353
+ * validates (a container is never a linked device, a camera is never its
31354
+ * own source) and refuses by name before persisting.
31355
+ */
31356
+ setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
31357
+ kind: "mutation",
31358
+ auth: "admin"
31359
+ })
31360
+ }
31361
+ };
31362
+ /**
30633
31363
  * Optional client-side hints sent at session creation to help the provider
30634
31364
  * pick the best native source. All fields optional — a viewer that knows
30635
31365
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -33475,75 +34205,6 @@ onStatusChanged: { data: object({
33475
34205
  volatileStateFields: ["lastChangedAt"]
33476
34206
  };
33477
34207
  /**
33478
- * Doorbell button cap. Two kinds of providers coexist behind this cap
33479
- * name (same pattern as `snapshot`):
33480
- *
33481
- * - **Native** providers: registered per-device by device-driver
33482
- * addons via `ctx.registerNativeCap` — either on a
33483
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
33484
- * or directly on the camera (Reolink registers at camera level).
33485
- * Emits an `onPressed` event every time the firmware pushes a
33486
- * ring; status tracks the last press and a pressCount since start
33487
- * (diagnostic).
33488
- *
33489
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
33490
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
33491
- * device (contact / switch / event-emitter …) into a doorbell for
33492
- * a camera. `defaultActive: false` — the operator explicitly binds
33493
- * it per camera in the device-bindings UI, then picks the source
33494
- * device + trigger in the per-device settings.
33495
- *
33496
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
33497
- * — subscribers listening at the camera level receive ring events
33498
- * with `via[]` populated. No code on the parent needed.
33499
- */
33500
- var DoorbellStatusSchema = object({
33501
- /** Ms epoch of the last press. null = never observed since this provider started. */
33502
- lastPressedAt: number().nullable(),
33503
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
33504
- pressCountSinceStart: number()
33505
- });
33506
- var DoorbellPressEventSchema = object({
33507
- deviceId: number(),
33508
- timestamp: number()
33509
- });
33510
- var doorbellCapability = {
33511
- name: "doorbell",
33512
- scope: "device",
33513
- deviceNative: true,
33514
- mode: "singleton",
33515
- kind: "wrapper",
33516
- defaultActive: false,
33517
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
33518
- exposesDeviceSettings: true,
33519
- methods: {},
33520
- events: {
33521
- /**
33522
- * Fires once per physical press. Reolink delivers via Baichuan
33523
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
33524
- * release/duration — it's a pulse.
33525
- */
33526
- onPressed: { data: DoorbellPressEventSchema } },
33527
- status: {
33528
- schema: DoorbellStatusSchema,
33529
- kind: "push"
33530
- },
33531
- /**
33532
- * Runtime-state slice — last press timestamp + lifetime press count.
33533
- * Mirrored by the kernel and readable via
33534
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
33535
- * without subscribing.
33536
- */
33537
- runtimeState: DoorbellStatusSchema,
33538
- /**
33539
- * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
33540
- *
33541
- * See `RuntimeStateDurability`. Enforced by
33542
- * `scripts/check-runtime-state-durability.ts`.
33543
- */
33544
- durability: "restored"
33545
- };
33546
- /**
33547
34208
  * Enum-state sensor — a string value picked from a finite option set.
33548
34209
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
33549
34210
  * states, weather conditions, contact-source channels, mode strings).
@@ -43296,42 +43957,6 @@ function readDeviceStateFrom(runtimeState) {
43296
43957
  }
43297
43958
  }
43298
43959
  /**
43299
- * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
43300
- * valutatore puro del suo FRONTE.
43301
- *
43302
- * Viveva dentro il builtin virtual-doorbell
43303
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
43304
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
43305
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
43306
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
43307
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
43308
- * SPOSTA qui e il doorbell la ri-esporta.
43309
- *
43310
- * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
43311
- * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
43312
- * regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
43313
- * booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
43314
- */
43315
- /**
43316
- * Known binary / switch source caps → the boolean slice field whose
43317
- * false→true rise counts as ACTIVE. Every entry is "fire on active".
43318
- * Sensors whose "active" reading is not a plain boolean (presence's string
43319
- * state, connectivity's connected flag) are deliberately excluded — a
43320
- * reconnect is not a doorbell press, and it is not a recording either.
43321
- */
43322
- var SOURCE_CAP_ACTIVE_FIELD = {
43323
- contact: "entryOpen",
43324
- binary: "on",
43325
- switch: "on",
43326
- motion: "detected",
43327
- flood: "flooded",
43328
- gas: "detected",
43329
- smoke: "detected",
43330
- "carbon-monoxide": "detected",
43331
- vibration: "detected",
43332
- tamper: "tampered"
43333
- };
43334
- /**
43335
43960
  * Accessory device helpers — shared across drivers.
43336
43961
  *
43337
43962
  * Many vendor-specific drivers register accessory child devices on
@@ -44754,6 +45379,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
44754
45379
  deviceAdoptionCapability,
44755
45380
  deviceDiscoveryCapability,
44756
45381
  deviceExportCapability,
45382
+ deviceExtensionCapability,
44757
45383
  deviceManagerCapability,
44758
45384
  deviceOpsCapability,
44759
45385
  deviceProviderCapability,
@@ -46302,6 +46928,30 @@ Object.freeze({
46302
46928
  addonId: null,
46303
46929
  access: "create"
46304
46930
  },
46931
+ "deviceExtension.listCandidates": {
46932
+ capName: "device-extension",
46933
+ capScope: "device",
46934
+ addonId: null,
46935
+ access: "view"
46936
+ },
46937
+ "deviceExtension.listSlots": {
46938
+ capName: "device-extension",
46939
+ capScope: "device",
46940
+ addonId: null,
46941
+ access: "view"
46942
+ },
46943
+ "deviceExtension.listSources": {
46944
+ capName: "device-extension",
46945
+ capScope: "device",
46946
+ addonId: null,
46947
+ access: "view"
46948
+ },
46949
+ "deviceExtension.setSlot": {
46950
+ capName: "device-extension",
46951
+ capScope: "device",
46952
+ addonId: null,
46953
+ access: "create"
46954
+ },
46305
46955
  "deviceManager.addLocation": {
46306
46956
  capName: "device-manager",
46307
46957
  capScope: "system",
@@ -47052,6 +47702,12 @@ Object.freeze({
47052
47702
  addonId: null,
47053
47703
  access: "view"
47054
47704
  },
47705
+ "embeddingEncoder.resetFailedModels": {
47706
+ capName: "embedding-encoder",
47707
+ capScope: "system",
47708
+ addonId: null,
47709
+ access: "delete"
47710
+ },
47055
47711
  "enumSensor.getStatus": {
47056
47712
  capName: "enum-sensor",
47057
47713
  capScope: "device",
@@ -49386,6 +50042,12 @@ Object.freeze({
49386
50042
  addonId: null,
49387
50043
  access: "view"
49388
50044
  },
50045
+ "pipelineOrchestrator.getClusterModelChoice": {
50046
+ capName: "pipeline-orchestrator",
50047
+ capScope: "system",
50048
+ addonId: null,
50049
+ access: "view"
50050
+ },
49389
50051
  "pipelineOrchestrator.getDeviceLiveContribution": {
49390
50052
  capName: "pipeline-orchestrator",
49391
50053
  capScope: "system",
@@ -52211,6 +52873,26 @@ Object.freeze({
52211
52873
  form: "single",
52212
52874
  optional: false
52213
52875
  }],
52876
+ "deviceExtension.listCandidates": [{
52877
+ name: "deviceId",
52878
+ form: "single",
52879
+ optional: false
52880
+ }],
52881
+ "deviceExtension.listSlots": [{
52882
+ name: "deviceId",
52883
+ form: "single",
52884
+ optional: false
52885
+ }],
52886
+ "deviceExtension.listSources": [{
52887
+ name: "deviceId",
52888
+ form: "single",
52889
+ optional: false
52890
+ }],
52891
+ "deviceExtension.setSlot": [{
52892
+ name: "deviceId",
52893
+ form: "single",
52894
+ optional: false
52895
+ }],
52214
52896
  "deviceManager.adoptionRelease": [{
52215
52897
  name: "camDeviceId",
52216
52898
  form: "single",
@@ -54750,68 +55432,6 @@ TimelapseRuleInputSchema.extend({
54750
55432
  createdAt: number(),
54751
55433
  updatedAt: number()
54752
55434
  });
54753
- Object.freeze(Object.fromEntries([{
54754
- stepId: "face-embedding",
54755
- label: "Face recognition model",
54756
- defaultModelId: "arcface-r100",
54757
- indexName: "the enrolled face gallery",
54758
- options: [
54759
- {
54760
- id: "arcface-r100",
54761
- label: "ArcFace (ResNet34)"
54762
- },
54763
- {
54764
- id: "auraface-r100",
54765
- label: "AuraFace R100"
54766
- },
54767
- {
54768
- id: "inception-resnet-v1",
54769
- label: "Inception ResNet V1"
54770
- }
54771
- ]
54772
- }, {
54773
- stepId: "clip-embedding",
54774
- label: "Semantic search model",
54775
- defaultModelId: "mobileclip-s1",
54776
- indexName: "the object semantic-search index",
54777
- options: [{
54778
- id: "mobileclip-s1",
54779
- label: "MobileCLIP S1"
54780
- }, {
54781
- id: "mobileclip-s2",
54782
- label: "MobileCLIP S2"
54783
- }]
54784
- }].map((s) => [s.stepId, s.defaultModelId])));
54785
- string().min(1);
54786
- var CLUSTER_STEP_SETTING_FIELDS = [{
54787
- stepId: "face-embedding",
54788
- key: "minLandmarkFaceSize",
54789
- label: "Min face size for recognition (detection px)",
54790
- description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",
54791
- type: "slider",
54792
- min: 0,
54793
- max: 64,
54794
- step: 2,
54795
- default: 24
54796
- }];
54797
- function clusterStepSettingKey(stepId, fieldKey) {
54798
- return `clusterStepSetting:${stepId}:${fieldKey}`;
54799
- }
54800
- var ClusterSettingNumberSchema = number().finite();
54801
- function readClusterStepSettings(config) {
54802
- const out = {};
54803
- for (const field of CLUSTER_STEP_SETTING_FIELDS) {
54804
- const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
54805
- const value = parsed.success ? parsed.data : field.default;
54806
- const existing = out[field.stepId] ?? {};
54807
- out[field.stepId] = {
54808
- ...existing,
54809
- [field.key]: value
54810
- };
54811
- }
54812
- return out;
54813
- }
54814
- readClusterStepSettings({});
54815
55435
  object({
54816
55436
  /**
54817
55437
  * Fraction of the box's own size added on EACH side before cutting.