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