@camstack/types 1.2.260 → 1.2.262
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.
- package/dist/addon/base-addon.d.ts +9 -1
- package/dist/addon.js +4 -6
- package/dist/addon.mjs +4 -6
- package/dist/capabilities/capability-definition.d.ts +9 -0
- package/dist/capabilities/custom-model-registry.cap.d.ts +18 -0
- package/dist/capabilities/device-extension.cap.d.ts +408 -0
- package/dist/capabilities/device-manager.cap.d.ts +59 -6
- package/dist/capabilities/doorbell.cap.d.ts +41 -1
- package/dist/capabilities/embedding-encoder.cap.d.ts +175 -0
- package/dist/capabilities/index.d.ts +15 -12
- package/dist/capabilities/llm-runtime.cap.d.ts +4 -4
- package/dist/capabilities/llm-shared.d.ts +6 -6
- package/dist/capabilities/llm.cap.d.ts +6 -6
- package/dist/capabilities/model-convert.cap.d.ts +9 -0
- package/dist/capabilities/model-distributor.cap.d.ts +18 -0
- package/dist/capabilities/notification-rules.cap.d.ts +32 -14
- package/dist/capabilities/osd-manager.cap.d.ts +6 -6
- package/dist/capabilities/pipeline-analytics.cap.d.ts +80 -2
- package/dist/capabilities/pipeline-executor.cap.d.ts +1 -0
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +62 -1
- package/dist/capabilities/pipeline-runner.cap.d.ts +24 -0
- package/dist/capabilities/vector-store.cap.d.ts +14 -0
- package/dist/device-extension/index.d.ts +3 -0
- package/dist/device-extension/slot-descriptor.d.ts +62 -0
- package/dist/device-extension/slot-provider.d.ts +70 -0
- package/dist/generated/addon-api.d.ts +39 -31
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/device-proxy.d.ts +8 -8
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/extension-slots.d.ts +40 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +4 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1483 -507
- package/dist/index.mjs +1422 -508
- package/dist/interfaces/addon.d.ts +41 -0
- package/dist/interfaces/event-bus.d.ts +10 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +73 -7
- package/dist/node.mjs +73 -8
- package/dist/pipeline/cluster-model-scope.d.ts +59 -3
- package/dist/pipeline/step-format-runnable.d.ts +31 -0
- package/dist/{sleep-BDYxE1ax.js → sleep-8K9gue-H.js} +56 -42
- package/dist/{sleep-BaRu0bS5.mjs → sleep-DC-wdyeS.mjs} +51 -43
- package/dist/storage/atomic-write.d.ts +25 -0
- package/dist/types/clip-model.d.ts +64 -0
- package/dist/types/models.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-8K9gue-H.js");
|
|
3
3
|
const require_event_category = require("./event-category-BVfsrBYA.js");
|
|
4
4
|
const require_canonical_hash = require("./canonical-hash-CSE4ioRi.js");
|
|
5
5
|
const require_enums = require("./enums.js");
|
|
@@ -5017,6 +5017,94 @@ function describeModelVariant(models, modelId) {
|
|
|
5017
5017
|
};
|
|
5018
5018
|
}
|
|
5019
5019
|
//#endregion
|
|
5020
|
+
//#region src/types/clip-model.ts
|
|
5021
|
+
/**
|
|
5022
|
+
* A CLIP model's feature-space contract — what every consumer of its vectors
|
|
5023
|
+
* must agree on, carried BY THE MODEL rather than re-derived by each consumer.
|
|
5024
|
+
*
|
|
5025
|
+
* ## Why this lives on the catalog entry
|
|
5026
|
+
*
|
|
5027
|
+
* Until 2026-09-26 each fact was hard-coded where it was used: the text window
|
|
5028
|
+
* (77) and pad id (0) in `text_encoder_inference.py`, the index name
|
|
5029
|
+
* (`object-clip`) in the object-embedding store, the "is this a CLIP vector"
|
|
5030
|
+
* test as `embeddingModelId.startsWith('mobileclip-')`, the search floor (0.2)
|
|
5031
|
+
* in the cap default, and the dimension (512) behind a `getModelMeta` that fell
|
|
5032
|
+
* back to MobileCLIP for any id it did not know. Every one of those is wrong for
|
|
5033
|
+
* the next model, and each one failed SILENTLY for SigLIP2 in the 2026-09-26
|
|
5034
|
+
* spike: vectors dropped before the store with no log, 768-d queries truncated
|
|
5035
|
+
* to 512 and ranked as garbage, 97% of true matches under the 0.2 floor (D649).
|
|
5036
|
+
*
|
|
5037
|
+
* A model now declares its own contract here, and a model with no `clip` block
|
|
5038
|
+
* is not a CLIP model to any consumer. That is also the seam Model Studio uses
|
|
5039
|
+
* for a user-supplied CLIP model: its registry row carries the same block.
|
|
5040
|
+
*/
|
|
5041
|
+
/**
|
|
5042
|
+
* `object-clip` (the historical MobileCLIP index, 512-d) or
|
|
5043
|
+
* `object-clip-<model>`. Lower-case and dash-only so the sqlite-vec table name
|
|
5044
|
+
* derived from it (`vec_` + non-word → `_`) cannot collide with another index's.
|
|
5045
|
+
*/
|
|
5046
|
+
var CLIP_VECTOR_INDEX_PATTERN = /^object-clip(-[a-z0-9][a-z0-9-]*)?$/;
|
|
5047
|
+
var ClipModelMetaSchema = zod.z.object({
|
|
5048
|
+
/** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
|
|
5049
|
+
textModelId: zod.z.string().min(1),
|
|
5050
|
+
/** Output dimension of BOTH towers. A vector of any other length is refused. */
|
|
5051
|
+
embeddingDim: zod.z.number().int().positive(),
|
|
5052
|
+
/**
|
|
5053
|
+
* The `vector-store` index this model's vectors live in. ONE feature space
|
|
5054
|
+
* per index: two models share an index only when their vectors are ranked
|
|
5055
|
+
* against each other, which for CLIP means never across families. MobileCLIP
|
|
5056
|
+
* S1 and S2 share `object-clip` for history (separated by the row's
|
|
5057
|
+
* `modelId`); any other model gets its own.
|
|
5058
|
+
*/
|
|
5059
|
+
vectorIndex: zod.z.string().regex(CLIP_VECTOR_INDEX_PATTERN),
|
|
5060
|
+
/**
|
|
5061
|
+
* The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
|
|
5062
|
+
* must be unique per tokenizer: every model's siblings land in ONE flat
|
|
5063
|
+
* models directory, so two different tokenizers under the same name would
|
|
5064
|
+
* silently overwrite each other (whichever model downloaded last wins, and
|
|
5065
|
+
* the other one tokenises with the wrong vocabulary).
|
|
5066
|
+
*/
|
|
5067
|
+
tokenizerFile: zod.z.string().min(1),
|
|
5068
|
+
/** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
|
|
5069
|
+
contextLength: zod.z.number().int().positive(),
|
|
5070
|
+
/** Id the tokenizer pads with. */
|
|
5071
|
+
padId: zod.z.number().int().nonnegative(),
|
|
5072
|
+
/**
|
|
5073
|
+
* The search cosine floor at `strictness: 'loose'` — calibrated per model,
|
|
5074
|
+
* because cosine bands are a property of the model: 0.2 keeps 96% of matched
|
|
5075
|
+
* COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
|
|
5076
|
+
*/
|
|
5077
|
+
searchMinScore: zod.z.number().min(0).max(1)
|
|
5078
|
+
});
|
|
5079
|
+
/**
|
|
5080
|
+
* Model-relative search strictness. The operator picks how picky, the model
|
|
5081
|
+
* says what that means in its own cosine band. On MobileCLIP (floor 0.2) these
|
|
5082
|
+
* reproduce the admin UI's historical absolute presets 0.20 / 0.25 / 0.30.
|
|
5083
|
+
*/
|
|
5084
|
+
var CLIP_SEARCH_STRICTNESS = [
|
|
5085
|
+
"loose",
|
|
5086
|
+
"balanced",
|
|
5087
|
+
"strict"
|
|
5088
|
+
];
|
|
5089
|
+
var ClipSearchStrictnessSchema = zod.z.enum(CLIP_SEARCH_STRICTNESS);
|
|
5090
|
+
var CLIP_STRICTNESS_FACTOR = {
|
|
5091
|
+
loose: 1,
|
|
5092
|
+
balanced: 1.25,
|
|
5093
|
+
strict: 1.5
|
|
5094
|
+
};
|
|
5095
|
+
/**
|
|
5096
|
+
* The cosine floor a search runs with.
|
|
5097
|
+
*
|
|
5098
|
+
* An explicit `minScore` is honoured verbatim: it is a number a caller chose,
|
|
5099
|
+
* and silently rescaling it would make the same URL mean different things on
|
|
5100
|
+
* two installs. Everything else is relative to the model.
|
|
5101
|
+
*/
|
|
5102
|
+
function resolveClipSearchMinScore(meta, request) {
|
|
5103
|
+
if (request.minScore !== void 0) return request.minScore;
|
|
5104
|
+
const factor = CLIP_STRICTNESS_FACTOR[request.strictness ?? "loose"];
|
|
5105
|
+
return Math.min(1, Math.round(meta.searchMinScore * factor * 1e3) / 1e3);
|
|
5106
|
+
}
|
|
5107
|
+
//#endregion
|
|
5020
5108
|
//#region src/types/models.ts
|
|
5021
5109
|
var MODEL_FORMATS = [
|
|
5022
5110
|
"onnx",
|
|
@@ -5241,7 +5329,14 @@ var ModelCatalogEntrySchema = zod.z.object({
|
|
|
5241
5329
|
* applies (Frigate / COCO public catalog). Set on a custom model whose raw
|
|
5242
5330
|
* labels already ARE the CamStack macros (Scrypted identity map).
|
|
5243
5331
|
*/
|
|
5244
|
-
classMap: DetectionCatalogClassMapSchema.optional()
|
|
5332
|
+
classMap: DetectionCatalogClassMapSchema.optional(),
|
|
5333
|
+
/**
|
|
5334
|
+
* The model's CLIP feature-space contract (text encoder, dimension, vector
|
|
5335
|
+
* index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
|
|
5336
|
+
* CLIP image encoder; its absence is what "not a CLIP model" means to the
|
|
5337
|
+
* embedding encoder and the semantic-search store (D649).
|
|
5338
|
+
*/
|
|
5339
|
+
clip: ClipModelMetaSchema.optional()
|
|
5245
5340
|
});
|
|
5246
5341
|
var ConvertTargetSchema = zod.z.discriminatedUnion("format", [zod.z.object({
|
|
5247
5342
|
format: zod.z.literal("openvino"),
|
|
@@ -12411,6 +12506,42 @@ var LinkedDeviceSchema = zod.z.object({
|
|
|
12411
12506
|
features: zod.z.array(zod.z.string()),
|
|
12412
12507
|
producesTrackedEvents: zod.z.boolean().optional()
|
|
12413
12508
|
});
|
|
12509
|
+
/**
|
|
12510
|
+
* The `linked-devices` extension slot's editable value (D648): the operator's
|
|
12511
|
+
* pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
|
|
12512
|
+
* in it — they are always linked and are not a pick.
|
|
12513
|
+
*
|
|
12514
|
+
* `trackedDeviceIds` (D655) is the tracked-event opt-in, exactly what
|
|
12515
|
+
* `_linkedDeviceTrackedIds` persists: which linked devices materialize a
|
|
12516
|
+
* synthetic tracked event on the camera. A read always carries it AS STORED
|
|
12517
|
+
* (an absent key reads as `[]`, which is what the resolver makes of it —
|
|
12518
|
+
* NONE). On a write it is optional: absent leaves the opt-in untouched, so a
|
|
12519
|
+
* card built before D655 cannot erase it by saving the pick list. A present
|
|
12520
|
+
* list REPLACES the opt-in; each id must be a pick, a device the camera links
|
|
12521
|
+
* by structure (the row's `impliedSources`: tree children, a picked
|
|
12522
|
+
* container's child) or already stored — so what was read can always be
|
|
12523
|
+
* written back unchanged, and a NEW opt-in outside the linked set is refused.
|
|
12524
|
+
*/
|
|
12525
|
+
var LinkedDevicesSlotValueSchema = zod.z.object({
|
|
12526
|
+
deviceIds: zod.z.array(zod.z.number().int().positive()),
|
|
12527
|
+
trackedDeviceIds: zod.z.array(zod.z.number().int().positive()).optional()
|
|
12528
|
+
});
|
|
12529
|
+
/**
|
|
12530
|
+
* The `linked-devices` slot — a camera's companion devices, owned by the
|
|
12531
|
+
* device manager over `_linkedDeviceIds` (D648, D356). Any device may be a
|
|
12532
|
+
* source except a container (its children are picked in its place) and the
|
|
12533
|
+
* camera itself.
|
|
12534
|
+
*/
|
|
12535
|
+
var LINKED_DEVICES_SLOT = {
|
|
12536
|
+
id: "linked-devices",
|
|
12537
|
+
label: "Linked devices",
|
|
12538
|
+
description: "Companion devices of this camera: their controls appear with it, and the ones you opt in produce tracked events on it.",
|
|
12539
|
+
shape: "association",
|
|
12540
|
+
hostDeviceTypes: [require_sleep.DeviceType.Camera],
|
|
12541
|
+
sourceCaps: "any",
|
|
12542
|
+
cardinality: "many",
|
|
12543
|
+
value: LinkedDevicesSlotValueSchema
|
|
12544
|
+
};
|
|
12414
12545
|
/** One camera's resolved linked set, tagged with the camera it belongs to.
|
|
12415
12546
|
* The batch answer needs the tag; the single-device answer already has it
|
|
12416
12547
|
* from the input, which is why `getLinkedDevices` keeps the untagged shape. */
|
|
@@ -12560,7 +12691,7 @@ var deviceManagerCapability = {
|
|
|
12560
12691
|
name: "device-manager",
|
|
12561
12692
|
scope: "system",
|
|
12562
12693
|
mode: "singleton",
|
|
12563
|
-
|
|
12694
|
+
extensionSlots: [LINKED_DEVICES_SLOT],
|
|
12564
12695
|
methods: {
|
|
12565
12696
|
/** Reserve (or re-resolve) a progressive numeric id for `(addonId, stableId)`.
|
|
12566
12697
|
* Idempotent: returns the existing id if one is already persisted for the
|
|
@@ -13063,11 +13194,12 @@ var deviceManagerCapability = {
|
|
|
13063
13194
|
/**
|
|
13064
13195
|
* Resolve the devices LINKED to a camera — the single policy authority
|
|
13065
13196
|
* both consumers call (viewer devices panel + pipeline-analytics event
|
|
13066
|
-
* kinds/ingest). Device-tree children are ALWAYS included
|
|
13067
|
-
*
|
|
13068
|
-
*
|
|
13069
|
-
* camera itself; deduped.
|
|
13070
|
-
*
|
|
13197
|
+
* kinds/ingest). Device-tree children are ALWAYS included, plus the
|
|
13198
|
+
* operator's persisted pick list (`mode` is always `manual` since D356:
|
|
13199
|
+
* same-location devices are suggested by the picker, never linked on
|
|
13200
|
+
* their own). Excludes the camera itself; deduped. The list is written by
|
|
13201
|
+
* the `linked-devices` extension slot over `_linkedDeviceIds` (see the
|
|
13202
|
+
* module docblock).
|
|
13071
13203
|
*/
|
|
13072
13204
|
getLinkedDevices: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.object({
|
|
13073
13205
|
mode: LinkedDevicesModeSchema,
|
|
@@ -13616,11 +13748,143 @@ var EmbeddingResultSchema = zod.z.object({
|
|
|
13616
13748
|
embedding: zod.z.array(zod.z.number()),
|
|
13617
13749
|
inferenceMs: zod.z.number()
|
|
13618
13750
|
});
|
|
13751
|
+
/** The two CLIP towers the encoder runs; a crash budget is kept per tower. */
|
|
13752
|
+
var EmbeddingTowerSchema = zod.z.enum(["image", "text"]);
|
|
13753
|
+
/**
|
|
13754
|
+
* A tower in the terminal `failed` state (D649, D6): it crashed or failed to
|
|
13755
|
+
* load `crashes` times within `windowMs`, and is refused by name until an
|
|
13756
|
+
* operator `resetFailedModels` or a model change — never on a timer.
|
|
13757
|
+
*
|
|
13758
|
+
* `nodeId` is the node whose tower failed. The state lives in THAT node's
|
|
13759
|
+
* encoder process (in memory — a runner respawn clears it), and one node's
|
|
13760
|
+
* answer says nothing about another's.
|
|
13761
|
+
*/
|
|
13762
|
+
var EmbeddingFailedModelSchema = zod.z.object({
|
|
13763
|
+
modelId: zod.z.string(),
|
|
13764
|
+
tower: EmbeddingTowerSchema,
|
|
13765
|
+
nodeId: zod.z.string(),
|
|
13766
|
+
crashes: zod.z.number(),
|
|
13767
|
+
windowMs: zod.z.number(),
|
|
13768
|
+
sinceMs: zod.z.number(),
|
|
13769
|
+
lastReason: zod.z.string()
|
|
13770
|
+
});
|
|
13771
|
+
/**
|
|
13772
|
+
* A model whose REQUIREMENTS can never be met on this node (D649 round 5):
|
|
13773
|
+
* an id the catalog does not know, a model URL answering 404/410, a declared
|
|
13774
|
+
* sibling (the tokenizer) that is not there. After `attempts` failed builds
|
|
13775
|
+
* it is terminally `requirements-failed`, refused by name until an operator
|
|
13776
|
+
* `resetFailedModels` or a model change — the same exits as a crashed tower.
|
|
13777
|
+
*/
|
|
13778
|
+
var EmbeddingFailedRequirementSchema = zod.z.object({
|
|
13779
|
+
modelId: zod.z.string(),
|
|
13780
|
+
tower: EmbeddingTowerSchema,
|
|
13781
|
+
nodeId: zod.z.string(),
|
|
13782
|
+
attempts: zod.z.number(),
|
|
13783
|
+
sinceMs: zod.z.number(),
|
|
13784
|
+
lastReason: zod.z.string()
|
|
13785
|
+
});
|
|
13619
13786
|
var EmbeddingInfoSchema = zod.z.object({
|
|
13620
13787
|
modelId: zod.z.string(),
|
|
13621
13788
|
embeddingDim: zod.z.number(),
|
|
13622
|
-
ready: zod.z.boolean()
|
|
13623
|
-
|
|
13789
|
+
ready: zod.z.boolean(),
|
|
13790
|
+
/**
|
|
13791
|
+
* The node that answered. Absent only from an encoder older than D649's
|
|
13792
|
+
* crash budget — whose `failedModels` is then UNKNOWN (D315), never "none".
|
|
13793
|
+
*/
|
|
13794
|
+
nodeId: zod.z.string().optional(),
|
|
13795
|
+
/**
|
|
13796
|
+
* Towers in `failed` on the answering node, each row naming it. `undefined`
|
|
13797
|
+
* means the node could not say (pre-budget encoder); a node that has the
|
|
13798
|
+
* budget always answers an array, empty included.
|
|
13799
|
+
*/
|
|
13800
|
+
failedModels: zod.z.array(EmbeddingFailedModelSchema).optional(),
|
|
13801
|
+
/** Models terminally `requirements-failed` on the answering node; same reading as above. */
|
|
13802
|
+
failedRequirements: zod.z.array(EmbeddingFailedRequirementSchema).optional()
|
|
13803
|
+
});
|
|
13804
|
+
/**
|
|
13805
|
+
* The THREE codes an encoder refusal can carry (D649, D6). Same shape as
|
|
13806
|
+
* `VECTOR_INDEX_DIM_CONFLICT`: the code rides in the MESSAGE, because an
|
|
13807
|
+
* Error's own properties do not survive the UDS/tRPC hop and its message does,
|
|
13808
|
+
* and both sides go through the helpers below — the encoder builds the
|
|
13809
|
+
* refusal, the live detail plane classifies on it to count refusals per
|
|
13810
|
+
* camera instead of logging one warning per track. The bracketed token
|
|
13811
|
+
* carries the code, the model, the tower and the node so a consumer never
|
|
13812
|
+
* parses prose.
|
|
13813
|
+
*
|
|
13814
|
+
* - `EMBEDDING_MODEL_FAILED`: the tower crashed / failed to load past the crash
|
|
13815
|
+
* budget — terminal until `resetFailedModels` or a model change.
|
|
13816
|
+
* - `EMBEDDING_REQUIREMENTS_UNAVAILABLE`: files or runtime not there right now
|
|
13817
|
+
* (a download or Python that failed, or the cooldown after one) — the next
|
|
13818
|
+
* request past the cooldown tries again.
|
|
13819
|
+
* - `EMBEDDING_REQUIREMENTS_FAILED`: the requirements can never be met (unknown
|
|
13820
|
+
* id, 404/410, missing sibling) and the bounded attempts are spent —
|
|
13821
|
+
* terminal, same exits as a crashed tower.
|
|
13822
|
+
*/
|
|
13823
|
+
var EMBEDDING_MODEL_FAILED = "embedding-model-failed";
|
|
13824
|
+
var EMBEDDING_REQUIREMENTS_UNAVAILABLE = "embedding-requirements-unavailable";
|
|
13825
|
+
var EMBEDDING_REQUIREMENTS_FAILED = "embedding-requirements-failed";
|
|
13826
|
+
var EmbeddingRefusalCodeSchema = zod.z.enum([
|
|
13827
|
+
EMBEDDING_MODEL_FAILED,
|
|
13828
|
+
EMBEDDING_REQUIREMENTS_UNAVAILABLE,
|
|
13829
|
+
EMBEDDING_REQUIREMENTS_FAILED
|
|
13830
|
+
]);
|
|
13831
|
+
function embeddingRefusalToken(code, on) {
|
|
13832
|
+
return `[${code} model=${on.modelId} tower=${on.tower} node=${on.nodeId}]`;
|
|
13833
|
+
}
|
|
13834
|
+
/** The encoder's refusal for a crashed tower, carrying {@link EMBEDDING_MODEL_FAILED}. */
|
|
13835
|
+
function embeddingModelFailedError(row) {
|
|
13836
|
+
return /* @__PURE__ */ new Error(`${embeddingRefusalToken(EMBEDDING_MODEL_FAILED, row)} ${row.modelId} (${row.tower} tower) crashed ${String(row.crashes)} times in ${String(Math.round(row.windowMs / 1e3))}s on ${row.nodeId} — ${row.lastReason}. Cleared by embeddingEncoder.resetFailedModels({ modelId: "${row.modelId}", nodeId: "${row.nodeId}" }) or a model change.`);
|
|
13837
|
+
}
|
|
13838
|
+
/** The requirements refusal for THIS request, carrying {@link EMBEDDING_REQUIREMENTS_UNAVAILABLE}. */
|
|
13839
|
+
function embeddingRequirementsUnavailableError(on, reason) {
|
|
13840
|
+
return /* @__PURE__ */ new Error(`${embeddingRefusalToken(EMBEDDING_REQUIREMENTS_UNAVAILABLE, on)} ${on.modelId} (${on.tower} tower) on ${on.nodeId}: ${reason}`);
|
|
13841
|
+
}
|
|
13842
|
+
/** The terminal requirements refusal, carrying {@link EMBEDDING_REQUIREMENTS_FAILED}. */
|
|
13843
|
+
function embeddingRequirementsFailedError(row) {
|
|
13844
|
+
return /* @__PURE__ */ new Error(`${embeddingRefusalToken(EMBEDDING_REQUIREMENTS_FAILED, row)} ${row.modelId} (${row.tower} tower) on ${row.nodeId}: requirements can never be met — ${String(row.attempts)} attempts, last: ${row.lastReason}. Cleared by embeddingEncoder.resetFailedModels({ modelId: "${row.modelId}", nodeId: "${row.nodeId}" }) or a model change.`);
|
|
13845
|
+
}
|
|
13846
|
+
var EMBEDDING_REFUSAL_TOKEN = new RegExp(`\\[(${EMBEDDING_MODEL_FAILED}|${EMBEDDING_REQUIREMENTS_UNAVAILABLE}|${EMBEDDING_REQUIREMENTS_FAILED}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);
|
|
13847
|
+
/** The refusal `err` (possibly re-wrapped by a transport) carries, or `null` for any other error. */
|
|
13848
|
+
function embeddingRefusalOf(err) {
|
|
13849
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
13850
|
+
const match = EMBEDDING_REFUSAL_TOKEN.exec(message);
|
|
13851
|
+
if (match === null) return null;
|
|
13852
|
+
const code = EmbeddingRefusalCodeSchema.safeParse(match[1]);
|
|
13853
|
+
const tower = EmbeddingTowerSchema.safeParse(match[3]);
|
|
13854
|
+
if (!code.success || !tower.success || match[2] === void 0 || match[4] === void 0) return null;
|
|
13855
|
+
return {
|
|
13856
|
+
code: code.data,
|
|
13857
|
+
modelId: match[2],
|
|
13858
|
+
tower: tower.data,
|
|
13859
|
+
nodeId: match[4]
|
|
13860
|
+
};
|
|
13861
|
+
}
|
|
13862
|
+
/** True when `err` is the crashed-tower refusal. */
|
|
13863
|
+
function isEmbeddingModelFailed(err) {
|
|
13864
|
+
return embeddingModelFailedOf(err) !== null;
|
|
13865
|
+
}
|
|
13866
|
+
/** The model, tower and node a crashed-tower refusal names, or `null` for any other error. */
|
|
13867
|
+
function embeddingModelFailedOf(err) {
|
|
13868
|
+
const refusal = embeddingRefusalOf(err);
|
|
13869
|
+
if (refusal === null || refusal.code !== "embedding-model-failed") return null;
|
|
13870
|
+
const { modelId, tower, nodeId } = refusal;
|
|
13871
|
+
return {
|
|
13872
|
+
modelId,
|
|
13873
|
+
tower,
|
|
13874
|
+
nodeId
|
|
13875
|
+
};
|
|
13876
|
+
}
|
|
13877
|
+
/**
|
|
13878
|
+
* ONE provider per node (`placement: any-node`), addressed like every global
|
|
13879
|
+
* collection: the codegen injects a `{ nodeId?, addonId? }` selector on the
|
|
13880
|
+
* void methods and lifts a top-level `nodeId` off the object ones. A call
|
|
13881
|
+
* that names no node is answered by the HUB's provider — never by a merge
|
|
13882
|
+
* across nodes, because no global collection fans out across nodes (only the
|
|
13883
|
+
* providers of one node are `concatCollection`-fanned). So a fleet view of
|
|
13884
|
+
* `failedModels` is one `getInfo({ nodeId })` per node, and every answer
|
|
13885
|
+
* names the node it came from (D649 round 4); a node that cannot be asked is
|
|
13886
|
+
* UNKNOWN to the reader, never "no failures" (D315).
|
|
13887
|
+
*/
|
|
13624
13888
|
var embeddingEncoderCapability = {
|
|
13625
13889
|
name: "embedding-encoder",
|
|
13626
13890
|
scope: "system",
|
|
@@ -13639,8 +13903,30 @@ var embeddingEncoderCapability = {
|
|
|
13639
13903
|
width: zod.z.number(),
|
|
13640
13904
|
height: zod.z.number()
|
|
13641
13905
|
}), EmbeddingResultSchema, { auth: "admin" }),
|
|
13642
|
-
|
|
13643
|
-
|
|
13906
|
+
/**
|
|
13907
|
+
* `modelId` (a CLIP IMAGE model id, whose catalog `clip.textModelId` names
|
|
13908
|
+
* the text tower) encodes in that model's space; absent, the cluster row's
|
|
13909
|
+
* `clip-embedding` model — the space every writer is in (D649).
|
|
13910
|
+
*/
|
|
13911
|
+
encodeText: require_sleep.method(zod.z.object({
|
|
13912
|
+
text: zod.z.string(),
|
|
13913
|
+
modelId: zod.z.string().min(1).optional()
|
|
13914
|
+
}), EmbeddingResultSchema, { auth: "admin" }),
|
|
13915
|
+
/** Answers for ONE node — the `nodeId` selector's, else the hub's. */
|
|
13916
|
+
getInfo: require_sleep.method(zod.z.void(), EmbeddingInfoSchema, { auth: "admin" }),
|
|
13917
|
+
/**
|
|
13918
|
+
* The operator's explicit clear of the `failed` state (one model, or all)
|
|
13919
|
+
* on ONE node — pass `nodeId` for an agent; the result names the node it
|
|
13920
|
+
* cleared. The only way out besides a model change: a crashing tower is
|
|
13921
|
+
* not retried on a timer.
|
|
13922
|
+
*/
|
|
13923
|
+
resetFailedModels: require_sleep.method(zod.z.object({ modelId: zod.z.string().min(1).optional() }), zod.z.object({
|
|
13924
|
+
cleared: zod.z.array(zod.z.string()),
|
|
13925
|
+
nodeId: zod.z.string()
|
|
13926
|
+
}), {
|
|
13927
|
+
kind: "mutation",
|
|
13928
|
+
auth: "admin"
|
|
13929
|
+
})
|
|
13644
13930
|
}
|
|
13645
13931
|
};
|
|
13646
13932
|
//#endregion
|
|
@@ -18030,6 +18316,24 @@ var NcMediaFrameSchema = zod.z.enum([
|
|
|
18030
18316
|
* sensor linked to one camera ships that camera's plain snapshot either way.
|
|
18031
18317
|
*/
|
|
18032
18318
|
var NcLinkedCameraModeSchema = zod.z.enum(["mosaic", "each"]);
|
|
18319
|
+
/**
|
|
18320
|
+
* The clip window a rule gets when it stores no `clipPreRollSec` /
|
|
18321
|
+
* `clipPostRollSec` (D654): 4 s before the moment, 6 s after.
|
|
18322
|
+
*
|
|
18323
|
+
* THE one owner. The Notification Center resolves an absent roll to these at
|
|
18324
|
+
* dispatch and sizes the broker's clip ring from them (`clip-retention-ask`).
|
|
18325
|
+
* The admin editor does not author the roll; the viewer editor still keeps its
|
|
18326
|
+
* own 3 / 7 until it imports these (viewer follow-up). A second copy is how the
|
|
18327
|
+
* viewer came to display 3 / 7 — copied from a stale comment on the schema
|
|
18328
|
+
* below — while the hub cut 4 / 6, and to prune a typed 3 back to "absent",
|
|
18329
|
+
* which the hub then read as 4.
|
|
18330
|
+
*
|
|
18331
|
+
* A product decision of the notification, not the broker's history window
|
|
18332
|
+
* (D381/D382): the clip is cut from the broker's per-camera clip ring, which
|
|
18333
|
+
* the rules size, not from a pre-roll dial.
|
|
18334
|
+
*/
|
|
18335
|
+
var NC_CLIP_PRE_ROLL_DEFAULT_SEC = 4;
|
|
18336
|
+
var NC_CLIP_POST_ROLL_DEFAULT_SEC = 6;
|
|
18033
18337
|
var NcMediaPolicySchema = zod.z.object({
|
|
18034
18338
|
attach: zod.z.enum([
|
|
18035
18339
|
"best",
|
|
@@ -18057,7 +18361,12 @@ var NcMediaPolicySchema = zod.z.object({
|
|
|
18057
18361
|
* the degrade engine, which drops the video and keeps the still.
|
|
18058
18362
|
*/
|
|
18059
18363
|
clip: zod.z.boolean().optional(),
|
|
18060
|
-
/**
|
|
18364
|
+
/**
|
|
18365
|
+
* Seconds of footage BEFORE / AFTER the event instant. Absent =
|
|
18366
|
+
* {@link NC_CLIP_PRE_ROLL_DEFAULT_SEC} / {@link NC_CLIP_POST_ROLL_DEFAULT_SEC}
|
|
18367
|
+
* (4 / 6), resolved by the Notification Center at dispatch — deliberately not
|
|
18368
|
+
* a Zod default, so a rule that never chose keeps following the hub's.
|
|
18369
|
+
*/
|
|
18061
18370
|
clipPreRollSec: zod.z.number().int().min(0).max(30).optional(),
|
|
18062
18371
|
clipPostRollSec: zod.z.number().int().min(0).max(30).optional(),
|
|
18063
18372
|
/**
|
|
@@ -20211,6 +20520,275 @@ var oauthIntegrationCapability = {
|
|
|
20211
20520
|
getDescriptor: require_sleep.method(zod.z.void(), OauthIntegrationDescriptorSchema, { auth: "admin" }) }
|
|
20212
20521
|
};
|
|
20213
20522
|
//#endregion
|
|
20523
|
+
//#region src/pipeline/cluster-model-scope.ts
|
|
20524
|
+
/**
|
|
20525
|
+
* A model choice has a SCOPE, and a scope change has a workflow.
|
|
20526
|
+
*
|
|
20527
|
+
* ## The two scopes
|
|
20528
|
+
*
|
|
20529
|
+
* Almost every pipeline step's model is a **node** question: which build runs
|
|
20530
|
+
* fastest on THIS accelerator. Two nodes may legitimately answer differently —
|
|
20531
|
+
* a Coral runs the tflite SSD, a Mac runs the coreml YOLO — because the answers
|
|
20532
|
+
* are compared against nothing. They produce boxes, and a box is a box.
|
|
20533
|
+
*
|
|
20534
|
+
* Two steps are not like that. `face-embedding` and `clip-embedding` produce
|
|
20535
|
+
* **vectors that land in ONE shared index** (`identity_samples`,
|
|
20536
|
+
* `vec_object_clip`) and are ranked against each other by cosine similarity.
|
|
20537
|
+
* Cosine similarity between two encoders is not a weak signal, it is a
|
|
20538
|
+
* meaningless number — and nothing inside a vector can tell you it happened.
|
|
20539
|
+
* So for those two steps the model is a **cluster** question with exactly one
|
|
20540
|
+
* answer, stored in exactly one row.
|
|
20541
|
+
*
|
|
20542
|
+
* That is the same argument [D52](../../../../docs/decisions/adr-0052.md) makes
|
|
20543
|
+
* for the crop convention (`detail-crop.ts`), one level up: the crop decides
|
|
20544
|
+
* WHAT pixels the encoder sees, this decides WHICH encoder sees them. Both are
|
|
20545
|
+
* cluster-wide for the same reason and neither may become per-node.
|
|
20546
|
+
*
|
|
20547
|
+
* ## Why the registry lives here and not in the step catalog
|
|
20548
|
+
*
|
|
20549
|
+
* The scope itself is declared on the step, in
|
|
20550
|
+
* `detection-pipeline/registry/step-definitions.ts` (`StepDefinition.modelScope`)
|
|
20551
|
+
* — that is where a new step declares what kind of choice its model is. But the
|
|
20552
|
+
* catalog lives inside `addon-pipeline`, and three packages that must NOT
|
|
20553
|
+
* import an addon need to know the set: the orchestrator (which renders and
|
|
20554
|
+
* stores the row), post-analysis (which pins the row for a re-embed pass) and
|
|
20555
|
+
* admin-ui (which mirrors it). So the set is mirrored here, and
|
|
20556
|
+
* `scripts/check-cluster-model-scope.ts` fails the build when the two disagree.
|
|
20557
|
+
* A hand-copied key that stops matching is exactly how a setting silently stops
|
|
20558
|
+
* arriving while both sides still look correct.
|
|
20559
|
+
*
|
|
20560
|
+
* ## The defaults ARE today's behaviour
|
|
20561
|
+
*
|
|
20562
|
+
* {@link DEFAULT_CLUSTER_STEP_MODELS} reproduces the catalog `defaultModelId`
|
|
20563
|
+
* of both steps. Declaring the scope therefore changes nothing on the day it
|
|
20564
|
+
* ships: the cluster row starts out saying what every node was already doing.
|
|
20565
|
+
* Changing it is legitimate — that is what the knob is for — but it invalidates
|
|
20566
|
+
* the stored vectors of that surface, and must be followed by a re-embed pass
|
|
20567
|
+
* (`face-reembed-pass.ts`, `embedding-rebuild.ts`).
|
|
20568
|
+
*/
|
|
20569
|
+
/**
|
|
20570
|
+
* Why the orchestrator cannot say which model the operator chose for a
|
|
20571
|
+
* cluster-scoped step (D651).
|
|
20572
|
+
*/
|
|
20573
|
+
var CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS = [
|
|
20574
|
+
"owner-not-ready",
|
|
20575
|
+
"store-read-failed",
|
|
20576
|
+
"three-way-read-unavailable",
|
|
20577
|
+
"invalid-stored",
|
|
20578
|
+
"not-cluster-scoped"
|
|
20579
|
+
];
|
|
20580
|
+
/**
|
|
20581
|
+
* The cluster-scoped steps. Mirrored from the catalog's `modelScope: 'cluster'`
|
|
20582
|
+
* declarations and guarded by `scripts/check-cluster-model-scope.ts`.
|
|
20583
|
+
*/
|
|
20584
|
+
var CLUSTER_MODEL_SCOPED_STEPS = [{
|
|
20585
|
+
stepId: "face-embedding",
|
|
20586
|
+
label: "Face recognition model",
|
|
20587
|
+
defaultModelId: "auraface-r100",
|
|
20588
|
+
indexName: "the enrolled face gallery",
|
|
20589
|
+
options: [
|
|
20590
|
+
{
|
|
20591
|
+
id: "auraface-r100",
|
|
20592
|
+
label: "AuraFace R100"
|
|
20593
|
+
},
|
|
20594
|
+
{
|
|
20595
|
+
id: "arcface-r100",
|
|
20596
|
+
label: "ArcFace (ResNet34)"
|
|
20597
|
+
},
|
|
20598
|
+
{
|
|
20599
|
+
id: "inception-resnet-v1",
|
|
20600
|
+
label: "Inception ResNet V1"
|
|
20601
|
+
}
|
|
20602
|
+
]
|
|
20603
|
+
}, {
|
|
20604
|
+
stepId: "clip-embedding",
|
|
20605
|
+
label: "Semantic search model",
|
|
20606
|
+
defaultModelId: "mobileclip-s1",
|
|
20607
|
+
indexName: "the object semantic-search index",
|
|
20608
|
+
options: [
|
|
20609
|
+
{
|
|
20610
|
+
id: "mobileclip-s1",
|
|
20611
|
+
label: "MobileCLIP S1"
|
|
20612
|
+
},
|
|
20613
|
+
{
|
|
20614
|
+
id: "mobileclip-s2",
|
|
20615
|
+
label: "MobileCLIP S2"
|
|
20616
|
+
},
|
|
20617
|
+
{
|
|
20618
|
+
id: "siglip2-b16-224",
|
|
20619
|
+
label: "SigLIP2 B/16 (Apache-2.0)"
|
|
20620
|
+
}
|
|
20621
|
+
]
|
|
20622
|
+
}];
|
|
20623
|
+
/**
|
|
20624
|
+
* Store identity of the cluster row inside `pipeline-orchestrator`'s GLOBAL
|
|
20625
|
+
* (cluster-wide) settings — the same owner, and for the same reason, as the
|
|
20626
|
+
* detail-crop convention: hub-resident and neutral between the addons that
|
|
20627
|
+
* read it.
|
|
20628
|
+
*/
|
|
20629
|
+
var CLUSTER_MODEL_SECTION_ID = "cluster-step-models";
|
|
20630
|
+
/**
|
|
20631
|
+
* The settings key holding one step's cluster model choice.
|
|
20632
|
+
*
|
|
20633
|
+
* Step-qualified so the keys stay unique across the addon's whole schema, which
|
|
20634
|
+
* is what lets {@link pickClusterStepModels} walk every section instead of
|
|
20635
|
+
* trusting the section id.
|
|
20636
|
+
*/
|
|
20637
|
+
function clusterModelSettingKey(stepId) {
|
|
20638
|
+
return `clusterModel:${stepId}`;
|
|
20639
|
+
}
|
|
20640
|
+
/** True when this step's model is a cluster-wide choice rather than a per-node one. */
|
|
20641
|
+
function isClusterScopedStep(stepId) {
|
|
20642
|
+
return CLUSTER_MODEL_SCOPED_STEPS.some((s) => s.stepId === stepId);
|
|
20643
|
+
}
|
|
20644
|
+
/** The cluster row when nobody has configured one — today's catalog defaults. */
|
|
20645
|
+
var DEFAULT_CLUSTER_STEP_MODELS = Object.freeze(Object.fromEntries(CLUSTER_MODEL_SCOPED_STEPS.map((s) => [s.stepId, s.defaultModelId])));
|
|
20646
|
+
function interpretStoredClusterModel(raw) {
|
|
20647
|
+
if (raw === void 0 || raw === null || raw === "") return { kind: "absent" };
|
|
20648
|
+
if (typeof raw === "string") return {
|
|
20649
|
+
kind: "chosen",
|
|
20650
|
+
modelId: raw
|
|
20651
|
+
};
|
|
20652
|
+
return {
|
|
20653
|
+
kind: "invalid",
|
|
20654
|
+
value: raw
|
|
20655
|
+
};
|
|
20656
|
+
}
|
|
20657
|
+
/**
|
|
20658
|
+
* The cluster-scoped steps whose stored value is `invalid` under
|
|
20659
|
+
* {@link interpretStoredClusterModel} — for the runtime's log line, so the
|
|
20660
|
+
* default it runs on such a row is never run in silence.
|
|
20661
|
+
*/
|
|
20662
|
+
function invalidClusterStepModelEntries(config) {
|
|
20663
|
+
const out = [];
|
|
20664
|
+
for (const step of CLUSTER_MODEL_SCOPED_STEPS) {
|
|
20665
|
+
const read = interpretStoredClusterModel(config[clusterModelSettingKey(step.stepId)]);
|
|
20666
|
+
if (read.kind === "invalid") out.push({
|
|
20667
|
+
stepId: step.stepId,
|
|
20668
|
+
value: read.value
|
|
20669
|
+
});
|
|
20670
|
+
}
|
|
20671
|
+
return out;
|
|
20672
|
+
}
|
|
20673
|
+
/**
|
|
20674
|
+
* Narrow a FLAT settings record to the cluster row.
|
|
20675
|
+
*
|
|
20676
|
+
* Per-FIELD fallback, deliberately (same rule as `readDetailCropConvention`): a
|
|
20677
|
+
* junk face model must not also discard a valid clip model. An `absent` or
|
|
20678
|
+
* `invalid` value ({@link interpretStoredClusterModel}) resolves to the step's
|
|
20679
|
+
* catalog default — never to a blank id, because a blank id downstream becomes
|
|
20680
|
+
* "substitute the format default", which is precisely the substitution this
|
|
20681
|
+
* scope exists to forbid.
|
|
20682
|
+
*/
|
|
20683
|
+
function readClusterStepModels(config) {
|
|
20684
|
+
const out = {};
|
|
20685
|
+
for (const step of CLUSTER_MODEL_SCOPED_STEPS) {
|
|
20686
|
+
const read = interpretStoredClusterModel(config[clusterModelSettingKey(step.stepId)]);
|
|
20687
|
+
out[step.stepId] = read.kind === "chosen" ? read.modelId : step.defaultModelId;
|
|
20688
|
+
}
|
|
20689
|
+
return out;
|
|
20690
|
+
}
|
|
20691
|
+
function isHydratedField$2(entry) {
|
|
20692
|
+
return typeof entry === "object" && entry !== null && "key" in entry;
|
|
20693
|
+
}
|
|
20694
|
+
/**
|
|
20695
|
+
* Extract the cluster row from an `addon-settings.getGlobalSettings` payload.
|
|
20696
|
+
*
|
|
20697
|
+
* Walks EVERY section rather than looking inside {@link CLUSTER_MODEL_SECTION_ID}
|
|
20698
|
+
* alone: the keys are unique across the addon's schema, and a section rename
|
|
20699
|
+
* must not silently revert the whole cluster to the defaults. A `null` payload
|
|
20700
|
+
* (addon mid-boot) is the defaults.
|
|
20701
|
+
*/
|
|
20702
|
+
function pickClusterStepModels(view) {
|
|
20703
|
+
if (view === null) return DEFAULT_CLUSTER_STEP_MODELS;
|
|
20704
|
+
return readClusterStepModels(flattenHydratedView(view, clusterModelKeys()));
|
|
20705
|
+
}
|
|
20706
|
+
/**
|
|
20707
|
+
* The `invalid` stored cluster model values a hydrated view carries — what the
|
|
20708
|
+
* runtime logs when it runs a default on a row it could not read as a choice.
|
|
20709
|
+
* A `null` view (owner mid-boot) carries nothing to judge.
|
|
20710
|
+
*/
|
|
20711
|
+
function pickInvalidClusterStepModels(view) {
|
|
20712
|
+
if (view === null) return [];
|
|
20713
|
+
return invalidClusterStepModelEntries(flattenHydratedView(view, clusterModelKeys()));
|
|
20714
|
+
}
|
|
20715
|
+
function clusterModelKeys() {
|
|
20716
|
+
return new Set(CLUSTER_MODEL_SCOPED_STEPS.map((s) => clusterModelSettingKey(s.stepId)));
|
|
20717
|
+
}
|
|
20718
|
+
/** The `wanted` keys of a hydrated view as one flat record, every section walked. */
|
|
20719
|
+
function flattenHydratedView(view, wanted) {
|
|
20720
|
+
const flat = {};
|
|
20721
|
+
for (const section of view.sections) for (const entry of section.fields) {
|
|
20722
|
+
if (!isHydratedField$2(entry) || typeof entry.key !== "string") continue;
|
|
20723
|
+
if (wanted.has(entry.key)) flat[entry.key] = entry.value;
|
|
20724
|
+
}
|
|
20725
|
+
return flat;
|
|
20726
|
+
}
|
|
20727
|
+
/**
|
|
20728
|
+
* The cluster model for `stepId`, or `null` when the step is node-scoped.
|
|
20729
|
+
*
|
|
20730
|
+
* `null` is the signal to LEAVE THE CALLER'S RESOLUTION ALONE — it is not "no
|
|
20731
|
+
* model". Returning a default here for a node-scoped step would quietly
|
|
20732
|
+
* override every per-(node,device) selection in the fleet.
|
|
20733
|
+
*/
|
|
20734
|
+
function resolveClusterStepModelId(stepId, models) {
|
|
20735
|
+
const step = CLUSTER_MODEL_SCOPED_STEPS.find((s) => s.stepId === stepId);
|
|
20736
|
+
if (step === void 0) return null;
|
|
20737
|
+
const chosen = models[stepId];
|
|
20738
|
+
return chosen !== void 0 && chosen !== "" ? chosen : step.defaultModelId;
|
|
20739
|
+
}
|
|
20740
|
+
/** Must match `DEFAULT_LANDMARK_PRECISION_FLOOR_PX` in the runner. */
|
|
20741
|
+
var DEFAULT_MIN_LANDMARK_FACE_SIZE_PX = 24;
|
|
20742
|
+
var CLUSTER_STEP_SETTING_FIELDS = [{
|
|
20743
|
+
stepId: "face-embedding",
|
|
20744
|
+
key: "minLandmarkFaceSize",
|
|
20745
|
+
label: "Min face size for recognition (detection px)",
|
|
20746
|
+
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.",
|
|
20747
|
+
type: "slider",
|
|
20748
|
+
min: 0,
|
|
20749
|
+
max: 64,
|
|
20750
|
+
step: 2,
|
|
20751
|
+
default: 24
|
|
20752
|
+
}];
|
|
20753
|
+
function clusterStepSettingKey(stepId, fieldKey) {
|
|
20754
|
+
return `clusterStepSetting:${stepId}:${fieldKey}`;
|
|
20755
|
+
}
|
|
20756
|
+
function clusterStepSettingFieldsFor(stepId) {
|
|
20757
|
+
return CLUSTER_STEP_SETTING_FIELDS.filter((field) => field.stepId === stepId);
|
|
20758
|
+
}
|
|
20759
|
+
var ClusterSettingNumberSchema = zod.z.number().finite();
|
|
20760
|
+
function readClusterStepSettings(config) {
|
|
20761
|
+
const out = {};
|
|
20762
|
+
for (const field of CLUSTER_STEP_SETTING_FIELDS) {
|
|
20763
|
+
const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
|
|
20764
|
+
const value = parsed.success ? parsed.data : field.default;
|
|
20765
|
+
const existing = out[field.stepId] ?? {};
|
|
20766
|
+
out[field.stepId] = {
|
|
20767
|
+
...existing,
|
|
20768
|
+
[field.key]: value
|
|
20769
|
+
};
|
|
20770
|
+
}
|
|
20771
|
+
return out;
|
|
20772
|
+
}
|
|
20773
|
+
var DEFAULT_CLUSTER_STEP_SETTINGS = readClusterStepSettings({});
|
|
20774
|
+
function pickClusterStepSettings(view) {
|
|
20775
|
+
if (view === null) return DEFAULT_CLUSTER_STEP_SETTINGS;
|
|
20776
|
+
return readClusterStepSettings(flattenHydratedView(view, new Set(CLUSTER_STEP_SETTING_FIELDS.map((field) => clusterStepSettingKey(field.stepId, field.key)))));
|
|
20777
|
+
}
|
|
20778
|
+
/**
|
|
20779
|
+
* Cluster knobs win over leftover per-device values. The cluster row is the
|
|
20780
|
+
* authority; a device-local copy is a leftover of the old per-node editor.
|
|
20781
|
+
*/
|
|
20782
|
+
function overlayClusterStepSettings(stepId, deviceSettings, cluster) {
|
|
20783
|
+
const overlay = cluster[stepId];
|
|
20784
|
+
if (overlay === void 0 || Object.keys(overlay).length === 0) return deviceSettings === void 0 ? void 0 : { ...deviceSettings };
|
|
20785
|
+
if (deviceSettings === void 0) return { ...overlay };
|
|
20786
|
+
return {
|
|
20787
|
+
...deviceSettings,
|
|
20788
|
+
...overlay
|
|
20789
|
+
};
|
|
20790
|
+
}
|
|
20791
|
+
//#endregion
|
|
20214
20792
|
//#region src/capabilities/pipeline-analytics.cap.ts
|
|
20215
20793
|
/**
|
|
20216
20794
|
* pipeline-analytics — device-scoped wrapper cap. Refines raw
|
|
@@ -21063,7 +21641,8 @@ var MediaFileKindEnum = zod.z.enum([
|
|
|
21063
21641
|
"thumbnailSmall",
|
|
21064
21642
|
"confirmationCrop",
|
|
21065
21643
|
"debugCrop",
|
|
21066
|
-
"sceneFrame"
|
|
21644
|
+
"sceneFrame",
|
|
21645
|
+
"lastSceneFrame"
|
|
21067
21646
|
]);
|
|
21068
21647
|
/**
|
|
21069
21648
|
* One media row's IDENTITY and shape, with no representation of its bytes.
|
|
@@ -21652,7 +22231,23 @@ var SearchObjectEventsInput = zod.z.object({
|
|
|
21652
22231
|
until: zod.z.number().optional(),
|
|
21653
22232
|
classFilter: zod.z.string().optional(),
|
|
21654
22233
|
limit: zod.z.number().default(50),
|
|
21655
|
-
|
|
22234
|
+
/**
|
|
22235
|
+
* An ABSOLUTE cosine floor. Optional since D649: a floor is a property of the
|
|
22236
|
+
* model (0.2 kept 96% of matched pairs on MobileCLIP S1 and 2.7% on SigLIP2),
|
|
22237
|
+
* so an absent one resolves to the searched model's own `searchMinScore`
|
|
22238
|
+
* scaled by `strictness`. A number sent here is honoured verbatim.
|
|
22239
|
+
*/
|
|
22240
|
+
minScore: zod.z.number().min(0).max(1).optional(),
|
|
22241
|
+
/** Model-relative floor — see `resolveClipSearchMinScore`. Default `loose`. */
|
|
22242
|
+
strictness: ClipSearchStrictnessSchema.optional(),
|
|
22243
|
+
/**
|
|
22244
|
+
* Search THIS CLIP model's index instead of the cluster row's. Every index a
|
|
22245
|
+
* model ever wrote stays searchable until it is wiped (the MobileCLIP index
|
|
22246
|
+
* through a SigLIP2 cutover and its rollback window). An id with no CLIP
|
|
22247
|
+
* metadata is refused; an id other than the cluster row's is ADMIN-only
|
|
22248
|
+
* (`model-override-requires-admin`).
|
|
22249
|
+
*/
|
|
22250
|
+
modelId: zod.z.string().min(1).optional()
|
|
21656
22251
|
});
|
|
21657
22252
|
var TrackCascadeCountsSchema = zod.z.object({
|
|
21658
22253
|
/** Persisted track roots deleted (authoritative). */
|
|
@@ -21787,7 +22382,41 @@ var RebuildObjectEmbeddingsInput = zod.z.object({
|
|
|
21787
22382
|
* comparable, so wiping and rebuilding is the only way to be sure every vector
|
|
21788
22383
|
* means the same thing.
|
|
21789
22384
|
*/
|
|
21790
|
-
var WipeObjectEmbeddingsResultSchema = zod.z.object({
|
|
22385
|
+
var WipeObjectEmbeddingsResultSchema = zod.z.object({
|
|
22386
|
+
deleted: zod.z.number(),
|
|
22387
|
+
/**
|
|
22388
|
+
* CLIP indexes that could NOT be emptied (unreachable, or refused at their
|
|
22389
|
+
* dimension) — not a clean slate. Additive and optional (D649).
|
|
22390
|
+
*/
|
|
22391
|
+
failedIndexes: zod.z.array(zod.z.string()).optional()
|
|
22392
|
+
});
|
|
22393
|
+
/**
|
|
22394
|
+
* Why a rebuild did not start, BY NAME — ONE vocabulary for both gates in front
|
|
22395
|
+
* of a pass (D649 over D651). A bare `started: false` read the same for "the
|
|
22396
|
+
* stores are booting" and "the cluster row names a model with no CLIP
|
|
22397
|
+
* metadata", which need different fixes.
|
|
22398
|
+
* - `stores-unavailable` — the analytics stores or the API are not up yet.
|
|
22399
|
+
* - the owner's confirmation of the cluster model (D651, `ClusterPinConfirmer`):
|
|
22400
|
+
* a pass that rewrites an index needs two agreeing reads of the OWNER's
|
|
22401
|
+
* answer (`pipelineOrchestrator.getClusterModelChoice`) — a pass that cannot
|
|
22402
|
+
* name its model does not run (D54):
|
|
22403
|
+
* - the owner's own `unreadable` reasons (`owner-not-ready`,
|
|
22404
|
+
* `store-read-failed`, `three-way-read-unavailable`, `invalid-stored`,
|
|
22405
|
+
* `not-cluster-scoped`);
|
|
22406
|
+
* - `method-unavailable` — the orchestrator predates the method;
|
|
22407
|
+
* - `read-failed` — the call failed or answered something unparseable;
|
|
22408
|
+
* - `reads-disagree` — the two reads named different choices.
|
|
22409
|
+
* - `not-a-clip-model` — the CONFIRMED id has no CLIP metadata, so there is no
|
|
22410
|
+
* index to fill and no dimension to check against (D649).
|
|
22411
|
+
*/
|
|
22412
|
+
var RebuildObjectEmbeddingsRefusalSchema = zod.z.enum([
|
|
22413
|
+
"stores-unavailable",
|
|
22414
|
+
...CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS,
|
|
22415
|
+
"method-unavailable",
|
|
22416
|
+
"read-failed",
|
|
22417
|
+
"reads-disagree",
|
|
22418
|
+
"not-a-clip-model"
|
|
22419
|
+
]);
|
|
21791
22420
|
/**
|
|
21792
22421
|
* Acknowledgement that a rebuild STARTED.
|
|
21793
22422
|
*
|
|
@@ -21800,7 +22429,12 @@ var WipeObjectEmbeddingsResultSchema = zod.z.object({ deleted: zod.z.number() })
|
|
|
21800
22429
|
var RebuildObjectEmbeddingsResultSchema = zod.z.object({
|
|
21801
22430
|
started: zod.z.boolean(),
|
|
21802
22431
|
/** True when a pass was already running; the new request is ignored. */
|
|
21803
|
-
alreadyRunning: zod.z.boolean()
|
|
22432
|
+
alreadyRunning: zod.z.boolean(),
|
|
22433
|
+
/** Present when the pass refused to start — see `RebuildObjectEmbeddingsRefusalSchema`. */
|
|
22434
|
+
refusal: RebuildObjectEmbeddingsRefusalSchema.optional(),
|
|
22435
|
+
/** The CLIP model the pass pinned, and the index it fills (when it started). */
|
|
22436
|
+
modelId: zod.z.string().optional(),
|
|
22437
|
+
index: zod.z.string().optional()
|
|
21804
22438
|
});
|
|
21805
22439
|
var RebuildStatusSchema = zod.z.object({
|
|
21806
22440
|
running: zod.z.boolean(),
|
|
@@ -21834,7 +22468,11 @@ var RebuildStatusSchema = zod.z.object({
|
|
|
21834
22468
|
startedAtMs: zod.z.number().nullable(),
|
|
21835
22469
|
finishedAtMs: zod.z.number().nullable(),
|
|
21836
22470
|
/** Present when the pass ended by throwing. */
|
|
21837
|
-
error: zod.z.string().nullable()
|
|
22471
|
+
error: zod.z.string().nullable(),
|
|
22472
|
+
/** The CLIP model the current / last pass pinned (D54), `null` before any. */
|
|
22473
|
+
modelId: zod.z.string().nullable(),
|
|
22474
|
+
/** The index that pass fills — `ClipModelMeta.vectorIndex` of `modelId` (D649). */
|
|
22475
|
+
index: zod.z.string().nullable()
|
|
21838
22476
|
});
|
|
21839
22477
|
/**
|
|
21840
22478
|
* Acknowledgement that a debug-media reclaim STARTED.
|
|
@@ -22812,7 +23450,7 @@ var pipelineAnalyticsCapability = {
|
|
|
22812
23450
|
* ObjectEvents by trackId. Returns up to `limit` events scored ≥
|
|
22813
23451
|
* `minScore`, sorted descending by score.
|
|
22814
23452
|
*/
|
|
22815
|
-
searchObjectEvents: require_sleep.method(SearchObjectEventsInput, zod.z.array(ScoredObjectEventSchema).readonly()),
|
|
23453
|
+
searchObjectEvents: require_sleep.method(SearchObjectEventsInput, zod.z.array(ScoredObjectEventSchema).readonly(), { caller: "required" }),
|
|
22816
23454
|
wipeObjectEmbeddings: require_sleep.method(zod.z.object({}), WipeObjectEmbeddingsResultSchema, {
|
|
22817
23455
|
kind: "mutation",
|
|
22818
23456
|
auth: "admin"
|
|
@@ -23456,7 +24094,14 @@ var pipelineExecutorCapability = {
|
|
|
23456
24094
|
*/
|
|
23457
24095
|
inferCached: require_sleep.method(zod.z.object({
|
|
23458
24096
|
stepId: zod.z.string(),
|
|
23459
|
-
frameId: zod.z.number().int()
|
|
24097
|
+
frameId: zod.z.number().int(),
|
|
24098
|
+
/**
|
|
24099
|
+
* The model to time — REQUIRED (D658). Without it the pool answered the
|
|
24100
|
+
* step's ACTIVE variant (the first loaded after boot), so a benchmark
|
|
24101
|
+
* of model B silently timed model A. Callers pass the `rootModelId`
|
|
24102
|
+
* their warmup `runPipeline` reported: the model that actually ran.
|
|
24103
|
+
*/
|
|
24104
|
+
modelId: zod.z.string().min(1)
|
|
23460
24105
|
}), zod.z.record(zod.z.string(), zod.z.unknown()), { kind: "mutation" }),
|
|
23461
24106
|
/**
|
|
23462
24107
|
* Release a cached frame from the Python pool's memory.
|
|
@@ -24115,6 +24760,17 @@ var RunnerFrameSourceSchema = zod.z.discriminatedUnion("kind", [zod.z.object({ k
|
|
|
24115
24760
|
hubHostnameOverride: zod.z.string().optional()
|
|
24116
24761
|
})]).describe("Per-camera frame-source mode for the runner (P2c)");
|
|
24117
24762
|
/**
|
|
24763
|
+
* What ONE step runs with on ONE roster device for THIS camera (D650): the
|
|
24764
|
+
* device's per-(node,device) base with the camera's override for that device
|
|
24765
|
+
* on top — the same `override ?? base` merge the orchestrator applies to the
|
|
24766
|
+
* elected device (`applyDeviceProvisioning`). Absent `modelId` ⇒ the executor
|
|
24767
|
+
* resolves the device format's default, exactly as on the elected device.
|
|
24768
|
+
*/
|
|
24769
|
+
var RunnerJumpStepProvisioningSchema = zod.z.object({
|
|
24770
|
+
modelId: zod.z.string().optional(),
|
|
24771
|
+
settings: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
24772
|
+
});
|
|
24773
|
+
/**
|
|
24118
24774
|
* One ENABLED inference device on the runner's node, as the step-tree
|
|
24119
24775
|
* device-jump resolver sees it (phase 1). The orchestrator populates this
|
|
24120
24776
|
* roster on the attach payload whenever the camera is elected onto a specific
|
|
@@ -24126,7 +24782,16 @@ var RunnerFrameSourceSchema = zod.z.discriminatedUnion("kind", [zod.z.object({ k
|
|
|
24126
24782
|
var RunnerInferenceDeviceSchema = zod.z.object({
|
|
24127
24783
|
deviceKey: zod.z.string(),
|
|
24128
24784
|
weight: zod.z.number().positive().default(1),
|
|
24129
|
-
maxSessions: zod.z.number().int().positive().nullable().default(null)
|
|
24785
|
+
maxSessions: zod.z.number().int().positive().nullable().default(null),
|
|
24786
|
+
/**
|
|
24787
|
+
* Per-step provisioning for this camera on THIS device (D650), keyed by step
|
|
24788
|
+
* id. A step the runner jumps here runs with these fields, never with the
|
|
24789
|
+
* elected device's: `modelId` / `settings` are REPLACED on the jumped subtree
|
|
24790
|
+
* (a step absent from the map runs with neither — the target format default).
|
|
24791
|
+
* Absent field ⇒ an orchestrator that predates D650: the jumped step keeps
|
|
24792
|
+
* the elected device's provisioning, as before.
|
|
24793
|
+
*/
|
|
24794
|
+
steps: zod.z.record(zod.z.string(), RunnerJumpStepProvisioningSchema).optional()
|
|
24130
24795
|
});
|
|
24131
24796
|
/**
|
|
24132
24797
|
* Camera assignment payload sent by `addon-pipeline-orchestrator` to a
|
|
@@ -25438,6 +26103,28 @@ var NodeInferenceDeviceSchema = zod.z.object({
|
|
|
25438
26103
|
*/
|
|
25439
26104
|
exclusion: InferenceDeviceExclusionReasonSchema.nullable()
|
|
25440
26105
|
});
|
|
26106
|
+
/**
|
|
26107
|
+
* The operator's model choice for one cluster-scoped step, answered by the
|
|
26108
|
+
* addon that OWNS the `clusterModel:*` settings (D651). Three answers, never
|
|
26109
|
+
* folded: a written choice, a key nobody wrote (the cluster runs the default
|
|
26110
|
+
* BY ABSENCE), or no answer. A caller that rewrites an index acts only on the
|
|
26111
|
+
* first two, read twice and agreeing.
|
|
26112
|
+
*/
|
|
26113
|
+
var ClusterModelChoiceSchema = zod.z.discriminatedUnion("kind", [
|
|
26114
|
+
zod.z.object({
|
|
26115
|
+
kind: zod.z.literal("stored"),
|
|
26116
|
+
modelId: zod.z.string()
|
|
26117
|
+
}),
|
|
26118
|
+
zod.z.object({
|
|
26119
|
+
kind: zod.z.literal("absent"),
|
|
26120
|
+
defaultModelId: zod.z.string()
|
|
26121
|
+
}),
|
|
26122
|
+
zod.z.object({
|
|
26123
|
+
kind: zod.z.literal("unreadable"),
|
|
26124
|
+
reason: zod.z.enum(CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS),
|
|
26125
|
+
error: zod.z.string().optional()
|
|
26126
|
+
})
|
|
26127
|
+
]);
|
|
25441
26128
|
var NodeInferenceDevicesSchema = zod.z.object({
|
|
25442
26129
|
nodeId: zod.z.string(),
|
|
25443
26130
|
/** False when the node's platform-probe was unreachable (no live device set). */
|
|
@@ -25534,9 +26221,19 @@ var pipelineOrchestratorCapability = {
|
|
|
25534
26221
|
* Trigger a full rebalance pass. Iterates over all assigned cameras,
|
|
25535
26222
|
* recomputes the optimal agent for each one based on current load +
|
|
25536
26223
|
* hardware affinity, and migrates cameras whose current agent is no
|
|
25537
|
-
* longer optimal. Pinned cameras are never migrated.
|
|
26224
|
+
* longer optimal. Pinned cameras are never migrated. `skipped` names the
|
|
26225
|
+
* cameras the pass wanted to move and could not, with why — a target node
|
|
26226
|
+
* that has not answered its catalog / device health yet, or a device that
|
|
26227
|
+
* cannot run the camera's root (D650).
|
|
25538
26228
|
*/
|
|
25539
|
-
rebalance: require_sleep.method(zod.z.void(), zod.z.object({
|
|
26229
|
+
rebalance: require_sleep.method(zod.z.void(), zod.z.object({
|
|
26230
|
+
migrated: zod.z.number(),
|
|
26231
|
+
skipped: zod.z.array(zod.z.object({
|
|
26232
|
+
deviceId: zod.z.number(),
|
|
26233
|
+
targetNodeId: zod.z.string(),
|
|
26234
|
+
reason: zod.z.string()
|
|
26235
|
+
})).default([])
|
|
26236
|
+
}), {
|
|
25540
26237
|
kind: "mutation",
|
|
25541
26238
|
auth: "admin"
|
|
25542
26239
|
}),
|
|
@@ -25546,6 +26243,13 @@ var pipelineOrchestratorCapability = {
|
|
|
25546
26243
|
getPipelineAssignment: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), PipelineAssignmentSchema.nullable()),
|
|
25547
26244
|
/** Get per-agent load summaries used by the load balancer + dashboards. */
|
|
25548
26245
|
getAgentLoad: require_sleep.method(zod.z.void(), zod.z.array(AgentLoadSummarySchema).readonly()),
|
|
26246
|
+
/**
|
|
26247
|
+
* The operator's STORED model choice for one cluster-scoped step (D651).
|
|
26248
|
+
* Read three-way from this addon's own store, only once its boot has
|
|
26249
|
+
* settled. Unlike `addonSettings.getGlobalSettings`, it never answers a
|
|
26250
|
+
* default as though someone chose it.
|
|
26251
|
+
*/
|
|
26252
|
+
getClusterModelChoice: require_sleep.method(zod.z.object({ stepId: zod.z.string() }), ClusterModelChoiceSchema),
|
|
25549
26253
|
/** Aggregate global metrics across the whole detection cluster. */
|
|
25550
26254
|
getGlobalMetrics: require_sleep.method(zod.z.void(), GlobalMetricsSchema),
|
|
25551
26255
|
/**
|
|
@@ -28074,6 +28778,24 @@ var VectorScanResultSchema = zod.z.object({
|
|
|
28074
28778
|
*/
|
|
28075
28779
|
nextCursor: zod.z.number().int().nonnegative().nullable()
|
|
28076
28780
|
});
|
|
28781
|
+
/**
|
|
28782
|
+
* The ONE error code for "this index exists at another dimension; refusing to
|
|
28783
|
+
* redeclare it" (D649). It rides in the MESSAGE — an Error's own properties do
|
|
28784
|
+
* not survive the UDS/tRPC hop, its message does — and both sides go through
|
|
28785
|
+
* the helpers below, never a copied phrase: a consumer that must tell "this
|
|
28786
|
+
* index can never hold my vectors" from "the provider is unreachable" (a
|
|
28787
|
+
* delete counts the first as nothing-to-delete and the second as still
|
|
28788
|
+
* present) otherwise breaks silently the day the wording changes.
|
|
28789
|
+
*/
|
|
28790
|
+
var VECTOR_INDEX_DIM_CONFLICT = "vector-index-dim-conflict";
|
|
28791
|
+
/** The provider's refusal, carrying {@link VECTOR_INDEX_DIM_CONFLICT}. */
|
|
28792
|
+
function vectorIndexDimConflictError(index, declaredDim, requestedDim) {
|
|
28793
|
+
return /* @__PURE__ */ new Error(`[${VECTOR_INDEX_DIM_CONFLICT}] vector-store: index "${index}" is declared with dim ${String(declaredDim)}; refusing to redeclare as ${String(requestedDim)}`);
|
|
28794
|
+
}
|
|
28795
|
+
/** True when `err` (possibly re-wrapped by a transport) is that refusal. */
|
|
28796
|
+
function isVectorIndexDimConflict(err) {
|
|
28797
|
+
return (err instanceof Error ? err.message : String(err)).includes(`[${VECTOR_INDEX_DIM_CONFLICT}]`);
|
|
28798
|
+
}
|
|
28077
28799
|
var VectorStatsInputSchema = zod.z.object({ index: zod.z.string() });
|
|
28078
28800
|
var VectorStatsResultSchema = zod.z.object({
|
|
28079
28801
|
/** Provider id, so an operator can tell brute force from an ANN index. */
|
|
@@ -29254,6 +29976,496 @@ var CLIP_PLAYBACK_OPTIONS = {
|
|
|
29254
29976
|
}
|
|
29255
29977
|
};
|
|
29256
29978
|
//#endregion
|
|
29979
|
+
//#region src/catalogs/sensor-active-state.ts
|
|
29980
|
+
/**
|
|
29981
|
+
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
29982
|
+
* valutatore puro del suo FRONTE.
|
|
29983
|
+
*
|
|
29984
|
+
* Viveva dentro il builtin virtual-doorbell
|
|
29985
|
+
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
29986
|
+
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
29987
|
+
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
29988
|
+
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
29989
|
+
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
29990
|
+
* SPOSTA qui e il doorbell la ri-esporta.
|
|
29991
|
+
*
|
|
29992
|
+
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
29993
|
+
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
29994
|
+
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
29995
|
+
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
29996
|
+
*/
|
|
29997
|
+
/**
|
|
29998
|
+
* Known binary / switch source caps → the boolean slice field whose
|
|
29999
|
+
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
30000
|
+
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
30001
|
+
* state, connectivity's connected flag) are deliberately excluded — a
|
|
30002
|
+
* reconnect is not a doorbell press, and it is not a recording either.
|
|
30003
|
+
*/
|
|
30004
|
+
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
30005
|
+
contact: "entryOpen",
|
|
30006
|
+
binary: "on",
|
|
30007
|
+
switch: "on",
|
|
30008
|
+
motion: "detected",
|
|
30009
|
+
flood: "flooded",
|
|
30010
|
+
gas: "detected",
|
|
30011
|
+
smoke: "detected",
|
|
30012
|
+
"carbon-monoxide": "detected",
|
|
30013
|
+
vibration: "detected",
|
|
30014
|
+
tamper: "tampered"
|
|
30015
|
+
};
|
|
30016
|
+
/**
|
|
30017
|
+
* The same caps → the slice field carrying the ms-epoch timestamp of the
|
|
30018
|
+
* last transition. Every source cap MUST appear here (guarded by a spec):
|
|
30019
|
+
* without a transition timestamp the evaluator cannot tell a genuine rise
|
|
30020
|
+
* from a boot-time hydration when the FIRST slice it ever sees is already
|
|
30021
|
+
* active, and errs towards silence — swallowing the rise.
|
|
30022
|
+
*
|
|
30023
|
+
* These timestamps are UPSTREAM ones, not ingest ones: the Home Assistant
|
|
30024
|
+
* provider derives them from `state.last_changed`, so they survive our own
|
|
30025
|
+
* restarts and correctly read as "hours ago" for a state that has been
|
|
30026
|
+
* active for hours. `motion` names its rise timestamp `lastDetectedAt`.
|
|
30027
|
+
*/
|
|
30028
|
+
var SOURCE_CAP_CHANGED_AT_FIELD = {
|
|
30029
|
+
contact: "lastChangedAt",
|
|
30030
|
+
binary: "lastChangedAt",
|
|
30031
|
+
switch: "lastChangedAt",
|
|
30032
|
+
motion: "lastDetectedAt",
|
|
30033
|
+
flood: "lastChangedAt",
|
|
30034
|
+
gas: "lastChangedAt",
|
|
30035
|
+
smoke: "lastChangedAt",
|
|
30036
|
+
"carbon-monoxide": "lastChangedAt",
|
|
30037
|
+
vibration: "lastChangedAt",
|
|
30038
|
+
tamper: "lastChangedAt"
|
|
30039
|
+
};
|
|
30040
|
+
/** Cap names whose presence in a device's bindings qualify it as a source. */
|
|
30041
|
+
var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
|
|
30042
|
+
/**
|
|
30043
|
+
* Device `type` values (from `DeviceType`) that can host a binary/switch
|
|
30044
|
+
* source cap. Used by the camera's `device-multiselect` picker as the
|
|
30045
|
+
* CLIENT-SIDE filter, alongside `SOURCE_CAPS`.
|
|
30046
|
+
*
|
|
30047
|
+
* Why types and not caps alone: the shared picker filters
|
|
30048
|
+
* `deviceManager.listAll` rows client-side, and those rows carry only the
|
|
30049
|
+
* device's advertised `features` — NOT its registered cap list. On the live
|
|
30050
|
+
* cluster binary sensors and switches advertise EMPTY features (features
|
|
30051
|
+
* mirror only a handful of caps like `motion-trigger`), so a caps-only
|
|
30052
|
+
* filter matched against `features` would list nothing (the very bug this
|
|
30053
|
+
* replaced, which relied on the now-empty `getAllBindings`). Matching by
|
|
30054
|
+
* `type` is the reliable client-side signal; the union with `SOURCE_CAPS`
|
|
30055
|
+
* still captures any device that DOES advertise a source-cap feature.
|
|
30056
|
+
* `sensor` covers contact/motion/flood/gas/smoke/CO/vibration/tamper,
|
|
30057
|
+
* `switch` covers switches, `control` covers generic binary actuators.
|
|
30058
|
+
*/
|
|
30059
|
+
var SOURCE_DEVICE_TYPES = [
|
|
30060
|
+
"sensor",
|
|
30061
|
+
"switch",
|
|
30062
|
+
"control"
|
|
30063
|
+
];
|
|
30064
|
+
/** True when a cap is a recognised binary/switch source. */
|
|
30065
|
+
function isSourceCap(capName) {
|
|
30066
|
+
return Object.prototype.hasOwnProperty.call(SOURCE_CAP_ACTIVE_FIELD, capName);
|
|
30067
|
+
}
|
|
30068
|
+
/** Extract the "active" boolean a source cap's slice carries, or null when
|
|
30069
|
+
* the cap is unknown or the field is missing / non-boolean. */
|
|
30070
|
+
function sliceActiveValue(capName, slice) {
|
|
30071
|
+
const field = SOURCE_CAP_ACTIVE_FIELD[capName];
|
|
30072
|
+
if (field === void 0) return null;
|
|
30073
|
+
const raw = slice[field];
|
|
30074
|
+
return typeof raw === "boolean" ? raw : null;
|
|
30075
|
+
}
|
|
30076
|
+
/** Ms-epoch transition timestamp a source cap's slice carries, or null when
|
|
30077
|
+
* it is absent, non-numeric or the zero "never observed" sentinel. */
|
|
30078
|
+
function sliceChangedAt(capName, slice) {
|
|
30079
|
+
const field = SOURCE_CAP_CHANGED_AT_FIELD[capName];
|
|
30080
|
+
if (field === void 0) return null;
|
|
30081
|
+
const raw = slice[field];
|
|
30082
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return null;
|
|
30083
|
+
return raw;
|
|
30084
|
+
}
|
|
30085
|
+
/**
|
|
30086
|
+
* How recent a source's own transition timestamp must be for a FIRST
|
|
30087
|
+
* sighting that is already active to count as a genuine rise rather than a
|
|
30088
|
+
* hydration of long-standing state.
|
|
30089
|
+
*/
|
|
30090
|
+
var DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = 3e4;
|
|
30091
|
+
/**
|
|
30092
|
+
* IL fronte. Puro: nessun orologio proprio, nessuna memoria — il chiamante
|
|
30093
|
+
* porta `prior`, `nowMs` e il proprio `startedAtMs`.
|
|
30094
|
+
*
|
|
30095
|
+
* Il caso della PRIMA slice già attiva è trattato esplicitamente e vale come
|
|
30096
|
+
* fronte solo se il timestamp UPSTREAM della transizione è posteriore a
|
|
30097
|
+
* `startedAtMs` **e** entro `firstSightingFreshnessMs`. Entrambe le metà
|
|
30098
|
+
* servono: la sola freschezza scatterebbe su un'idratazione al boot di uno
|
|
30099
|
+
* stato flippato pochi secondi prima del riavvio, e il solo "dopo che abbiamo
|
|
30100
|
+
* iniziato" scatterebbe, su un processo di lunga vita, per una sorgente
|
|
30101
|
+
* adottata oggi il cui stato è cambiato ieri. Il caso ambiguo ERRA VERSO IL
|
|
30102
|
+
* SILENZIO e lo dichiara (`baseline-seeded-stale-active`).
|
|
30103
|
+
*/
|
|
30104
|
+
function evaluateSensorEdge(input) {
|
|
30105
|
+
const value = sliceActiveValue(input.capName, input.slice);
|
|
30106
|
+
if (value === null) return {
|
|
30107
|
+
edge: "none",
|
|
30108
|
+
value: null,
|
|
30109
|
+
reason: isSourceCap(input.capName) ? "non-boolean-value" : "unknown-cap"
|
|
30110
|
+
};
|
|
30111
|
+
if (input.prior === void 0) {
|
|
30112
|
+
if (!value) return {
|
|
30113
|
+
edge: "none",
|
|
30114
|
+
value,
|
|
30115
|
+
reason: "baseline-seeded-inactive"
|
|
30116
|
+
};
|
|
30117
|
+
const changedAt = sliceChangedAt(input.capName, input.slice);
|
|
30118
|
+
const floor = Math.max(input.startedAtMs, input.nowMs - input.firstSightingFreshnessMs);
|
|
30119
|
+
if (changedAt === null || changedAt < floor) return {
|
|
30120
|
+
edge: "none",
|
|
30121
|
+
value,
|
|
30122
|
+
reason: "baseline-seeded-stale-active"
|
|
30123
|
+
};
|
|
30124
|
+
return {
|
|
30125
|
+
edge: "rising",
|
|
30126
|
+
value: true
|
|
30127
|
+
};
|
|
30128
|
+
}
|
|
30129
|
+
if (input.prior === value) return {
|
|
30130
|
+
edge: "none",
|
|
30131
|
+
value,
|
|
30132
|
+
reason: "no-change"
|
|
30133
|
+
};
|
|
30134
|
+
if (!value) return {
|
|
30135
|
+
edge: "none",
|
|
30136
|
+
value,
|
|
30137
|
+
reason: "falling-edge"
|
|
30138
|
+
};
|
|
30139
|
+
return {
|
|
30140
|
+
edge: "rising",
|
|
30141
|
+
value: true
|
|
30142
|
+
};
|
|
30143
|
+
}
|
|
30144
|
+
//#endregion
|
|
30145
|
+
//#region src/capabilities/doorbell.cap.ts
|
|
30146
|
+
/**
|
|
30147
|
+
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
30148
|
+
* name (same pattern as `snapshot`):
|
|
30149
|
+
*
|
|
30150
|
+
* - **Native** providers: registered per-device by device-driver
|
|
30151
|
+
* addons via `ctx.registerNativeCap` — either on a
|
|
30152
|
+
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
30153
|
+
* or directly on the camera (Reolink registers at camera level).
|
|
30154
|
+
* Emits an `onPressed` event every time the firmware pushes a
|
|
30155
|
+
* ring; status tracks the last press and a pressCount since start
|
|
30156
|
+
* (diagnostic).
|
|
30157
|
+
*
|
|
30158
|
+
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
30159
|
+
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
30160
|
+
* device (contact / switch / event-emitter …) into a doorbell for
|
|
30161
|
+
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
30162
|
+
* it per camera in the device-bindings UI, then picks the source
|
|
30163
|
+
* device + trigger in the per-device settings.
|
|
30164
|
+
*
|
|
30165
|
+
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
30166
|
+
* — subscribers listening at the camera level receive ring events
|
|
30167
|
+
* with `via[]` populated. No code on the parent needed.
|
|
30168
|
+
*/
|
|
30169
|
+
var DoorbellStatusSchema = zod.z.object({
|
|
30170
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
30171
|
+
lastPressedAt: zod.z.number().nullable(),
|
|
30172
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
30173
|
+
pressCountSinceStart: zod.z.number()
|
|
30174
|
+
});
|
|
30175
|
+
var DoorbellPressEventSchema = zod.z.object({
|
|
30176
|
+
deviceId: zod.z.number(),
|
|
30177
|
+
timestamp: zod.z.number()
|
|
30178
|
+
});
|
|
30179
|
+
/**
|
|
30180
|
+
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
30181
|
+
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
30182
|
+
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
30183
|
+
*/
|
|
30184
|
+
var DoorbellSourceSlotValueSchema = zod.z.object({ deviceIds: zod.z.array(zod.z.number().int().positive()) });
|
|
30185
|
+
/**
|
|
30186
|
+
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
30187
|
+
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
30188
|
+
* `doorbellSources` store (D648). A source rings when one of its
|
|
30189
|
+
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
30190
|
+
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
30191
|
+
* reports it, it never writes it.
|
|
30192
|
+
*/
|
|
30193
|
+
var DOORBELL_SOURCE_SLOT = {
|
|
30194
|
+
id: "doorbell-source",
|
|
30195
|
+
label: "Doorbell trigger devices",
|
|
30196
|
+
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.",
|
|
30197
|
+
shape: "association",
|
|
30198
|
+
hostDeviceTypes: [require_sleep.DeviceType.Camera],
|
|
30199
|
+
sourceCaps: SOURCE_CAPS,
|
|
30200
|
+
cardinality: "many",
|
|
30201
|
+
value: DoorbellSourceSlotValueSchema
|
|
30202
|
+
};
|
|
30203
|
+
var doorbellCapability = {
|
|
30204
|
+
name: "doorbell",
|
|
30205
|
+
scope: "device",
|
|
30206
|
+
deviceNative: true,
|
|
30207
|
+
mode: "singleton",
|
|
30208
|
+
kind: "wrapper",
|
|
30209
|
+
defaultActive: false,
|
|
30210
|
+
deviceTypes: [require_sleep.DeviceType.Button, require_sleep.DeviceType.Camera],
|
|
30211
|
+
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
30212
|
+
methods: {},
|
|
30213
|
+
events: {
|
|
30214
|
+
/**
|
|
30215
|
+
* Fires once per physical press. Reolink delivers via Baichuan
|
|
30216
|
+
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
30217
|
+
* release/duration — it's a pulse.
|
|
30218
|
+
*/
|
|
30219
|
+
onPressed: { data: DoorbellPressEventSchema } },
|
|
30220
|
+
status: {
|
|
30221
|
+
schema: DoorbellStatusSchema,
|
|
30222
|
+
kind: "push"
|
|
30223
|
+
},
|
|
30224
|
+
/**
|
|
30225
|
+
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
30226
|
+
* Mirrored by the kernel and readable via
|
|
30227
|
+
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
30228
|
+
* without subscribing.
|
|
30229
|
+
*/
|
|
30230
|
+
runtimeState: DoorbellStatusSchema,
|
|
30231
|
+
/**
|
|
30232
|
+
* 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.
|
|
30233
|
+
*
|
|
30234
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
30235
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
30236
|
+
*/
|
|
30237
|
+
durability: "restored"
|
|
30238
|
+
};
|
|
30239
|
+
//#endregion
|
|
30240
|
+
//#region src/generated/extension-slots.ts
|
|
30241
|
+
/**
|
|
30242
|
+
* AUTO-GENERATED by scripts/generate-extension-slots.ts — DO NOT EDIT.
|
|
30243
|
+
*
|
|
30244
|
+
* Every extension slot declared by a capability (`extensionSlots` in its
|
|
30245
|
+
* `*.cap.ts`, D648), folded into one typed table. Imports ONLY the declaring
|
|
30246
|
+
* caps' descriptors and value schemas — never the caps barrel — so
|
|
30247
|
+
* `device-extension.cap.ts` can import this module without a cycle.
|
|
30248
|
+
*
|
|
30249
|
+
* Coverage: 2 slot(s).
|
|
30250
|
+
*/
|
|
30251
|
+
/** Every declared slot id, in table order. */
|
|
30252
|
+
var EXTENSION_SLOT_IDS = ["doorbell-source", "linked-devices"];
|
|
30253
|
+
var ExtensionSlotIdSchema = zod.z.enum(EXTENSION_SLOT_IDS);
|
|
30254
|
+
var EXTENSION_SLOTS = {
|
|
30255
|
+
"doorbell-source": {
|
|
30256
|
+
descriptor: DOORBELL_SOURCE_SLOT,
|
|
30257
|
+
declaringCap: "doorbell",
|
|
30258
|
+
hostDeviceTypes: [require_sleep.DeviceType.Camera]
|
|
30259
|
+
},
|
|
30260
|
+
"linked-devices": {
|
|
30261
|
+
descriptor: LINKED_DEVICES_SLOT,
|
|
30262
|
+
declaringCap: "device-manager",
|
|
30263
|
+
hostDeviceTypes: [require_sleep.DeviceType.Camera]
|
|
30264
|
+
}
|
|
30265
|
+
};
|
|
30266
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
30267
|
+
var ExtensionSlotValueSchema = zod.z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: zod.z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: zod.z.literal("linked-devices") })]);
|
|
30268
|
+
/** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
|
|
30269
|
+
var EXTENSION_HOST_DEVICE_TYPES = [require_sleep.DeviceType.Camera];
|
|
30270
|
+
//#endregion
|
|
30271
|
+
//#region src/capabilities/device-extension.cap.ts
|
|
30272
|
+
/**
|
|
30273
|
+
* `device-extension` — ONE place to see and author what a device is extended
|
|
30274
|
+
* with by OTHER devices (D648).
|
|
30275
|
+
*
|
|
30276
|
+
* **A contract, not a store.** Every slot (`linked-devices`,
|
|
30277
|
+
* `doorbell-source`, later `consumables-graft`) is declared by the cap that
|
|
30278
|
+
* owns the function (`extensionSlots` in its `*.cap.ts`, D4) and SERVED by the
|
|
30279
|
+
* addon that already owns its store, over that store and its existing write
|
|
30280
|
+
* path. This cap persists nothing and has no config method (guarded by
|
|
30281
|
+
* `scripts/check-extension-slots.ts`): D62 applied to the whole feature, and
|
|
30282
|
+
* D3 — no shadow registry.
|
|
30283
|
+
*
|
|
30284
|
+
* **Shape.** A device-scoped wrapper COLLECTION, the D554 shape `videoclips`
|
|
30285
|
+
* uses: `resolveCapMount` gives it the `device-scoped` mount and
|
|
30286
|
+
* `requireDeviceCollection` dispatches it. Its providers are the slot owners
|
|
30287
|
+
* (device-manager, virtual-doorbell, …), and a device's sources are its
|
|
30288
|
+
* bindings (step 0 of `getBindings`, derived, persisted nowhere).
|
|
30289
|
+
*
|
|
30290
|
+
* - `listSources` — one row per provider, the D554 source-listing convention
|
|
30291
|
+
* that lets a scalar call be routed by the prefix of its `slotRef`.
|
|
30292
|
+
* - `listSlots` — fan-out, concatenated. A provider that throws becomes ONE
|
|
30293
|
+
* `unreachable` row naming it, never an absence (D554.4, D315): "no
|
|
30294
|
+
* extensions" is claimed only from an answer.
|
|
30295
|
+
* - `listCandidates` / `setSlot` — scalar, routed by `slotRef`
|
|
30296
|
+
* (`<source>:<slotId>`). An unclaimed ref is refused by name (D554.5).
|
|
30297
|
+
*
|
|
30298
|
+
* The slot's value travels as the generated discriminated union
|
|
30299
|
+
* (`ExtensionSlotValue`, keyed on `slot`), so a value under the wrong slot is
|
|
30300
|
+
* a schema error before it reaches any owner.
|
|
30301
|
+
*/
|
|
30302
|
+
/** Separator between the source and the slot id in a `slotRef`. It is the
|
|
30303
|
+
* D554 routing separator: the dispatcher matches `<source>:` prefixes. */
|
|
30304
|
+
var EXTENSION_SLOT_REF_SEPARATOR = ":";
|
|
30305
|
+
/** The contract method whose failure BECOMES a row, like `listSources`'s. */
|
|
30306
|
+
var EXTENSION_SLOT_LISTING_METHOD = "listSlots";
|
|
30307
|
+
var ExtensionSourceAvailabilitySchema = zod.z.discriminatedUnion("state", [zod.z.object({ state: zod.z.literal("ok") }), zod.z.object({
|
|
30308
|
+
state: zod.z.literal("unreachable"),
|
|
30309
|
+
reason: zod.z.string()
|
|
30310
|
+
})]);
|
|
30311
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
30312
|
+
var ExtensionSourceSchema = zod.z.object({
|
|
30313
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
30314
|
+
source: zod.z.string(),
|
|
30315
|
+
label: zod.z.string(),
|
|
30316
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
30317
|
+
addonId: zod.z.string().optional(),
|
|
30318
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
30319
|
+
});
|
|
30320
|
+
/**
|
|
30321
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
30322
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
30323
|
+
* (slice 2's cross-owner graft source); `unavailable` — it exists but is not a
|
|
30324
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
30325
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
30326
|
+
*/
|
|
30327
|
+
var ExtensionSourceHealthSchema = zod.z.enum([
|
|
30328
|
+
"ok",
|
|
30329
|
+
"missing",
|
|
30330
|
+
"foreign",
|
|
30331
|
+
"unavailable"
|
|
30332
|
+
]);
|
|
30333
|
+
var ExtensionSlotSourceSchema = zod.z.object({
|
|
30334
|
+
deviceId: zod.z.number().int(),
|
|
30335
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
30336
|
+
name: zod.z.string().nullable(),
|
|
30337
|
+
health: ExtensionSourceHealthSchema,
|
|
30338
|
+
detail: zod.z.string().optional()
|
|
30339
|
+
});
|
|
30340
|
+
/**
|
|
30341
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
30342
|
+
* reported read-only, named, never written through this contract (D62). The
|
|
30343
|
+
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
30344
|
+
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
30345
|
+
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
30346
|
+
*/
|
|
30347
|
+
var ExtensionSlotActivationSchema = zod.z.object({
|
|
30348
|
+
state: zod.z.enum([
|
|
30349
|
+
"active",
|
|
30350
|
+
"inactive",
|
|
30351
|
+
"unknown"
|
|
30352
|
+
]),
|
|
30353
|
+
authority: zod.z.string(),
|
|
30354
|
+
detail: zod.z.string().optional()
|
|
30355
|
+
});
|
|
30356
|
+
/** One slot of one device, as its owner reads it from its own store. */
|
|
30357
|
+
var ExtensionSlotStateSchema = zod.z.object({
|
|
30358
|
+
state: zod.z.literal("ok"),
|
|
30359
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
30360
|
+
slotRef: zod.z.string(),
|
|
30361
|
+
slot: ExtensionSlotIdSchema,
|
|
30362
|
+
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
30363
|
+
authority: zod.z.string(),
|
|
30364
|
+
/** graft: its switch. association: null — removing every source is "off". */
|
|
30365
|
+
enabled: zod.z.boolean().nullable(),
|
|
30366
|
+
/** graft: the cap registered on the host. association: null. */
|
|
30367
|
+
projects: zod.z.string().nullable(),
|
|
30368
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
30369
|
+
value: ExtensionSlotValueSchema,
|
|
30370
|
+
sources: zod.z.array(ExtensionSlotSourceSchema),
|
|
30371
|
+
/**
|
|
30372
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
30373
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
30374
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
30375
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
30376
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
30377
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
30378
|
+
* older than D655.
|
|
30379
|
+
*/
|
|
30380
|
+
impliedSources: zod.z.array(ExtensionSlotSourceSchema).optional()
|
|
30381
|
+
});
|
|
30382
|
+
/**
|
|
30383
|
+
* A provider that could not answer `listSlots` at all. It could not name its
|
|
30384
|
+
* own slots, so the row names the ADDON and carries the refusal verbatim.
|
|
30385
|
+
* Written by the dispatcher, never by a provider.
|
|
30386
|
+
*/
|
|
30387
|
+
var ExtensionSlotUnreachableSchema = zod.z.object({
|
|
30388
|
+
state: zod.z.literal("unreachable"),
|
|
30389
|
+
addonId: zod.z.string(),
|
|
30390
|
+
reason: zod.z.string()
|
|
30391
|
+
});
|
|
30392
|
+
var ExtensionSlotRowSchema = zod.z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
|
|
30393
|
+
/** The row the dispatcher writes for a provider whose `listSlots` threw. */
|
|
30394
|
+
function unreachableExtensionSlotRow(addonId, reason) {
|
|
30395
|
+
return {
|
|
30396
|
+
state: "unreachable",
|
|
30397
|
+
addonId,
|
|
30398
|
+
reason
|
|
30399
|
+
};
|
|
30400
|
+
}
|
|
30401
|
+
/** One device the slot's editor may offer as a source. */
|
|
30402
|
+
var ExtensionCandidateSchema = zod.z.object({
|
|
30403
|
+
deviceId: zod.z.number().int(),
|
|
30404
|
+
name: zod.z.string(),
|
|
30405
|
+
type: zod.z.string(),
|
|
30406
|
+
location: zod.z.string().nullable(),
|
|
30407
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
30408
|
+
parentName: zod.z.string().nullable(),
|
|
30409
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
30410
|
+
suggested: zod.z.boolean(),
|
|
30411
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
30412
|
+
reason: zod.z.string().nullable()
|
|
30413
|
+
});
|
|
30414
|
+
var ExtensionCandidatesSchema = zod.z.object({ candidates: zod.z.array(ExtensionCandidateSchema) });
|
|
30415
|
+
/**
|
|
30416
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
30417
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
30418
|
+
* write changed what the host REGISTERS (a graft switched on or off, slice 2).
|
|
30419
|
+
*/
|
|
30420
|
+
var ExtensionSetResultSchema = zod.z.object({
|
|
30421
|
+
applied: zod.z.literal(true),
|
|
30422
|
+
reload: zod.z.enum([
|
|
30423
|
+
"none",
|
|
30424
|
+
"host",
|
|
30425
|
+
"parent"
|
|
30426
|
+
])
|
|
30427
|
+
});
|
|
30428
|
+
var ExtensionSlotRefInputSchema = zod.z.object({
|
|
30429
|
+
deviceId: zod.z.number().int(),
|
|
30430
|
+
slotRef: zod.z.string().min(1)
|
|
30431
|
+
});
|
|
30432
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
30433
|
+
var deviceExtensionCapability = {
|
|
30434
|
+
name: "device-extension",
|
|
30435
|
+
scope: "device",
|
|
30436
|
+
mode: "collection",
|
|
30437
|
+
kind: "wrapper",
|
|
30438
|
+
defaultActive: true,
|
|
30439
|
+
deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
|
|
30440
|
+
deviceConfig: { ui: {
|
|
30441
|
+
kind: "widget",
|
|
30442
|
+
widgetId: "host/extensions-panel",
|
|
30443
|
+
tab: "general",
|
|
30444
|
+
label: "Extensions",
|
|
30445
|
+
order: 72
|
|
30446
|
+
} },
|
|
30447
|
+
methods: {
|
|
30448
|
+
/** One row per slot owner — the D554 source listing `slotRef` routes by. */
|
|
30449
|
+
listSources: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.array(ExtensionSourceSchema)),
|
|
30450
|
+
/**
|
|
30451
|
+
* Every slot this device is offered, read by each owner from its own
|
|
30452
|
+
* store. A provider that throws is ONE `unreachable` row (D554.4).
|
|
30453
|
+
*/
|
|
30454
|
+
listSlots: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.array(ExtensionSlotRowSchema)),
|
|
30455
|
+
/** The devices the slot's editor may offer, suggestions pre-marked (D356). */
|
|
30456
|
+
listCandidates: require_sleep.method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
|
|
30457
|
+
/**
|
|
30458
|
+
* Write one slot through its owner's EXISTING write path. The owner
|
|
30459
|
+
* validates (a container is never a linked device, a camera is never its
|
|
30460
|
+
* own source) and refuses by name before persisting.
|
|
30461
|
+
*/
|
|
30462
|
+
setSlot: require_sleep.method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
30463
|
+
kind: "mutation",
|
|
30464
|
+
auth: "admin"
|
|
30465
|
+
})
|
|
30466
|
+
}
|
|
30467
|
+
};
|
|
30468
|
+
//#endregion
|
|
29257
30469
|
//#region src/capabilities/webrtc-session.cap.ts
|
|
29258
30470
|
/**
|
|
29259
30471
|
* Optional client-side hints sent at session creation to help the provider
|
|
@@ -32289,77 +33501,6 @@ onStatusChanged: { data: zod.z.object({
|
|
|
32289
33501
|
volatileStateFields: ["lastChangedAt"]
|
|
32290
33502
|
};
|
|
32291
33503
|
//#endregion
|
|
32292
|
-
//#region src/capabilities/doorbell.cap.ts
|
|
32293
|
-
/**
|
|
32294
|
-
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
32295
|
-
* name (same pattern as `snapshot`):
|
|
32296
|
-
*
|
|
32297
|
-
* - **Native** providers: registered per-device by device-driver
|
|
32298
|
-
* addons via `ctx.registerNativeCap` — either on a
|
|
32299
|
-
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
32300
|
-
* or directly on the camera (Reolink registers at camera level).
|
|
32301
|
-
* Emits an `onPressed` event every time the firmware pushes a
|
|
32302
|
-
* ring; status tracks the last press and a pressCount since start
|
|
32303
|
-
* (diagnostic).
|
|
32304
|
-
*
|
|
32305
|
-
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
32306
|
-
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
32307
|
-
* device (contact / switch / event-emitter …) into a doorbell for
|
|
32308
|
-
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
32309
|
-
* it per camera in the device-bindings UI, then picks the source
|
|
32310
|
-
* device + trigger in the per-device settings.
|
|
32311
|
-
*
|
|
32312
|
-
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
32313
|
-
* — subscribers listening at the camera level receive ring events
|
|
32314
|
-
* with `via[]` populated. No code on the parent needed.
|
|
32315
|
-
*/
|
|
32316
|
-
var DoorbellStatusSchema = zod.z.object({
|
|
32317
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
32318
|
-
lastPressedAt: zod.z.number().nullable(),
|
|
32319
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
32320
|
-
pressCountSinceStart: zod.z.number()
|
|
32321
|
-
});
|
|
32322
|
-
var DoorbellPressEventSchema = zod.z.object({
|
|
32323
|
-
deviceId: zod.z.number(),
|
|
32324
|
-
timestamp: zod.z.number()
|
|
32325
|
-
});
|
|
32326
|
-
var doorbellCapability = {
|
|
32327
|
-
name: "doorbell",
|
|
32328
|
-
scope: "device",
|
|
32329
|
-
deviceNative: true,
|
|
32330
|
-
mode: "singleton",
|
|
32331
|
-
kind: "wrapper",
|
|
32332
|
-
defaultActive: false,
|
|
32333
|
-
deviceTypes: [require_sleep.DeviceType.Button, require_sleep.DeviceType.Camera],
|
|
32334
|
-
exposesDeviceSettings: true,
|
|
32335
|
-
methods: {},
|
|
32336
|
-
events: {
|
|
32337
|
-
/**
|
|
32338
|
-
* Fires once per physical press. Reolink delivers via Baichuan
|
|
32339
|
-
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
32340
|
-
* release/duration — it's a pulse.
|
|
32341
|
-
*/
|
|
32342
|
-
onPressed: { data: DoorbellPressEventSchema } },
|
|
32343
|
-
status: {
|
|
32344
|
-
schema: DoorbellStatusSchema,
|
|
32345
|
-
kind: "push"
|
|
32346
|
-
},
|
|
32347
|
-
/**
|
|
32348
|
-
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
32349
|
-
* Mirrored by the kernel and readable via
|
|
32350
|
-
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
32351
|
-
* without subscribing.
|
|
32352
|
-
*/
|
|
32353
|
-
runtimeState: DoorbellStatusSchema,
|
|
32354
|
-
/**
|
|
32355
|
-
* 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.
|
|
32356
|
-
*
|
|
32357
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
32358
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
32359
|
-
*/
|
|
32360
|
-
durability: "restored"
|
|
32361
|
-
};
|
|
32362
|
-
//#endregion
|
|
32363
33504
|
//#region src/capabilities/enum-sensor.cap.ts
|
|
32364
33505
|
/**
|
|
32365
33506
|
* Enum-state sensor — a string value picked from a finite option set.
|
|
@@ -43396,6 +44537,91 @@ var PIPELINE_OWNER_CAPABILITY_NAMES = [
|
|
|
43396
44537
|
"pipeline-runner"
|
|
43397
44538
|
];
|
|
43398
44539
|
//#endregion
|
|
44540
|
+
//#region src/device-extension/slot-provider.ts
|
|
44541
|
+
function isValueOf(slot, value) {
|
|
44542
|
+
return value.slot === slot;
|
|
44543
|
+
}
|
|
44544
|
+
/** Bind slot `slot` to its owner's functions. See the module docblock. */
|
|
44545
|
+
function defineExtensionSlotProvider(slot, impl) {
|
|
44546
|
+
return {
|
|
44547
|
+
slot,
|
|
44548
|
+
list: async (deviceId) => {
|
|
44549
|
+
const listing = await impl.list(deviceId);
|
|
44550
|
+
if (listing === null) return null;
|
|
44551
|
+
const value = listing.value;
|
|
44552
|
+
return {
|
|
44553
|
+
...listing,
|
|
44554
|
+
value
|
|
44555
|
+
};
|
|
44556
|
+
},
|
|
44557
|
+
set: async (deviceId, value) => {
|
|
44558
|
+
if (!isValueOf(slot, value)) throw new Error(`device-extension: a "${value.slot}" value was sent to slot "${slot}" — refused`);
|
|
44559
|
+
return await impl.set(deviceId, value);
|
|
44560
|
+
},
|
|
44561
|
+
candidates: (deviceId) => impl.candidates(deviceId)
|
|
44562
|
+
};
|
|
44563
|
+
}
|
|
44564
|
+
/** `<source>:<slotId>`. */
|
|
44565
|
+
function extensionSlotRef(source, slot) {
|
|
44566
|
+
return `${source}:${slot}`;
|
|
44567
|
+
}
|
|
44568
|
+
/** Build the `device-extension` provider one owner registers. */
|
|
44569
|
+
function createDeviceExtensionProvider(options) {
|
|
44570
|
+
const { source, label, slots, hostTypeOf, logger } = options;
|
|
44571
|
+
const offered = (slot, hostType) => hostType !== null && EXTENSION_SLOTS[slot].hostDeviceTypes.some((t) => t === hostType);
|
|
44572
|
+
const resolve = async (deviceId, slotRef) => {
|
|
44573
|
+
const prefix = `${source}:`;
|
|
44574
|
+
const slot = slotRef.startsWith(prefix) ? slots.find((s) => s.slot === slotRef.slice(prefix.length)) : void 0;
|
|
44575
|
+
if (slot === void 0) throw new Error(`device-extension: "${slotRef}" is not a slot of "${source}" — it serves ${slots.map((s) => extensionSlotRef(source, s.slot)).join(", ") || "(none)"}`);
|
|
44576
|
+
const hostType = await hostTypeOf(deviceId);
|
|
44577
|
+
if (!offered(slot.slot, hostType)) throw new Error(`device-extension: slot "${slot.slot}" is not offered on device ${deviceId} (type ${hostType ?? "unknown"}; offered on ${EXTENSION_SLOTS[slot.slot].hostDeviceTypes.join(", ")})`);
|
|
44578
|
+
return slot;
|
|
44579
|
+
};
|
|
44580
|
+
return {
|
|
44581
|
+
listSources: async () => [{
|
|
44582
|
+
source,
|
|
44583
|
+
label,
|
|
44584
|
+
availability: { state: "ok" }
|
|
44585
|
+
}],
|
|
44586
|
+
listSlots: async (input) => {
|
|
44587
|
+
const hostType = await hostTypeOf(input.deviceId);
|
|
44588
|
+
const rows = [];
|
|
44589
|
+
for (const slot of slots) {
|
|
44590
|
+
if (!offered(slot.slot, hostType)) continue;
|
|
44591
|
+
const listing = await slot.list(input.deviceId);
|
|
44592
|
+
if (listing === null) continue;
|
|
44593
|
+
rows.push({
|
|
44594
|
+
state: "ok",
|
|
44595
|
+
slotRef: extensionSlotRef(source, slot.slot),
|
|
44596
|
+
slot: slot.slot,
|
|
44597
|
+
authority: listing.authority,
|
|
44598
|
+
enabled: listing.enabled,
|
|
44599
|
+
projects: EXTENSION_SLOTS[slot.slot].descriptor.projects ?? null,
|
|
44600
|
+
activation: listing.activation,
|
|
44601
|
+
value: listing.value,
|
|
44602
|
+
sources: [...listing.sources],
|
|
44603
|
+
...listing.impliedSources !== void 0 ? { impliedSources: [...listing.impliedSources] } : {}
|
|
44604
|
+
});
|
|
44605
|
+
}
|
|
44606
|
+
return rows;
|
|
44607
|
+
},
|
|
44608
|
+
listCandidates: async (input) => {
|
|
44609
|
+
return { candidates: [...await (await resolve(input.deviceId, input.slotRef)).candidates(input.deviceId)] };
|
|
44610
|
+
},
|
|
44611
|
+
setSlot: async (input) => {
|
|
44612
|
+
const result = await (await resolve(input.deviceId, input.slotRef)).set(input.deviceId, input.value);
|
|
44613
|
+
logger.info("device-extension: slot written", {
|
|
44614
|
+
tags: { deviceId: input.deviceId },
|
|
44615
|
+
meta: {
|
|
44616
|
+
slotRef: input.slotRef,
|
|
44617
|
+
reload: result.reload
|
|
44618
|
+
}
|
|
44619
|
+
});
|
|
44620
|
+
return result;
|
|
44621
|
+
}
|
|
44622
|
+
};
|
|
44623
|
+
}
|
|
44624
|
+
//#endregion
|
|
43399
44625
|
//#region src/catalogs/device-state-vocabulary.ts
|
|
43400
44626
|
/**
|
|
43401
44627
|
* Most specific first. Extending this list is how a new device kind becomes
|
|
@@ -43467,172 +44693,6 @@ function stateVocabularyFor(runtimeState, alarmStates = []) {
|
|
|
43467
44693
|
return [];
|
|
43468
44694
|
}
|
|
43469
44695
|
//#endregion
|
|
43470
|
-
//#region src/catalogs/sensor-active-state.ts
|
|
43471
|
-
/**
|
|
43472
|
-
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
43473
|
-
* valutatore puro del suo FRONTE.
|
|
43474
|
-
*
|
|
43475
|
-
* Viveva dentro il builtin virtual-doorbell
|
|
43476
|
-
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
43477
|
-
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
43478
|
-
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
43479
|
-
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
43480
|
-
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
43481
|
-
* SPOSTA qui e il doorbell la ri-esporta.
|
|
43482
|
-
*
|
|
43483
|
-
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
43484
|
-
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
43485
|
-
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
43486
|
-
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
43487
|
-
*/
|
|
43488
|
-
/**
|
|
43489
|
-
* Known binary / switch source caps → the boolean slice field whose
|
|
43490
|
-
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
43491
|
-
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
43492
|
-
* state, connectivity's connected flag) are deliberately excluded — a
|
|
43493
|
-
* reconnect is not a doorbell press, and it is not a recording either.
|
|
43494
|
-
*/
|
|
43495
|
-
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
43496
|
-
contact: "entryOpen",
|
|
43497
|
-
binary: "on",
|
|
43498
|
-
switch: "on",
|
|
43499
|
-
motion: "detected",
|
|
43500
|
-
flood: "flooded",
|
|
43501
|
-
gas: "detected",
|
|
43502
|
-
smoke: "detected",
|
|
43503
|
-
"carbon-monoxide": "detected",
|
|
43504
|
-
vibration: "detected",
|
|
43505
|
-
tamper: "tampered"
|
|
43506
|
-
};
|
|
43507
|
-
/**
|
|
43508
|
-
* The same caps → the slice field carrying the ms-epoch timestamp of the
|
|
43509
|
-
* last transition. Every source cap MUST appear here (guarded by a spec):
|
|
43510
|
-
* without a transition timestamp the evaluator cannot tell a genuine rise
|
|
43511
|
-
* from a boot-time hydration when the FIRST slice it ever sees is already
|
|
43512
|
-
* active, and errs towards silence — swallowing the rise.
|
|
43513
|
-
*
|
|
43514
|
-
* These timestamps are UPSTREAM ones, not ingest ones: the Home Assistant
|
|
43515
|
-
* provider derives them from `state.last_changed`, so they survive our own
|
|
43516
|
-
* restarts and correctly read as "hours ago" for a state that has been
|
|
43517
|
-
* active for hours. `motion` names its rise timestamp `lastDetectedAt`.
|
|
43518
|
-
*/
|
|
43519
|
-
var SOURCE_CAP_CHANGED_AT_FIELD = {
|
|
43520
|
-
contact: "lastChangedAt",
|
|
43521
|
-
binary: "lastChangedAt",
|
|
43522
|
-
switch: "lastChangedAt",
|
|
43523
|
-
motion: "lastDetectedAt",
|
|
43524
|
-
flood: "lastChangedAt",
|
|
43525
|
-
gas: "lastChangedAt",
|
|
43526
|
-
smoke: "lastChangedAt",
|
|
43527
|
-
"carbon-monoxide": "lastChangedAt",
|
|
43528
|
-
vibration: "lastChangedAt",
|
|
43529
|
-
tamper: "lastChangedAt"
|
|
43530
|
-
};
|
|
43531
|
-
/** Cap names whose presence in a device's bindings qualify it as a source. */
|
|
43532
|
-
var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
|
|
43533
|
-
/**
|
|
43534
|
-
* Device `type` values (from `DeviceType`) that can host a binary/switch
|
|
43535
|
-
* source cap. Used by the camera's `device-multiselect` picker as the
|
|
43536
|
-
* CLIENT-SIDE filter, alongside `SOURCE_CAPS`.
|
|
43537
|
-
*
|
|
43538
|
-
* Why types and not caps alone: the shared picker filters
|
|
43539
|
-
* `deviceManager.listAll` rows client-side, and those rows carry only the
|
|
43540
|
-
* device's advertised `features` — NOT its registered cap list. On the live
|
|
43541
|
-
* cluster binary sensors and switches advertise EMPTY features (features
|
|
43542
|
-
* mirror only a handful of caps like `motion-trigger`), so a caps-only
|
|
43543
|
-
* filter matched against `features` would list nothing (the very bug this
|
|
43544
|
-
* replaced, which relied on the now-empty `getAllBindings`). Matching by
|
|
43545
|
-
* `type` is the reliable client-side signal; the union with `SOURCE_CAPS`
|
|
43546
|
-
* still captures any device that DOES advertise a source-cap feature.
|
|
43547
|
-
* `sensor` covers contact/motion/flood/gas/smoke/CO/vibration/tamper,
|
|
43548
|
-
* `switch` covers switches, `control` covers generic binary actuators.
|
|
43549
|
-
*/
|
|
43550
|
-
var SOURCE_DEVICE_TYPES = [
|
|
43551
|
-
"sensor",
|
|
43552
|
-
"switch",
|
|
43553
|
-
"control"
|
|
43554
|
-
];
|
|
43555
|
-
/** True when a cap is a recognised binary/switch source. */
|
|
43556
|
-
function isSourceCap(capName) {
|
|
43557
|
-
return Object.prototype.hasOwnProperty.call(SOURCE_CAP_ACTIVE_FIELD, capName);
|
|
43558
|
-
}
|
|
43559
|
-
/** Extract the "active" boolean a source cap's slice carries, or null when
|
|
43560
|
-
* the cap is unknown or the field is missing / non-boolean. */
|
|
43561
|
-
function sliceActiveValue(capName, slice) {
|
|
43562
|
-
const field = SOURCE_CAP_ACTIVE_FIELD[capName];
|
|
43563
|
-
if (field === void 0) return null;
|
|
43564
|
-
const raw = slice[field];
|
|
43565
|
-
return typeof raw === "boolean" ? raw : null;
|
|
43566
|
-
}
|
|
43567
|
-
/** Ms-epoch transition timestamp a source cap's slice carries, or null when
|
|
43568
|
-
* it is absent, non-numeric or the zero "never observed" sentinel. */
|
|
43569
|
-
function sliceChangedAt(capName, slice) {
|
|
43570
|
-
const field = SOURCE_CAP_CHANGED_AT_FIELD[capName];
|
|
43571
|
-
if (field === void 0) return null;
|
|
43572
|
-
const raw = slice[field];
|
|
43573
|
-
if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return null;
|
|
43574
|
-
return raw;
|
|
43575
|
-
}
|
|
43576
|
-
/**
|
|
43577
|
-
* How recent a source's own transition timestamp must be for a FIRST
|
|
43578
|
-
* sighting that is already active to count as a genuine rise rather than a
|
|
43579
|
-
* hydration of long-standing state.
|
|
43580
|
-
*/
|
|
43581
|
-
var DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = 3e4;
|
|
43582
|
-
/**
|
|
43583
|
-
* IL fronte. Puro: nessun orologio proprio, nessuna memoria — il chiamante
|
|
43584
|
-
* porta `prior`, `nowMs` e il proprio `startedAtMs`.
|
|
43585
|
-
*
|
|
43586
|
-
* Il caso della PRIMA slice già attiva è trattato esplicitamente e vale come
|
|
43587
|
-
* fronte solo se il timestamp UPSTREAM della transizione è posteriore a
|
|
43588
|
-
* `startedAtMs` **e** entro `firstSightingFreshnessMs`. Entrambe le metà
|
|
43589
|
-
* servono: la sola freschezza scatterebbe su un'idratazione al boot di uno
|
|
43590
|
-
* stato flippato pochi secondi prima del riavvio, e il solo "dopo che abbiamo
|
|
43591
|
-
* iniziato" scatterebbe, su un processo di lunga vita, per una sorgente
|
|
43592
|
-
* adottata oggi il cui stato è cambiato ieri. Il caso ambiguo ERRA VERSO IL
|
|
43593
|
-
* SILENZIO e lo dichiara (`baseline-seeded-stale-active`).
|
|
43594
|
-
*/
|
|
43595
|
-
function evaluateSensorEdge(input) {
|
|
43596
|
-
const value = sliceActiveValue(input.capName, input.slice);
|
|
43597
|
-
if (value === null) return {
|
|
43598
|
-
edge: "none",
|
|
43599
|
-
value: null,
|
|
43600
|
-
reason: isSourceCap(input.capName) ? "non-boolean-value" : "unknown-cap"
|
|
43601
|
-
};
|
|
43602
|
-
if (input.prior === void 0) {
|
|
43603
|
-
if (!value) return {
|
|
43604
|
-
edge: "none",
|
|
43605
|
-
value,
|
|
43606
|
-
reason: "baseline-seeded-inactive"
|
|
43607
|
-
};
|
|
43608
|
-
const changedAt = sliceChangedAt(input.capName, input.slice);
|
|
43609
|
-
const floor = Math.max(input.startedAtMs, input.nowMs - input.firstSightingFreshnessMs);
|
|
43610
|
-
if (changedAt === null || changedAt < floor) return {
|
|
43611
|
-
edge: "none",
|
|
43612
|
-
value,
|
|
43613
|
-
reason: "baseline-seeded-stale-active"
|
|
43614
|
-
};
|
|
43615
|
-
return {
|
|
43616
|
-
edge: "rising",
|
|
43617
|
-
value: true
|
|
43618
|
-
};
|
|
43619
|
-
}
|
|
43620
|
-
if (input.prior === value) return {
|
|
43621
|
-
edge: "none",
|
|
43622
|
-
value,
|
|
43623
|
-
reason: "no-change"
|
|
43624
|
-
};
|
|
43625
|
-
if (!value) return {
|
|
43626
|
-
edge: "none",
|
|
43627
|
-
value,
|
|
43628
|
-
reason: "falling-edge"
|
|
43629
|
-
};
|
|
43630
|
-
return {
|
|
43631
|
-
edge: "rising",
|
|
43632
|
-
value: true
|
|
43633
|
-
};
|
|
43634
|
-
}
|
|
43635
|
-
//#endregion
|
|
43636
44696
|
//#region src/constants.ts
|
|
43637
44697
|
var HF_REPO = "camstack/camstack-models";
|
|
43638
44698
|
var HF_BASE_URL = `https://huggingface.co/${HF_REPO}/resolve/main`;
|
|
@@ -48678,6 +49738,7 @@ var CAPABILITY_NAMES = {
|
|
|
48678
49738
|
deviceAdoption: "device-adoption",
|
|
48679
49739
|
deviceDiscovery: "device-discovery",
|
|
48680
49740
|
deviceExport: "device-export",
|
|
49741
|
+
deviceExtension: "device-extension",
|
|
48681
49742
|
deviceManager: "device-manager",
|
|
48682
49743
|
deviceOps: "device-ops",
|
|
48683
49744
|
deviceProvider: "device-provider",
|
|
@@ -48985,6 +50046,10 @@ var CAPABILITY_ROUTER_KEYS = [
|
|
|
48985
50046
|
key: "deviceExport",
|
|
48986
50047
|
name: "device-export"
|
|
48987
50048
|
},
|
|
50049
|
+
{
|
|
50050
|
+
key: "deviceExtension",
|
|
50051
|
+
name: "device-extension"
|
|
50052
|
+
},
|
|
48988
50053
|
{
|
|
48989
50054
|
key: "deviceManager",
|
|
48990
50055
|
name: "device-manager"
|
|
@@ -49492,6 +50557,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
49492
50557
|
deviceAdoptionCapability,
|
|
49493
50558
|
deviceDiscoveryCapability,
|
|
49494
50559
|
deviceExportCapability,
|
|
50560
|
+
deviceExtensionCapability,
|
|
49495
50561
|
deviceManagerCapability,
|
|
49496
50562
|
require_sleep.deviceOpsCapability,
|
|
49497
50563
|
deviceProviderCapability,
|
|
@@ -51042,6 +52108,30 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51042
52108
|
addonId: null,
|
|
51043
52109
|
access: "create"
|
|
51044
52110
|
},
|
|
52111
|
+
"deviceExtension.listCandidates": {
|
|
52112
|
+
capName: "device-extension",
|
|
52113
|
+
capScope: "device",
|
|
52114
|
+
addonId: null,
|
|
52115
|
+
access: "view"
|
|
52116
|
+
},
|
|
52117
|
+
"deviceExtension.listSlots": {
|
|
52118
|
+
capName: "device-extension",
|
|
52119
|
+
capScope: "device",
|
|
52120
|
+
addonId: null,
|
|
52121
|
+
access: "view"
|
|
52122
|
+
},
|
|
52123
|
+
"deviceExtension.listSources": {
|
|
52124
|
+
capName: "device-extension",
|
|
52125
|
+
capScope: "device",
|
|
52126
|
+
addonId: null,
|
|
52127
|
+
access: "view"
|
|
52128
|
+
},
|
|
52129
|
+
"deviceExtension.setSlot": {
|
|
52130
|
+
capName: "device-extension",
|
|
52131
|
+
capScope: "device",
|
|
52132
|
+
addonId: null,
|
|
52133
|
+
access: "create"
|
|
52134
|
+
},
|
|
51045
52135
|
"deviceManager.addLocation": {
|
|
51046
52136
|
capName: "device-manager",
|
|
51047
52137
|
capScope: "system",
|
|
@@ -51114,12 +52204,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51114
52204
|
addonId: null,
|
|
51115
52205
|
access: "create"
|
|
51116
52206
|
},
|
|
51117
|
-
"deviceManager.applyDeviceSettingsPatch": {
|
|
51118
|
-
capName: "device-manager",
|
|
51119
|
-
capScope: "system",
|
|
51120
|
-
addonId: null,
|
|
51121
|
-
access: "create"
|
|
51122
|
-
},
|
|
51123
52207
|
"deviceManager.applyInitialMeta": {
|
|
51124
52208
|
capName: "device-manager",
|
|
51125
52209
|
capScope: "system",
|
|
@@ -51222,12 +52306,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51222
52306
|
addonId: null,
|
|
51223
52307
|
access: "view"
|
|
51224
52308
|
},
|
|
51225
|
-
"deviceManager.getDeviceLiveContribution": {
|
|
51226
|
-
capName: "device-manager",
|
|
51227
|
-
capScope: "system",
|
|
51228
|
-
addonId: null,
|
|
51229
|
-
access: "view"
|
|
51230
|
-
},
|
|
51231
52309
|
"deviceManager.getDeviceLiveInfoAggregate": {
|
|
51232
52310
|
capName: "device-manager",
|
|
51233
52311
|
capScope: "system",
|
|
@@ -51240,12 +52318,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51240
52318
|
addonId: null,
|
|
51241
52319
|
access: "view"
|
|
51242
52320
|
},
|
|
51243
|
-
"deviceManager.getDeviceSettingsContribution": {
|
|
51244
|
-
capName: "device-manager",
|
|
51245
|
-
capScope: "system",
|
|
51246
|
-
addonId: null,
|
|
51247
|
-
access: "view"
|
|
51248
|
-
},
|
|
51249
52321
|
"deviceManager.getDeviceStatusAggregate": {
|
|
51250
52322
|
capName: "device-manager",
|
|
51251
52323
|
capScope: "system",
|
|
@@ -51750,24 +52822,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51750
52822
|
addonId: null,
|
|
51751
52823
|
access: "view"
|
|
51752
52824
|
},
|
|
51753
|
-
"doorbell.applyDeviceSettingsPatch": {
|
|
51754
|
-
capName: "doorbell",
|
|
51755
|
-
capScope: "device",
|
|
51756
|
-
addonId: null,
|
|
51757
|
-
access: "create"
|
|
51758
|
-
},
|
|
51759
|
-
"doorbell.getDeviceLiveContribution": {
|
|
51760
|
-
capName: "doorbell",
|
|
51761
|
-
capScope: "device",
|
|
51762
|
-
addonId: null,
|
|
51763
|
-
access: "view"
|
|
51764
|
-
},
|
|
51765
|
-
"doorbell.getDeviceSettingsContribution": {
|
|
51766
|
-
capName: "doorbell",
|
|
51767
|
-
capScope: "device",
|
|
51768
|
-
addonId: null,
|
|
51769
|
-
access: "view"
|
|
51770
|
-
},
|
|
51771
52825
|
"doorbell.getStatus": {
|
|
51772
52826
|
capName: "doorbell",
|
|
51773
52827
|
capScope: "device",
|
|
@@ -51792,6 +52846,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
51792
52846
|
addonId: null,
|
|
51793
52847
|
access: "view"
|
|
51794
52848
|
},
|
|
52849
|
+
"embeddingEncoder.resetFailedModels": {
|
|
52850
|
+
capName: "embedding-encoder",
|
|
52851
|
+
capScope: "system",
|
|
52852
|
+
addonId: null,
|
|
52853
|
+
access: "delete"
|
|
52854
|
+
},
|
|
51795
52855
|
"enumSensor.getStatus": {
|
|
51796
52856
|
capName: "enum-sensor",
|
|
51797
52857
|
capScope: "device",
|
|
@@ -54126,6 +55186,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
54126
55186
|
addonId: null,
|
|
54127
55187
|
access: "view"
|
|
54128
55188
|
},
|
|
55189
|
+
"pipelineOrchestrator.getClusterModelChoice": {
|
|
55190
|
+
capName: "pipeline-orchestrator",
|
|
55191
|
+
capScope: "system",
|
|
55192
|
+
addonId: null,
|
|
55193
|
+
access: "view"
|
|
55194
|
+
},
|
|
54129
55195
|
"pipelineOrchestrator.getDeviceLiveContribution": {
|
|
54130
55196
|
capName: "pipeline-orchestrator",
|
|
54131
55197
|
capScope: "system",
|
|
@@ -56727,6 +57793,7 @@ var KNOWN_CAP_NAMES = [
|
|
|
56727
57793
|
"device-adoption",
|
|
56728
57794
|
"device-discovery",
|
|
56729
57795
|
"device-export",
|
|
57796
|
+
"device-extension",
|
|
56730
57797
|
"device-manager",
|
|
56731
57798
|
"device-ops",
|
|
56732
57799
|
"device-provider",
|
|
@@ -56869,6 +57936,7 @@ var DEVICE_CAP_NAMES = [
|
|
|
56869
57936
|
"detection-pipeline",
|
|
56870
57937
|
"device-admin-link",
|
|
56871
57938
|
"device-discovery",
|
|
57939
|
+
"device-extension",
|
|
56872
57940
|
"device-ops",
|
|
56873
57941
|
"device-status",
|
|
56874
57942
|
"doorbell",
|
|
@@ -57282,6 +58350,26 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
|
|
|
57282
58350
|
form: "single",
|
|
57283
58351
|
optional: false
|
|
57284
58352
|
}],
|
|
58353
|
+
"deviceExtension.listCandidates": [{
|
|
58354
|
+
name: "deviceId",
|
|
58355
|
+
form: "single",
|
|
58356
|
+
optional: false
|
|
58357
|
+
}],
|
|
58358
|
+
"deviceExtension.listSlots": [{
|
|
58359
|
+
name: "deviceId",
|
|
58360
|
+
form: "single",
|
|
58361
|
+
optional: false
|
|
58362
|
+
}],
|
|
58363
|
+
"deviceExtension.listSources": [{
|
|
58364
|
+
name: "deviceId",
|
|
58365
|
+
form: "single",
|
|
58366
|
+
optional: false
|
|
58367
|
+
}],
|
|
58368
|
+
"deviceExtension.setSlot": [{
|
|
58369
|
+
name: "deviceId",
|
|
58370
|
+
form: "single",
|
|
58371
|
+
optional: false
|
|
58372
|
+
}],
|
|
57285
58373
|
"deviceManager.adoptionRelease": [{
|
|
57286
58374
|
name: "camDeviceId",
|
|
57287
58375
|
form: "single",
|
|
@@ -59843,6 +60931,7 @@ function createSystemProxy(api) {
|
|
|
59843
60931
|
stop: (input) => dispatch("deviceProvider", "stop", "mutation", input),
|
|
59844
60932
|
getStatus: (input) => dispatch("deviceProvider", "getStatus", "query", input),
|
|
59845
60933
|
getDevices: (input) => dispatch("deviceProvider", "getDevices", "query", input),
|
|
60934
|
+
reloadDevice: (input) => dispatch("deviceProvider", "reloadDevice", "mutation", input),
|
|
59846
60935
|
supportsDiscovery: (input) => dispatch("deviceProvider", "supportsDiscovery", "query", input),
|
|
59847
60936
|
discoverDevices: (input) => dispatch("deviceProvider", "discoverDevices", "mutation", input),
|
|
59848
60937
|
getDiscoveryParamsSchema: (input) => dispatch("deviceProvider", "getDiscoveryParamsSchema", "query", input),
|
|
@@ -59988,6 +61077,29 @@ function createSystemProxy(api) {
|
|
|
59988
61077
|
deleteTarget: (input) => dispatch("notificationOutput", "deleteTarget", "mutation", input),
|
|
59989
61078
|
setTargetEnabled: (input) => dispatch("notificationOutput", "setTargetEnabled", "mutation", input)
|
|
59990
61079
|
},
|
|
61080
|
+
notificationRules: {
|
|
61081
|
+
listRules: (input) => dispatch("notificationRules", "listRules", "query", input),
|
|
61082
|
+
getRule: (input) => dispatch("notificationRules", "getRule", "query", input),
|
|
61083
|
+
createRule: (input) => dispatch("notificationRules", "createRule", "mutation", input),
|
|
61084
|
+
updateRule: (input) => dispatch("notificationRules", "updateRule", "mutation", input),
|
|
61085
|
+
deleteRule: (input) => dispatch("notificationRules", "deleteRule", "mutation", input),
|
|
61086
|
+
setRuleEnabled: (input) => dispatch("notificationRules", "setRuleEnabled", "mutation", input),
|
|
61087
|
+
getClipRetentionAsks: (input) => dispatch("notificationRules", "getClipRetentionAsks", "query", input),
|
|
61088
|
+
listDeviceMutes: (input) => dispatch("notificationRules", "listDeviceMutes", "query", input),
|
|
61089
|
+
testRule: (input) => dispatch("notificationRules", "testRule", "mutation", input),
|
|
61090
|
+
previewStateSummary: (input) => dispatch("notificationRules", "previewStateSummary", "mutation", input),
|
|
61091
|
+
getConditionCatalog: (input) => dispatch("notificationRules", "getConditionCatalog", "query", input),
|
|
61092
|
+
getTemplateCatalog: (input) => dispatch("notificationRules", "getTemplateCatalog", "query", input),
|
|
61093
|
+
previewTemplate: (input) => dispatch("notificationRules", "previewTemplate", "mutation", input),
|
|
61094
|
+
getHistory: (input) => dispatch("notificationRules", "getHistory", "query", input),
|
|
61095
|
+
getRuleLastRuns: (input) => dispatch("notificationRules", "getRuleLastRuns", "query", input),
|
|
61096
|
+
resolveArtifactUrl: (input) => dispatch("notificationRules", "resolveArtifactUrl", "query", input),
|
|
61097
|
+
listSnoozes: (input) => dispatch("notificationRules", "listSnoozes", "query", input),
|
|
61098
|
+
createSnooze: (input) => dispatch("notificationRules", "createSnooze", "mutation", input),
|
|
61099
|
+
cancelSnooze: (input) => dispatch("notificationRules", "cancelSnooze", "mutation", input),
|
|
61100
|
+
getAlarmConfig: (input) => dispatch("notificationRules", "getAlarmConfig", "query", input),
|
|
61101
|
+
setAlarmConfig: (input) => dispatch("notificationRules", "setAlarmConfig", "mutation", input)
|
|
61102
|
+
},
|
|
59991
61103
|
osdManager: {
|
|
59992
61104
|
getConditionSupport: (input) => dispatch("osdManager", "getConditionSupport", "query", input),
|
|
59993
61105
|
copyDeviceConfiguration: (input) => dispatch("osdManager", "copyDeviceConfiguration", "mutation", input)
|
|
@@ -60036,11 +61148,13 @@ function createSystemProxy(api) {
|
|
|
60036
61148
|
rebalance: (input) => dispatch("pipelineOrchestrator", "rebalance", "mutation", input),
|
|
60037
61149
|
getPipelineAssignments: (input) => dispatch("pipelineOrchestrator", "getPipelineAssignments", "query", input),
|
|
60038
61150
|
getAgentLoad: (input) => dispatch("pipelineOrchestrator", "getAgentLoad", "query", input),
|
|
61151
|
+
getClusterModelChoice: (input) => dispatch("pipelineOrchestrator", "getClusterModelChoice", "query", input),
|
|
60039
61152
|
getGlobalMetrics: (input) => dispatch("pipelineOrchestrator", "getGlobalMetrics", "query", input),
|
|
60040
61153
|
getCapabilityBindings: (input) => dispatch("pipelineOrchestrator", "getCapabilityBindings", "query", input),
|
|
60041
61154
|
setCapabilityBinding: (input) => dispatch("pipelineOrchestrator", "setCapabilityBinding", "mutation", input),
|
|
60042
61155
|
getIngestOwner: (input) => dispatch("pipelineOrchestrator", "getIngestOwner", "query", input),
|
|
60043
61156
|
getAudioNodeLoad: (input) => dispatch("pipelineOrchestrator", "getAudioNodeLoad", "query", input),
|
|
61157
|
+
getAudioAssignments: (input) => dispatch("pipelineOrchestrator", "getAudioAssignments", "query", input),
|
|
60044
61158
|
getAgentSettings: (input) => dispatch("pipelineOrchestrator", "getAgentSettings", "query", input),
|
|
60045
61159
|
listAgentSettings: (input) => dispatch("pipelineOrchestrator", "listAgentSettings", "query", input),
|
|
60046
61160
|
removeAgentSettings: (input) => dispatch("pipelineOrchestrator", "removeAgentSettings", "mutation", input),
|
|
@@ -63432,221 +64546,21 @@ function readTimelapseGeneratedAt(rule, deviceId) {
|
|
|
63432
64546
|
return rule.lastGeneratedAt ?? 0;
|
|
63433
64547
|
}
|
|
63434
64548
|
//#endregion
|
|
63435
|
-
//#region src/pipeline/
|
|
63436
|
-
/**
|
|
63437
|
-
|
|
63438
|
-
|
|
63439
|
-
* ## The two scopes
|
|
63440
|
-
*
|
|
63441
|
-
* Almost every pipeline step's model is a **node** question: which build runs
|
|
63442
|
-
* fastest on THIS accelerator. Two nodes may legitimately answer differently —
|
|
63443
|
-
* a Coral runs the tflite SSD, a Mac runs the coreml YOLO — because the answers
|
|
63444
|
-
* are compared against nothing. They produce boxes, and a box is a box.
|
|
63445
|
-
*
|
|
63446
|
-
* Two steps are not like that. `face-embedding` and `clip-embedding` produce
|
|
63447
|
-
* **vectors that land in ONE shared index** (`identity_samples`,
|
|
63448
|
-
* `vec_object_clip`) and are ranked against each other by cosine similarity.
|
|
63449
|
-
* Cosine similarity between two encoders is not a weak signal, it is a
|
|
63450
|
-
* meaningless number — and nothing inside a vector can tell you it happened.
|
|
63451
|
-
* So for those two steps the model is a **cluster** question with exactly one
|
|
63452
|
-
* answer, stored in exactly one row.
|
|
63453
|
-
*
|
|
63454
|
-
* That is the same argument [D52](../../../../docs/decisions/adr-0052.md) makes
|
|
63455
|
-
* for the crop convention (`detail-crop.ts`), one level up: the crop decides
|
|
63456
|
-
* WHAT pixels the encoder sees, this decides WHICH encoder sees them. Both are
|
|
63457
|
-
* cluster-wide for the same reason and neither may become per-node.
|
|
63458
|
-
*
|
|
63459
|
-
* ## Why the registry lives here and not in the step catalog
|
|
63460
|
-
*
|
|
63461
|
-
* The scope itself is declared on the step, in
|
|
63462
|
-
* `detection-pipeline/registry/step-definitions.ts` (`StepDefinition.modelScope`)
|
|
63463
|
-
* — that is where a new step declares what kind of choice its model is. But the
|
|
63464
|
-
* catalog lives inside `addon-pipeline`, and three packages that must NOT
|
|
63465
|
-
* import an addon need to know the set: the orchestrator (which renders and
|
|
63466
|
-
* stores the row), post-analysis (which pins the row for a re-embed pass) and
|
|
63467
|
-
* admin-ui (which mirrors it). So the set is mirrored here, and
|
|
63468
|
-
* `scripts/check-cluster-model-scope.ts` fails the build when the two disagree.
|
|
63469
|
-
* A hand-copied key that stops matching is exactly how a setting silently stops
|
|
63470
|
-
* arriving while both sides still look correct.
|
|
63471
|
-
*
|
|
63472
|
-
* ## The defaults ARE today's behaviour
|
|
63473
|
-
*
|
|
63474
|
-
* {@link DEFAULT_CLUSTER_STEP_MODELS} reproduces the catalog `defaultModelId`
|
|
63475
|
-
* of both steps. Declaring the scope therefore changes nothing on the day it
|
|
63476
|
-
* ships: the cluster row starts out saying what every node was already doing.
|
|
63477
|
-
* Changing it is legitimate — that is what the knob is for — but it invalidates
|
|
63478
|
-
* the stored vectors of that surface, and must be followed by a re-embed pass
|
|
63479
|
-
* (`face-reembed-pass.ts`, `embedding-rebuild.ts`).
|
|
63480
|
-
*/
|
|
63481
|
-
/**
|
|
63482
|
-
* The cluster-scoped steps. Mirrored from the catalog's `modelScope: 'cluster'`
|
|
63483
|
-
* declarations and guarded by `scripts/check-cluster-model-scope.ts`.
|
|
63484
|
-
*/
|
|
63485
|
-
var CLUSTER_MODEL_SCOPED_STEPS = [{
|
|
63486
|
-
stepId: "face-embedding",
|
|
63487
|
-
label: "Face recognition model",
|
|
63488
|
-
defaultModelId: "arcface-r100",
|
|
63489
|
-
indexName: "the enrolled face gallery",
|
|
63490
|
-
options: [
|
|
63491
|
-
{
|
|
63492
|
-
id: "arcface-r100",
|
|
63493
|
-
label: "ArcFace (ResNet34)"
|
|
63494
|
-
},
|
|
63495
|
-
{
|
|
63496
|
-
id: "auraface-r100",
|
|
63497
|
-
label: "AuraFace R100"
|
|
63498
|
-
},
|
|
63499
|
-
{
|
|
63500
|
-
id: "inception-resnet-v1",
|
|
63501
|
-
label: "Inception ResNet V1"
|
|
63502
|
-
}
|
|
63503
|
-
]
|
|
63504
|
-
}, {
|
|
63505
|
-
stepId: "clip-embedding",
|
|
63506
|
-
label: "Semantic search model",
|
|
63507
|
-
defaultModelId: "mobileclip-s1",
|
|
63508
|
-
indexName: "the object semantic-search index",
|
|
63509
|
-
options: [{
|
|
63510
|
-
id: "mobileclip-s1",
|
|
63511
|
-
label: "MobileCLIP S1"
|
|
63512
|
-
}, {
|
|
63513
|
-
id: "mobileclip-s2",
|
|
63514
|
-
label: "MobileCLIP S2"
|
|
63515
|
-
}]
|
|
63516
|
-
}];
|
|
63517
|
-
/**
|
|
63518
|
-
* Store identity of the cluster row inside `pipeline-orchestrator`'s GLOBAL
|
|
63519
|
-
* (cluster-wide) settings — the same owner, and for the same reason, as the
|
|
63520
|
-
* detail-crop convention: hub-resident and neutral between the addons that
|
|
63521
|
-
* read it.
|
|
63522
|
-
*/
|
|
63523
|
-
var CLUSTER_MODEL_SECTION_ID = "cluster-step-models";
|
|
63524
|
-
/**
|
|
63525
|
-
* The settings key holding one step's cluster model choice.
|
|
63526
|
-
*
|
|
63527
|
-
* Step-qualified so the keys stay unique across the addon's whole schema, which
|
|
63528
|
-
* is what lets {@link pickClusterStepModels} walk every section instead of
|
|
63529
|
-
* trusting the section id.
|
|
63530
|
-
*/
|
|
63531
|
-
function clusterModelSettingKey(stepId) {
|
|
63532
|
-
return `clusterModel:${stepId}`;
|
|
63533
|
-
}
|
|
63534
|
-
/** True when this step's model is a cluster-wide choice rather than a per-node one. */
|
|
63535
|
-
function isClusterScopedStep(stepId) {
|
|
63536
|
-
return CLUSTER_MODEL_SCOPED_STEPS.some((s) => s.stepId === stepId);
|
|
63537
|
-
}
|
|
63538
|
-
/** The cluster row when nobody has configured one — today's catalog defaults. */
|
|
63539
|
-
var DEFAULT_CLUSTER_STEP_MODELS = Object.freeze(Object.fromEntries(CLUSTER_MODEL_SCOPED_STEPS.map((s) => [s.stepId, s.defaultModelId])));
|
|
63540
|
-
/** A stored choice is a non-empty model id, or it is not a choice. */
|
|
63541
|
-
var ChosenModelIdSchema = zod.z.string().min(1);
|
|
63542
|
-
/**
|
|
63543
|
-
* Narrow a FLAT settings record to the cluster row.
|
|
63544
|
-
*
|
|
63545
|
-
* Per-FIELD fallback, deliberately (same rule as `readDetailCropConvention`): a
|
|
63546
|
-
* junk face model must not also discard a valid clip model. An absent, empty or
|
|
63547
|
-
* non-string value resolves to the step's catalog default — the historical
|
|
63548
|
-
* behaviour — never to a blank id, because a blank id downstream becomes
|
|
63549
|
-
* "substitute the format default", which is precisely the substitution this
|
|
63550
|
-
* scope exists to forbid.
|
|
63551
|
-
*/
|
|
63552
|
-
function readClusterStepModels(config) {
|
|
63553
|
-
const out = {};
|
|
63554
|
-
for (const step of CLUSTER_MODEL_SCOPED_STEPS) {
|
|
63555
|
-
const parsed = ChosenModelIdSchema.safeParse(config[clusterModelSettingKey(step.stepId)]);
|
|
63556
|
-
out[step.stepId] = parsed.success ? parsed.data : step.defaultModelId;
|
|
63557
|
-
}
|
|
63558
|
-
return out;
|
|
63559
|
-
}
|
|
63560
|
-
function isHydratedField$2(entry) {
|
|
63561
|
-
return typeof entry === "object" && entry !== null && "key" in entry;
|
|
63562
|
-
}
|
|
63563
|
-
/**
|
|
63564
|
-
* Extract the cluster row from an `addon-settings.getGlobalSettings` payload.
|
|
63565
|
-
*
|
|
63566
|
-
* Walks EVERY section rather than looking inside {@link CLUSTER_MODEL_SECTION_ID}
|
|
63567
|
-
* alone: the keys are unique across the addon's schema, and a section rename
|
|
63568
|
-
* must not silently revert the whole cluster to the defaults. A `null` payload
|
|
63569
|
-
* (addon mid-boot) is the defaults.
|
|
63570
|
-
*/
|
|
63571
|
-
function pickClusterStepModels(view) {
|
|
63572
|
-
if (view === null) return DEFAULT_CLUSTER_STEP_MODELS;
|
|
63573
|
-
const flat = {};
|
|
63574
|
-
const wanted = new Set(CLUSTER_MODEL_SCOPED_STEPS.map((s) => clusterModelSettingKey(s.stepId)));
|
|
63575
|
-
for (const section of view.sections) for (const entry of section.fields) {
|
|
63576
|
-
if (!isHydratedField$2(entry) || typeof entry.key !== "string") continue;
|
|
63577
|
-
if (wanted.has(entry.key)) flat[entry.key] = entry.value;
|
|
63578
|
-
}
|
|
63579
|
-
return readClusterStepModels(flat);
|
|
64549
|
+
//#region src/pipeline/step-format-runnable.ts
|
|
64550
|
+
/** True when `model` ships a build for `format`. */
|
|
64551
|
+
function hasBuild(model, format) {
|
|
64552
|
+
return Boolean(model.formats[format]);
|
|
63580
64553
|
}
|
|
63581
64554
|
/**
|
|
63582
|
-
*
|
|
63583
|
-
*
|
|
63584
|
-
* `null` is the signal to LEAVE THE CALLER'S RESOLUTION ALONE — it is not "no
|
|
63585
|
-
* model". Returning a default here for a node-scoped step would quietly
|
|
63586
|
-
* override every per-(node,device) selection in the fleet.
|
|
64555
|
+
* Can a pool of `format` run a step whose catalog is `models`, given the model
|
|
64556
|
+
* the step names (`null`/absent = unpinned, the format default)?
|
|
63587
64557
|
*/
|
|
63588
|
-
function
|
|
63589
|
-
|
|
63590
|
-
|
|
63591
|
-
|
|
63592
|
-
return chosen !== void 0 && chosen !== "" ? chosen : step.defaultModelId;
|
|
63593
|
-
}
|
|
63594
|
-
/** Must match `DEFAULT_LANDMARK_PRECISION_FLOOR_PX` in the runner. */
|
|
63595
|
-
var DEFAULT_MIN_LANDMARK_FACE_SIZE_PX = 24;
|
|
63596
|
-
var CLUSTER_STEP_SETTING_FIELDS = [{
|
|
63597
|
-
stepId: "face-embedding",
|
|
63598
|
-
key: "minLandmarkFaceSize",
|
|
63599
|
-
label: "Min face size for recognition (detection px)",
|
|
63600
|
-
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.",
|
|
63601
|
-
type: "slider",
|
|
63602
|
-
min: 0,
|
|
63603
|
-
max: 64,
|
|
63604
|
-
step: 2,
|
|
63605
|
-
default: 24
|
|
63606
|
-
}];
|
|
63607
|
-
function clusterStepSettingKey(stepId, fieldKey) {
|
|
63608
|
-
return `clusterStepSetting:${stepId}:${fieldKey}`;
|
|
63609
|
-
}
|
|
63610
|
-
function clusterStepSettingFieldsFor(stepId) {
|
|
63611
|
-
return CLUSTER_STEP_SETTING_FIELDS.filter((field) => field.stepId === stepId);
|
|
63612
|
-
}
|
|
63613
|
-
var ClusterSettingNumberSchema = zod.z.number().finite();
|
|
63614
|
-
function readClusterStepSettings(config) {
|
|
63615
|
-
const out = {};
|
|
63616
|
-
for (const field of CLUSTER_STEP_SETTING_FIELDS) {
|
|
63617
|
-
const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
|
|
63618
|
-
const value = parsed.success ? parsed.data : field.default;
|
|
63619
|
-
const existing = out[field.stepId] ?? {};
|
|
63620
|
-
out[field.stepId] = {
|
|
63621
|
-
...existing,
|
|
63622
|
-
[field.key]: value
|
|
63623
|
-
};
|
|
64558
|
+
function stepModelRunsOnFormat(models, modelId, format) {
|
|
64559
|
+
if (modelId !== void 0 && modelId !== null) {
|
|
64560
|
+
const named = models.find((m) => m.id === modelId);
|
|
64561
|
+
if (named !== void 0 && hasBuild(named, format)) return true;
|
|
63624
64562
|
}
|
|
63625
|
-
return
|
|
63626
|
-
}
|
|
63627
|
-
var DEFAULT_CLUSTER_STEP_SETTINGS = readClusterStepSettings({});
|
|
63628
|
-
function pickClusterStepSettings(view) {
|
|
63629
|
-
if (view === null) return DEFAULT_CLUSTER_STEP_SETTINGS;
|
|
63630
|
-
const flat = {};
|
|
63631
|
-
const wanted = new Set(CLUSTER_STEP_SETTING_FIELDS.map((field) => clusterStepSettingKey(field.stepId, field.key)));
|
|
63632
|
-
for (const section of view.sections) for (const entry of section.fields) {
|
|
63633
|
-
if (!isHydratedField$2(entry) || typeof entry.key !== "string") continue;
|
|
63634
|
-
if (wanted.has(entry.key)) flat[entry.key] = entry.value;
|
|
63635
|
-
}
|
|
63636
|
-
return readClusterStepSettings(flat);
|
|
63637
|
-
}
|
|
63638
|
-
/**
|
|
63639
|
-
* Cluster knobs win over leftover per-device values. The cluster row is the
|
|
63640
|
-
* authority; a device-local copy is a leftover of the old per-node editor.
|
|
63641
|
-
*/
|
|
63642
|
-
function overlayClusterStepSettings(stepId, deviceSettings, cluster) {
|
|
63643
|
-
const overlay = cluster[stepId];
|
|
63644
|
-
if (overlay === void 0 || Object.keys(overlay).length === 0) return deviceSettings === void 0 ? void 0 : { ...deviceSettings };
|
|
63645
|
-
if (deviceSettings === void 0) return { ...overlay };
|
|
63646
|
-
return {
|
|
63647
|
-
...deviceSettings,
|
|
63648
|
-
...overlay
|
|
63649
|
-
};
|
|
64563
|
+
return models.some((m) => m.legacy !== true && hasBuild(m, format));
|
|
63650
64564
|
}
|
|
63651
64565
|
//#endregion
|
|
63652
64566
|
//#region src/pipeline/detail-crop.ts
|
|
@@ -66218,11 +67132,15 @@ exports.CLIP_BROKER_PACED_RATES = CLIP_BROKER_PACED_RATES;
|
|
|
66218
67132
|
exports.CLIP_PLAYBACK_OPTIONS = CLIP_PLAYBACK_OPTIONS;
|
|
66219
67133
|
exports.CLIP_REALTIME_SOURCE_RATES = CLIP_REALTIME_SOURCE_RATES;
|
|
66220
67134
|
exports.CLIP_REASON_HEADER_MAX = CLIP_REASON_HEADER_MAX;
|
|
67135
|
+
exports.CLIP_SEARCH_STRICTNESS = CLIP_SEARCH_STRICTNESS;
|
|
66221
67136
|
exports.CLIP_STILL_DISPOSITION_HEADER = CLIP_STILL_DISPOSITION_HEADER;
|
|
66222
67137
|
exports.CLIP_STILL_REASON_CODE_HEADER = CLIP_STILL_REASON_CODE_HEADER;
|
|
66223
67138
|
exports.CLIP_STILL_REASON_HEADER = CLIP_STILL_REASON_HEADER;
|
|
66224
67139
|
exports.CLIP_STREAM_SOURCE_RATES = CLIP_STREAM_SOURCE_RATES;
|
|
66225
67140
|
exports.CLIP_STREAM_TRANSPORT_HEADER = CLIP_STREAM_TRANSPORT_HEADER;
|
|
67141
|
+
exports.CLIP_STRICTNESS_FACTOR = CLIP_STRICTNESS_FACTOR;
|
|
67142
|
+
exports.CLIP_VECTOR_INDEX_PATTERN = CLIP_VECTOR_INDEX_PATTERN;
|
|
67143
|
+
exports.CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS = CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS;
|
|
66226
67144
|
exports.CLUSTER_MODEL_SCOPED_STEPS = CLUSTER_MODEL_SCOPED_STEPS;
|
|
66227
67145
|
exports.CLUSTER_MODEL_SECTION_ID = CLUSTER_MODEL_SECTION_ID;
|
|
66228
67146
|
exports.CLUSTER_STEP_SETTING_FIELDS = CLUSTER_STEP_SETTING_FIELDS;
|
|
@@ -66277,9 +67195,11 @@ exports.ClimateControlStatusSchema = ClimateControlStatusSchema;
|
|
|
66277
67195
|
exports.ClipBytesOfferSchema = ClipBytesOfferSchema;
|
|
66278
67196
|
exports.ClipBytesSchema = ClipBytesSchema;
|
|
66279
67197
|
exports.ClipExportFailureSchema = ClipExportFailureSchema;
|
|
67198
|
+
exports.ClipModelMetaSchema = ClipModelMetaSchema;
|
|
66280
67199
|
exports.ClipPlaybackOptionsSchema = ClipPlaybackOptionsSchema;
|
|
66281
67200
|
exports.ClipPlaybackSchema = ClipPlaybackSchema;
|
|
66282
67201
|
exports.ClipSchema = ClipSchema;
|
|
67202
|
+
exports.ClipSearchStrictnessSchema = ClipSearchStrictnessSchema;
|
|
66283
67203
|
exports.ClipSourceAvailabilitySchema = ClipSourceAvailabilitySchema;
|
|
66284
67204
|
exports.ClipSourceSchema = ClipSourceSchema;
|
|
66285
67205
|
exports.ClipStillDispositionSchema = ClipStillDispositionSchema;
|
|
@@ -66290,6 +67210,7 @@ exports.ClipStreamDialSchema = ClipStreamDialSchema;
|
|
|
66290
67210
|
exports.ClipWakeSchema = ClipWakeSchema;
|
|
66291
67211
|
exports.ClusterAddonNodeDeploymentSchema = ClusterAddonNodeDeploymentSchema;
|
|
66292
67212
|
exports.ClusterAddonStatusEntrySchema = ClusterAddonStatusEntrySchema;
|
|
67213
|
+
exports.ClusterModelChoiceSchema = ClusterModelChoiceSchema;
|
|
66293
67214
|
exports.CollectionColumnSchema = CollectionColumnSchema;
|
|
66294
67215
|
exports.CollectionIndexSchema = CollectionIndexSchema;
|
|
66295
67216
|
exports.ColorStatusSchema = ColorStatusSchema;
|
|
@@ -66370,6 +67291,7 @@ exports.DISPLAY_ICON_GROUPS = DISPLAY_ICON_GROUPS;
|
|
|
66370
67291
|
exports.DISPLAY_ICON_KEYS = DISPLAY_ICON_KEYS;
|
|
66371
67292
|
exports.DISPLAY_ICON_OFFERED_KEYS = DISPLAY_ICON_OFFERED_KEYS;
|
|
66372
67293
|
exports.DISPLAY_ICON_VOCABULARY = DISPLAY_ICON_VOCABULARY;
|
|
67294
|
+
exports.DOORBELL_SOURCE_SLOT = DOORBELL_SOURCE_SLOT;
|
|
66373
67295
|
exports.DataStoreEngineInfoSchema = EngineInfoSchema;
|
|
66374
67296
|
exports.DayNightModeSchema = DayNightModeSchema;
|
|
66375
67297
|
exports.DayNightOptionsSchema = DayNightOptionsSchema;
|
|
@@ -66411,7 +67333,11 @@ exports.DiscoveredTargetSchema = DiscoveredTargetSchema;
|
|
|
66411
67333
|
exports.DiskReconcileJobSchema = DiskReconcileJobSchema;
|
|
66412
67334
|
exports.DisposerChain = require_sleep.DisposerChain;
|
|
66413
67335
|
exports.DoorbellPressEventSchema = DoorbellPressEventSchema;
|
|
67336
|
+
exports.DoorbellSourceSlotValueSchema = DoorbellSourceSlotValueSchema;
|
|
66414
67337
|
exports.DoorbellStatusSchema = DoorbellStatusSchema;
|
|
67338
|
+
exports.EMBEDDING_MODEL_FAILED = EMBEDDING_MODEL_FAILED;
|
|
67339
|
+
exports.EMBEDDING_REQUIREMENTS_FAILED = EMBEDDING_REQUIREMENTS_FAILED;
|
|
67340
|
+
exports.EMBEDDING_REQUIREMENTS_UNAVAILABLE = EMBEDDING_REQUIREMENTS_UNAVAILABLE;
|
|
66415
67341
|
exports.EVENTFUL_CAP_NAMES = EVENTFUL_CAP_NAMES;
|
|
66416
67342
|
exports.EVENT_DENSITY_BATCH_MAX = EVENT_DENSITY_BATCH_MAX;
|
|
66417
67343
|
exports.EVENT_KIND_BY_CAP = EVENT_KIND_BY_CAP;
|
|
@@ -66424,14 +67350,23 @@ exports.EXPRESSION_BUILTIN_NAMES = EXPRESSION_BUILTIN_NAMES;
|
|
|
66424
67350
|
exports.EXPRESSION_COMPILE_CACHE_CAPACITY = EXPRESSION_COMPILE_CACHE_CAPACITY;
|
|
66425
67351
|
exports.EXPRESSION_IDENTIFIER_RE = EXPRESSION_IDENTIFIER_RE;
|
|
66426
67352
|
exports.EXPRESSION_INJECTED_NOW = EXPRESSION_INJECTED_NOW;
|
|
67353
|
+
exports.EXTENSION_HOST_DEVICE_TYPES = EXTENSION_HOST_DEVICE_TYPES;
|
|
67354
|
+
exports.EXTENSION_SLOTS = EXTENSION_SLOTS;
|
|
67355
|
+
exports.EXTENSION_SLOT_IDS = EXTENSION_SLOT_IDS;
|
|
67356
|
+
exports.EXTENSION_SLOT_LISTING_METHOD = EXTENSION_SLOT_LISTING_METHOD;
|
|
67357
|
+
exports.EXTENSION_SLOT_REF_SEPARATOR = EXTENSION_SLOT_REF_SEPARATOR;
|
|
66427
67358
|
exports.EffectiveTuningSchema = EffectiveTuningSchema;
|
|
66428
67359
|
exports.EgressEncodeSchema = EgressEncodeSchema;
|
|
66429
67360
|
exports.EgressRateControlSchema = EgressRateControlSchema;
|
|
66430
67361
|
exports.EgressTranscodeRequestSchema = EgressTranscodeRequestSchema;
|
|
66431
67362
|
exports.EgressTranscodeSchema = EgressTranscodeSchema;
|
|
66432
67363
|
exports.ElementConfigStore = ElementConfigStore;
|
|
67364
|
+
exports.EmbeddingFailedModelSchema = EmbeddingFailedModelSchema;
|
|
67365
|
+
exports.EmbeddingFailedRequirementSchema = EmbeddingFailedRequirementSchema;
|
|
66433
67366
|
exports.EmbeddingInfoSchema = EmbeddingInfoSchema;
|
|
67367
|
+
exports.EmbeddingRefusalCodeSchema = EmbeddingRefusalCodeSchema;
|
|
66434
67368
|
exports.EmbeddingResultSchema = EmbeddingResultSchema;
|
|
67369
|
+
exports.EmbeddingTowerSchema = EmbeddingTowerSchema;
|
|
66435
67370
|
exports.EncodeProfileSchema = EncodeProfileSchema;
|
|
66436
67371
|
exports.EncodedPacketSchema = require_sleep.EncodedPacketSchema;
|
|
66437
67372
|
exports.EnrichedWidgetMetadataSchema = EnrichedWidgetMetadataSchema;
|
|
@@ -66476,6 +67411,21 @@ exports.ExpressionGlobalBindingSchema = ExpressionGlobalBindingSchema;
|
|
|
66476
67411
|
exports.ExpressionLiteralBindingSchema = ExpressionLiteralBindingSchema;
|
|
66477
67412
|
exports.ExpressionParseError = ExpressionParseError;
|
|
66478
67413
|
exports.ExpressionSourceSchema = ExpressionSourceSchema;
|
|
67414
|
+
exports.ExtensionCandidateSchema = ExtensionCandidateSchema;
|
|
67415
|
+
exports.ExtensionCandidatesSchema = ExtensionCandidatesSchema;
|
|
67416
|
+
exports.ExtensionSetResultSchema = ExtensionSetResultSchema;
|
|
67417
|
+
exports.ExtensionSetSlotInputSchema = ExtensionSetSlotInputSchema;
|
|
67418
|
+
exports.ExtensionSlotActivationSchema = ExtensionSlotActivationSchema;
|
|
67419
|
+
exports.ExtensionSlotIdSchema = ExtensionSlotIdSchema;
|
|
67420
|
+
exports.ExtensionSlotRefInputSchema = ExtensionSlotRefInputSchema;
|
|
67421
|
+
exports.ExtensionSlotRowSchema = ExtensionSlotRowSchema;
|
|
67422
|
+
exports.ExtensionSlotSourceSchema = ExtensionSlotSourceSchema;
|
|
67423
|
+
exports.ExtensionSlotStateSchema = ExtensionSlotStateSchema;
|
|
67424
|
+
exports.ExtensionSlotUnreachableSchema = ExtensionSlotUnreachableSchema;
|
|
67425
|
+
exports.ExtensionSlotValueSchema = ExtensionSlotValueSchema;
|
|
67426
|
+
exports.ExtensionSourceAvailabilitySchema = ExtensionSourceAvailabilitySchema;
|
|
67427
|
+
exports.ExtensionSourceHealthSchema = ExtensionSourceHealthSchema;
|
|
67428
|
+
exports.ExtensionSourceSchema = ExtensionSourceSchema;
|
|
66479
67429
|
exports.FIRST_LEVEL_MACRO_CLASSES = FIRST_LEVEL_MACRO_CLASSES;
|
|
66480
67430
|
exports.FULL_IMAGE_BBOX = FULL_IMAGE_BBOX;
|
|
66481
67431
|
exports.FailureContributionSchema = FailureContributionSchema;
|
|
@@ -66532,6 +67482,7 @@ exports.IntercomStatusSchema = IntercomStatusSchema;
|
|
|
66532
67482
|
exports.KNOWN_CAP_NAMES = KNOWN_CAP_NAMES;
|
|
66533
67483
|
exports.KeyEventSchema = KeyEventSchema;
|
|
66534
67484
|
exports.LEGACY_READ_ONLY_CONFIG_KEY = LEGACY_READ_ONLY_CONFIG_KEY;
|
|
67485
|
+
exports.LINKED_DEVICES_SLOT = LINKED_DEVICES_SLOT;
|
|
66535
67486
|
exports.LOAD_CONTRIBUTION_ATTRIBUTIONS = LOAD_CONTRIBUTION_ATTRIBUTIONS;
|
|
66536
67487
|
exports.LOAD_CONTRIBUTION_ROLES = LOAD_CONTRIBUTION_ROLES;
|
|
66537
67488
|
exports.LOCATION_DESCRIPTION_MAX = LOCATION_DESCRIPTION_MAX;
|
|
@@ -66554,6 +67505,7 @@ exports.LedgerWalkSkipReasonSchema = LedgerWalkSkipReasonSchema;
|
|
|
66554
67505
|
exports.LegacyStorageLocationDefaultSchema = LegacyStorageLocationDefaultSchema;
|
|
66555
67506
|
exports.LinkedDeviceSchema = LinkedDeviceSchema;
|
|
66556
67507
|
exports.LinkedDevicesModeSchema = LinkedDevicesModeSchema;
|
|
67508
|
+
exports.LinkedDevicesSlotValueSchema = LinkedDevicesSlotValueSchema;
|
|
66557
67509
|
exports.LlmDefaultSchema = LlmDefaultSchema;
|
|
66558
67510
|
exports.LlmDefaultSelectorSchema = LlmDefaultSelectorSchema;
|
|
66559
67511
|
exports.LlmDownloadProgressSchema = LlmDownloadProgressSchema;
|
|
@@ -66725,6 +67677,8 @@ exports.NC_AUDIO_SEED = NC_AUDIO_SEED;
|
|
|
66725
67677
|
exports.NC_AUTHORABLE_SYSTEM_EVENT_KINDS = NC_AUTHORABLE_SYSTEM_EVENT_KINDS;
|
|
66726
67678
|
exports.NC_BASE_CONDITION_KEYS = NC_BASE_CONDITION_KEYS;
|
|
66727
67679
|
exports.NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS = NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS;
|
|
67680
|
+
exports.NC_CLIP_POST_ROLL_DEFAULT_SEC = NC_CLIP_POST_ROLL_DEFAULT_SEC;
|
|
67681
|
+
exports.NC_CLIP_PRE_ROLL_DEFAULT_SEC = NC_CLIP_PRE_ROLL_DEFAULT_SEC;
|
|
66728
67682
|
exports.NC_CLIP_RETENTION_MAX_SEC = NC_CLIP_RETENTION_MAX_SEC;
|
|
66729
67683
|
exports.NC_CONDITION_CATALOG = NC_CONDITION_CATALOG;
|
|
66730
67684
|
exports.NC_CONFIRM_DEFAULT_MAX_IMAGE_PX = NC_CONFIRM_DEFAULT_MAX_IMAGE_PX;
|
|
@@ -66986,6 +67940,7 @@ exports.ReadSegmentBytesResultSchema = ReadSegmentBytesResultSchema;
|
|
|
66986
67940
|
exports.ReadWindowBytesResultSchema = ReadWindowBytesResultSchema;
|
|
66987
67941
|
exports.ReadinessRegistry = require_sleep.ReadinessRegistry;
|
|
66988
67942
|
exports.ReadinessTimeoutError = require_sleep.ReadinessTimeoutError;
|
|
67943
|
+
exports.RebuildObjectEmbeddingsRefusalSchema = RebuildObjectEmbeddingsRefusalSchema;
|
|
66989
67944
|
exports.RecentTracksPageSchema = RecentTracksPageSchema;
|
|
66990
67945
|
exports.RecentTracksQueryInput = RecentTracksQueryInput;
|
|
66991
67946
|
exports.RecordTriggerSchema = RecordTriggerSchema;
|
|
@@ -67065,6 +68020,7 @@ exports.RunnerCameraConfigSchema = RunnerCameraConfigSchema;
|
|
|
67065
68020
|
exports.RunnerCameraDeviceUIFields = RunnerCameraDeviceUIFields;
|
|
67066
68021
|
exports.RunnerFrameSourceSchema = RunnerFrameSourceSchema;
|
|
67067
68022
|
exports.RunnerInferenceDeviceSchema = RunnerInferenceDeviceSchema;
|
|
68023
|
+
exports.RunnerJumpStepProvisioningSchema = RunnerJumpStepProvisioningSchema;
|
|
67068
68024
|
exports.RunnerLocalLoadSchema = RunnerLocalLoadSchema;
|
|
67069
68025
|
exports.RunnerLocalMetricsSchema = RunnerLocalMetricsSchema;
|
|
67070
68026
|
exports.SCENE_CONDITIONS = SCENE_CONDITIONS;
|
|
@@ -67264,6 +68220,7 @@ exports.UpdateStatusSchema = UpdateStatusSchema;
|
|
|
67264
68220
|
exports.UpdateUserInputSchema = UpdateUserInputSchema;
|
|
67265
68221
|
exports.UserRecordSchema = UserRecordSchema;
|
|
67266
68222
|
exports.UserSummarySchema = UserSummarySchema;
|
|
68223
|
+
exports.VECTOR_INDEX_DIM_CONFLICT = VECTOR_INDEX_DIM_CONFLICT;
|
|
67267
68224
|
exports.VIDEOCLIPS_MAX_OFFER_BYTES = VIDEOCLIPS_MAX_OFFER_BYTES;
|
|
67268
68225
|
exports.VIDEOCLIPS_MAX_READ_BYTES = VIDEOCLIPS_MAX_READ_BYTES;
|
|
67269
68226
|
exports.VISIT_MERGE_GAP_MS = VISIT_MERGE_GAP_MS;
|
|
@@ -67424,6 +68381,7 @@ exports.coreBlocksCapability = coreBlocksCapability;
|
|
|
67424
68381
|
exports.cosineSimilarity = cosineSimilarity;
|
|
67425
68382
|
exports.countConditionLeaves = countConditionLeaves;
|
|
67426
68383
|
exports.coverCapability = coverCapability;
|
|
68384
|
+
exports.createDeviceExtensionProvider = createDeviceExtensionProvider;
|
|
67427
68385
|
exports.createDeviceProxy = require_sleep.createDeviceProxy;
|
|
67428
68386
|
exports.createDurableState = require_sleep.createDurableState;
|
|
67429
68387
|
exports.createEvent = require_sleep.createEvent;
|
|
@@ -67448,6 +68406,7 @@ exports.decoderCapability = decoderCapability;
|
|
|
67448
68406
|
exports.defaultDeliveryForSection = defaultDeliveryForSection;
|
|
67449
68407
|
exports.defaultDeviceFor = defaultDeviceFor;
|
|
67450
68408
|
exports.defineCustomActions = require_sleep.defineCustomActions;
|
|
68409
|
+
exports.defineExtensionSlotProvider = defineExtensionSlotProvider;
|
|
67451
68410
|
exports.deriveBatteryPresence = deriveBatteryPresence;
|
|
67452
68411
|
exports.deriveCameraSwitches = deriveCameraSwitches;
|
|
67453
68412
|
exports.deriveDetailCropRect = deriveDetailCropRect;
|
|
@@ -67466,6 +68425,7 @@ exports.deviceBackendToFormat = deviceBackendToFormat;
|
|
|
67466
68425
|
exports.deviceCustomAction = require_sleep.deviceCustomAction;
|
|
67467
68426
|
exports.deviceDiscoveryCapability = deviceDiscoveryCapability;
|
|
67468
68427
|
exports.deviceExportCapability = deviceExportCapability;
|
|
68428
|
+
exports.deviceExtensionCapability = deviceExtensionCapability;
|
|
67469
68429
|
exports.deviceManagerCapability = deviceManagerCapability;
|
|
67470
68430
|
exports.deviceMatchesProfile = deviceMatchesProfile;
|
|
67471
68431
|
exports.deviceOpsCapability = require_sleep.deviceOpsCapability;
|
|
@@ -67480,6 +68440,11 @@ exports.droppedConditionsForKind = droppedConditionsForKind;
|
|
|
67480
68440
|
exports.egressTranscodeSharingKey = egressTranscodeSharingKey;
|
|
67481
68441
|
exports.egressTransportFromRequest = egressTransportFromRequest;
|
|
67482
68442
|
exports.embeddingEncoderCapability = embeddingEncoderCapability;
|
|
68443
|
+
exports.embeddingModelFailedError = embeddingModelFailedError;
|
|
68444
|
+
exports.embeddingModelFailedOf = embeddingModelFailedOf;
|
|
68445
|
+
exports.embeddingRefusalOf = embeddingRefusalOf;
|
|
68446
|
+
exports.embeddingRequirementsFailedError = embeddingRequirementsFailedError;
|
|
68447
|
+
exports.embeddingRequirementsUnavailableError = embeddingRequirementsUnavailableError;
|
|
67483
68448
|
exports.emitDownForOwnedCaps = require_sleep.emitDownForOwnedCaps;
|
|
67484
68449
|
exports.emitReadiness = require_sleep.emitReadiness;
|
|
67485
68450
|
exports.emitsCollectionSelector = emitsCollectionSelector;
|
|
@@ -67503,6 +68468,7 @@ exports.expandAudioChunkToF32le = require_sleep.expandAudioChunkToF32le;
|
|
|
67503
68468
|
exports.expandCapMethods = require_sleep.expandCapMethods;
|
|
67504
68469
|
exports.expandContainer = expandContainer;
|
|
67505
68470
|
exports.exportSubjectOf = exportSubjectOf;
|
|
68471
|
+
exports.extensionSlotRef = extensionSlotRef;
|
|
67506
68472
|
exports.extractNestedAddonId = extractNestedAddonId;
|
|
67507
68473
|
exports.extractSourceInfoFromMetadata = extractSourceInfoFromMetadata;
|
|
67508
68474
|
exports.faceGalleryCapability = faceGalleryCapability;
|
|
@@ -67538,6 +68504,8 @@ exports.inferModelProvider = inferModelProvider;
|
|
|
67538
68504
|
exports.initialPoolMemoryState = initialPoolMemoryState;
|
|
67539
68505
|
exports.integrationsCapability = integrationsCapability;
|
|
67540
68506
|
exports.intercomCapability = intercomCapability;
|
|
68507
|
+
exports.interpretStoredClusterModel = interpretStoredClusterModel;
|
|
68508
|
+
exports.invalidClusterStepModelEntries = invalidClusterStepModelEntries;
|
|
67541
68509
|
exports.invocationFromEncodeProfile = require_canonical_hash.invocationFromEncodeProfile;
|
|
67542
68510
|
exports.isAgentOnlyPlacement = isAgentOnlyPlacement;
|
|
67543
68511
|
exports.isArrayOutputSchema = isArrayOutputSchema;
|
|
@@ -67553,6 +68521,7 @@ exports.isDetectionMacroClass = isDetectionMacroClass;
|
|
|
67553
68521
|
exports.isDeviceConfigCap = require_sleep.isDeviceConfigCap;
|
|
67554
68522
|
exports.isDeviceScopedCap = require_sleep.isDeviceScopedCap;
|
|
67555
68523
|
exports.isDisplayIconKey = isDisplayIconKey;
|
|
68524
|
+
exports.isEmbeddingModelFailed = isEmbeddingModelFailed;
|
|
67556
68525
|
exports.isEvent = require_sleep.isEvent;
|
|
67557
68526
|
exports.isEventOwnerType = isEventOwnerType;
|
|
67558
68527
|
exports.isFirstLevelMacroClass = isFirstLevelMacroClass;
|
|
@@ -67575,6 +68544,7 @@ exports.isSystemDelivery = isSystemDelivery;
|
|
|
67575
68544
|
exports.isSystemEventFamily = isSystemEventFamily;
|
|
67576
68545
|
exports.isSystemEventSummaryRule = isSystemEventSummaryRule;
|
|
67577
68546
|
exports.isSystemRuleKind = isSystemRuleKind;
|
|
68547
|
+
exports.isVectorIndexDimConflict = isVectorIndexDimConflict;
|
|
67578
68548
|
exports.isVoidInput = isVoidInput;
|
|
67579
68549
|
exports.ituDbfsFromPreEpoch = ituDbfsFromPreEpoch;
|
|
67580
68550
|
exports.jobKindSchema = jobKindSchema;
|
|
@@ -67637,6 +68607,7 @@ exports.nodePin = require_sleep.nodePin;
|
|
|
67637
68607
|
exports.nodesCapability = nodesCapability;
|
|
67638
68608
|
exports.normalizeAddonInitResult = require_sleep.normalizeAddonInitResult;
|
|
67639
68609
|
exports.normalizeAudioLabel = normalizeAudioLabel;
|
|
68610
|
+
exports.normalizeNodeId = require_sleep.normalizeNodeId;
|
|
67640
68611
|
exports.normalizeTokenScopes = normalizeTokenScopes;
|
|
67641
68612
|
exports.normalizeUnit = normalizeUnit;
|
|
67642
68613
|
exports.notificationOutputCapability = notificationOutputCapability;
|
|
@@ -67670,6 +68641,7 @@ exports.pickAccessoryControl = pickAccessoryControl;
|
|
|
67670
68641
|
exports.pickClusterStepModels = pickClusterStepModels;
|
|
67671
68642
|
exports.pickClusterStepSettings = pickClusterStepSettings;
|
|
67672
68643
|
exports.pickDetailCropConvention = pickDetailCropConvention;
|
|
68644
|
+
exports.pickInvalidClusterStepModels = pickInvalidClusterStepModels;
|
|
67673
68645
|
exports.pickNativeLeaseOverride = pickNativeLeaseOverride;
|
|
67674
68646
|
exports.pickPreferredRtspEntry = pickPreferredRtspEntry;
|
|
67675
68647
|
exports.pickRestartCandidate = pickRestartCandidate;
|
|
@@ -67717,6 +68689,7 @@ exports.resolveAddonGroup = resolveAddonGroup;
|
|
|
67717
68689
|
exports.resolveAddonPlacement = resolveAddonPlacement;
|
|
67718
68690
|
exports.resolveBucketMs = resolveBucketMs;
|
|
67719
68691
|
exports.resolveCapMount = require_sleep.resolveCapMount;
|
|
68692
|
+
exports.resolveClipSearchMinScore = resolveClipSearchMinScore;
|
|
67720
68693
|
exports.resolveClusterStepModelId = resolveClusterStepModelId;
|
|
67721
68694
|
exports.resolveContainerPrimaryChild = resolveContainerPrimaryChild;
|
|
67722
68695
|
exports.resolveCreateExportSubject = resolveCreateExportSubject;
|
|
@@ -67780,6 +68753,7 @@ exports.snapshotCapability = snapshotCapability;
|
|
|
67780
68753
|
exports.ssoBridgeCapability = ssoBridgeCapability;
|
|
67781
68754
|
exports.startReachabilityPoll = startReachabilityPoll;
|
|
67782
68755
|
exports.stateVocabularyFor = stateVocabularyFor;
|
|
68756
|
+
exports.stepModelRunsOnFormat = stepModelRunsOnFormat;
|
|
67783
68757
|
exports.storageCapability = storageCapability;
|
|
67784
68758
|
exports.storageEvictableCapability = storageEvictableCapability;
|
|
67785
68759
|
exports.storageMigrationCapability = storageMigrationCapability;
|
|
@@ -67836,6 +68810,7 @@ exports.tryConvertUnit = tryConvertUnit;
|
|
|
67836
68810
|
exports.turnProviderCapability = turnProviderCapability;
|
|
67837
68811
|
exports.unitDimension = unitDimension;
|
|
67838
68812
|
exports.unitsForDimension = unitsForDimension;
|
|
68813
|
+
exports.unreachableExtensionSlotRow = unreachableExtensionSlotRow;
|
|
67839
68814
|
exports.updateCapability = updateCapability;
|
|
67840
68815
|
exports.userManagementCapability = userManagementCapability;
|
|
67841
68816
|
exports.userPasskeysCapability = userPasskeysCapability;
|
|
@@ -67844,6 +68819,7 @@ exports.validateExpressionSource = validateExpressionSource;
|
|
|
67844
68819
|
exports.validateRecipeBounds = validateRecipeBounds;
|
|
67845
68820
|
exports.valveCapability = valveCapability;
|
|
67846
68821
|
exports.vectorDimFromBase64 = vectorDimFromBase64;
|
|
68822
|
+
exports.vectorIndexDimConflictError = vectorIndexDimConflictError;
|
|
67847
68823
|
exports.vectorStoreCapability = vectorStoreCapability;
|
|
67848
68824
|
exports.vibrationCapability = vibrationCapability;
|
|
67849
68825
|
exports.videoclipsCapability = videoclipsCapability;
|