@camstack/addon-ai 0.4.124 → 0.4.125

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.mjs CHANGED
@@ -5551,7 +5551,7 @@ function number(params) {
5551
5551
  return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
5552
5552
  }
5553
5553
  //#endregion
5554
- //#region ../types/dist/sleep-BaRu0bS5.mjs
5554
+ //#region ../types/dist/sleep-BXv0ZcRa.mjs
5555
5555
  /**
5556
5556
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5557
5557
  * window to float samples (D455).
@@ -6336,6 +6336,40 @@ var BaseAddon = class {
6336
6336
  const node = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
6337
6337
  return keys.size > 0 ? projectStore(raw, keys, node) : raw;
6338
6338
  }
6339
+ /**
6340
+ * Whether ONE global key of this addon's store was written, read three-way
6341
+ * (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
6342
+ * reports `value ?? default`, so "the operator chose the default" and "nobody
6343
+ * chose" look the same, and a failed read looks like both. A `perNode` key is
6344
+ * not supported here: its stored name is scoped.
6345
+ */
6346
+ async readStoredGlobalKey(key) {
6347
+ const read = this._ctx?.settings?.readAddonStoreResult;
6348
+ if (read === void 0) return {
6349
+ kind: "unreadable",
6350
+ reason: "three-way-read-unavailable"
6351
+ };
6352
+ let result;
6353
+ try {
6354
+ result = await read.call(this._ctx?.settings);
6355
+ } catch (err) {
6356
+ return {
6357
+ kind: "unreadable",
6358
+ reason: "store-read-failed",
6359
+ error: err instanceof Error ? err.message : String(err)
6360
+ };
6361
+ }
6362
+ if (result.kind === "failed") return {
6363
+ kind: "unreadable",
6364
+ reason: "store-read-failed",
6365
+ error: result.error
6366
+ };
6367
+ if (result.kind === "missing" || !Object.prototype.hasOwnProperty.call(result.value, key)) return { kind: "absent" };
6368
+ return {
6369
+ kind: "present",
6370
+ value: result.value[key]
6371
+ };
6372
+ }
6339
6373
  async updateGlobalSettings(patch, nodeId) {
6340
6374
  const keys = this.perNodeKeys();
6341
6375
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
@@ -9637,6 +9671,43 @@ var LogChannelWindowSchema = object({
9637
9671
  /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9638
9672
  deviceIds: array(number$1().int()).readonly().nullable()
9639
9673
  });
9674
+ var ClipModelMetaSchema = object({
9675
+ /** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
9676
+ textModelId: string().min(1),
9677
+ /** Output dimension of BOTH towers. A vector of any other length is refused. */
9678
+ embeddingDim: number$1().int().positive(),
9679
+ /**
9680
+ * The `vector-store` index this model's vectors live in. ONE feature space
9681
+ * per index: two models share an index only when their vectors are ranked
9682
+ * against each other, which for CLIP means never across families. MobileCLIP
9683
+ * S1 and S2 share `object-clip` for history (separated by the row's
9684
+ * `modelId`); any other model gets its own.
9685
+ */
9686
+ vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
9687
+ /**
9688
+ * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
9689
+ * must be unique per tokenizer: every model's siblings land in ONE flat
9690
+ * models directory, so two different tokenizers under the same name would
9691
+ * silently overwrite each other (whichever model downloaded last wins, and
9692
+ * the other one tokenises with the wrong vocabulary).
9693
+ */
9694
+ tokenizerFile: string().min(1),
9695
+ /** Token window the text graph takes (SigLIP2: 64; CLIP BPE: 77). */
9696
+ contextLength: number$1().int().positive(),
9697
+ /** Id the tokenizer pads with. */
9698
+ padId: number$1().int().nonnegative(),
9699
+ /**
9700
+ * The search cosine floor at `strictness: 'loose'` — calibrated per model,
9701
+ * because cosine bands are a property of the model: 0.2 keeps 96% of matched
9702
+ * COCO caption-image pairs on MobileCLIP S1 and 2.7% on SigLIP2.
9703
+ */
9704
+ searchMinScore: number$1().min(0).max(1)
9705
+ });
9706
+ var ClipSearchStrictnessSchema = _enum([
9707
+ "loose",
9708
+ "balanced",
9709
+ "strict"
9710
+ ]);
9640
9711
  var MODEL_FORMATS = [
9641
9712
  "onnx",
9642
9713
  "coreml",
@@ -9840,7 +9911,14 @@ var ModelCatalogEntrySchema = object({
9840
9911
  * applies (Frigate / COCO public catalog). Set on a custom model whose raw
9841
9912
  * labels already ARE the CamStack macros (Scrypted identity map).
9842
9913
  */
9843
- classMap: DetectionCatalogClassMapSchema.optional()
9914
+ classMap: DetectionCatalogClassMapSchema.optional(),
9915
+ /**
9916
+ * The model's CLIP feature-space contract (text encoder, dimension, vector
9917
+ * index, token window, search floor) — see `clip-model.ts`. Present ONLY on a
9918
+ * CLIP image encoder; its absence is what "not a CLIP model" means to the
9919
+ * embedding encoder and the semantic-search store (D649).
9920
+ */
9921
+ clip: ClipModelMetaSchema.optional()
9844
9922
  });
9845
9923
  var ConvertTargetSchema = discriminatedUnion("format", [object({
9846
9924
  format: literal("openvino"),
@@ -14058,6 +14136,13 @@ var LinkedDeviceSchema = object({
14058
14136
  features: array(string()),
14059
14137
  producesTrackedEvents: boolean().optional()
14060
14138
  });
14139
+ /**
14140
+ * The `linked-devices` extension slot's editable value (D648): the operator's
14141
+ * pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
14142
+ * in it — they are always linked and are not a pick.
14143
+ */
14144
+ var LinkedDevicesSlotValueSchema = object({ deviceIds: array(number$1().int().positive()) });
14145
+ DeviceType.Camera;
14061
14146
  /** One camera's resolved linked set, tagged with the camera it belongs to.
14062
14147
  * The batch answer needs the tag; the single-device answer already has it
14063
14148
  * from the input, which is why `getLinkedDevices` keeps the untagged shape. */
@@ -14583,16 +14668,101 @@ var EmbeddingResultSchema = object({
14583
14668
  embedding: array(number$1()),
14584
14669
  inferenceMs: number$1()
14585
14670
  });
14671
+ /** The two CLIP towers the encoder runs; a crash budget is kept per tower. */
14672
+ var EmbeddingTowerSchema = _enum(["image", "text"]);
14673
+ /**
14674
+ * A tower in the terminal `failed` state (D649, D6): it crashed or failed to
14675
+ * load `crashes` times within `windowMs`, and is refused by name until an
14676
+ * operator `resetFailedModels` or a model change — never on a timer.
14677
+ *
14678
+ * `nodeId` is the node whose tower failed. The state lives in THAT node's
14679
+ * encoder process (in memory — a runner respawn clears it), and one node's
14680
+ * answer says nothing about another's.
14681
+ */
14682
+ var EmbeddingFailedModelSchema = object({
14683
+ modelId: string(),
14684
+ tower: EmbeddingTowerSchema,
14685
+ nodeId: string(),
14686
+ crashes: number$1(),
14687
+ windowMs: number$1(),
14688
+ sinceMs: number$1(),
14689
+ lastReason: string()
14690
+ });
14691
+ /**
14692
+ * A model whose REQUIREMENTS can never be met on this node (D649 round 5):
14693
+ * an id the catalog does not know, a model URL answering 404/410, a declared
14694
+ * sibling (the tokenizer) that is not there. After `attempts` failed builds
14695
+ * it is terminally `requirements-failed`, refused by name until an operator
14696
+ * `resetFailedModels` or a model change — the same exits as a crashed tower.
14697
+ */
14698
+ var EmbeddingFailedRequirementSchema = object({
14699
+ modelId: string(),
14700
+ tower: EmbeddingTowerSchema,
14701
+ nodeId: string(),
14702
+ attempts: number$1(),
14703
+ sinceMs: number$1(),
14704
+ lastReason: string()
14705
+ });
14586
14706
  var EmbeddingInfoSchema = object({
14587
14707
  modelId: string(),
14588
14708
  embeddingDim: number$1(),
14589
- ready: boolean()
14590
- });
14709
+ ready: boolean(),
14710
+ /**
14711
+ * The node that answered. Absent only from an encoder older than D649's
14712
+ * crash budget — whose `failedModels` is then UNKNOWN (D315), never "none".
14713
+ */
14714
+ nodeId: string().optional(),
14715
+ /**
14716
+ * Towers in `failed` on the answering node, each row naming it. `undefined`
14717
+ * means the node could not say (pre-budget encoder); a node that has the
14718
+ * budget always answers an array, empty included.
14719
+ */
14720
+ failedModels: array(EmbeddingFailedModelSchema).optional(),
14721
+ /** Models terminally `requirements-failed` on the answering node; same reading as above. */
14722
+ failedRequirements: array(EmbeddingFailedRequirementSchema).optional()
14723
+ });
14724
+ /**
14725
+ * The THREE codes an encoder refusal can carry (D649, D6). Same shape as
14726
+ * `VECTOR_INDEX_DIM_CONFLICT`: the code rides in the MESSAGE, because an
14727
+ * Error's own properties do not survive the UDS/tRPC hop and its message does,
14728
+ * and both sides go through the helpers below — the encoder builds the
14729
+ * refusal, the live detail plane classifies on it to count refusals per
14730
+ * camera instead of logging one warning per track. The bracketed token
14731
+ * carries the code, the model, the tower and the node so a consumer never
14732
+ * parses prose.
14733
+ *
14734
+ * - `EMBEDDING_MODEL_FAILED`: the tower crashed / failed to load past the crash
14735
+ * budget — terminal until `resetFailedModels` or a model change.
14736
+ * - `EMBEDDING_REQUIREMENTS_UNAVAILABLE`: files or runtime not there right now
14737
+ * (a download or Python that failed, or the cooldown after one) — the next
14738
+ * request past the cooldown tries again.
14739
+ * - `EMBEDDING_REQUIREMENTS_FAILED`: the requirements can never be met (unknown
14740
+ * id, 404/410, missing sibling) and the bounded attempts are spent —
14741
+ * terminal, same exits as a crashed tower.
14742
+ */
14743
+ var EMBEDDING_MODEL_FAILED = "embedding-model-failed";
14744
+ var EMBEDDING_REQUIREMENTS_UNAVAILABLE = "embedding-requirements-unavailable";
14745
+ var EMBEDDING_REQUIREMENTS_FAILED = "embedding-requirements-failed";
14746
+ _enum([
14747
+ EMBEDDING_MODEL_FAILED,
14748
+ EMBEDDING_REQUIREMENTS_UNAVAILABLE,
14749
+ EMBEDDING_REQUIREMENTS_FAILED
14750
+ ]);
14751
+ new RegExp(`\\[(${EMBEDDING_MODEL_FAILED}|${EMBEDDING_REQUIREMENTS_UNAVAILABLE}|${EMBEDDING_REQUIREMENTS_FAILED}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);
14591
14752
  method(object({
14592
14753
  crop: _instanceof(Uint8Array),
14593
14754
  width: number$1(),
14594
14755
  height: number$1()
14595
- }), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
14756
+ }), EmbeddingResultSchema, { auth: "admin" }), method(object({
14757
+ text: string(),
14758
+ modelId: string().min(1).optional()
14759
+ }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" }), method(object({ modelId: string().min(1).optional() }), object({
14760
+ cleared: array(string()),
14761
+ nodeId: string()
14762
+ }), {
14763
+ kind: "mutation",
14764
+ auth: "admin"
14765
+ });
14596
14766
  /**
14597
14767
  * `failure-contribution` — the capability an addon reports its OWN losses
14598
14768
  * through, per camera, with the denominator attached. It stores nothing.
@@ -18106,7 +18276,12 @@ var NcMediaPolicySchema = object({
18106
18276
  * the degrade engine, which drops the video and keeps the still.
18107
18277
  */
18108
18278
  clip: boolean().optional(),
18109
- /** Seconds of footage BEFORE / AFTER the event instant. Defaults 3 / 7. */
18279
+ /**
18280
+ * Seconds of footage BEFORE / AFTER the event instant. Absent =
18281
+ * {@link NC_CLIP_PRE_ROLL_DEFAULT_SEC} / {@link NC_CLIP_POST_ROLL_DEFAULT_SEC}
18282
+ * (4 / 6), resolved by the Notification Center at dispatch — deliberately not
18283
+ * a Zod default, so a rule that never chose keeps following the hub's.
18284
+ */
18110
18285
  clipPreRollSec: number$1().int().min(0).max(30).optional(),
18111
18286
  clipPostRollSec: number$1().int().min(0).max(30).optional(),
18112
18287
  /**
@@ -19484,6 +19659,130 @@ var OauthIntegrationDescriptorSchema = object({
19484
19659
  });
19485
19660
  method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
19486
19661
  /**
19662
+ * A model choice has a SCOPE, and a scope change has a workflow.
19663
+ *
19664
+ * ## The two scopes
19665
+ *
19666
+ * Almost every pipeline step's model is a **node** question: which build runs
19667
+ * fastest on THIS accelerator. Two nodes may legitimately answer differently —
19668
+ * a Coral runs the tflite SSD, a Mac runs the coreml YOLO — because the answers
19669
+ * are compared against nothing. They produce boxes, and a box is a box.
19670
+ *
19671
+ * Two steps are not like that. `face-embedding` and `clip-embedding` produce
19672
+ * **vectors that land in ONE shared index** (`identity_samples`,
19673
+ * `vec_object_clip`) and are ranked against each other by cosine similarity.
19674
+ * Cosine similarity between two encoders is not a weak signal, it is a
19675
+ * meaningless number — and nothing inside a vector can tell you it happened.
19676
+ * So for those two steps the model is a **cluster** question with exactly one
19677
+ * answer, stored in exactly one row.
19678
+ *
19679
+ * That is the same argument [D52](../../../../docs/decisions/adr-0052.md) makes
19680
+ * for the crop convention (`detail-crop.ts`), one level up: the crop decides
19681
+ * WHAT pixels the encoder sees, this decides WHICH encoder sees them. Both are
19682
+ * cluster-wide for the same reason and neither may become per-node.
19683
+ *
19684
+ * ## Why the registry lives here and not in the step catalog
19685
+ *
19686
+ * The scope itself is declared on the step, in
19687
+ * `detection-pipeline/registry/step-definitions.ts` (`StepDefinition.modelScope`)
19688
+ * — that is where a new step declares what kind of choice its model is. But the
19689
+ * catalog lives inside `addon-pipeline`, and three packages that must NOT
19690
+ * import an addon need to know the set: the orchestrator (which renders and
19691
+ * stores the row), post-analysis (which pins the row for a re-embed pass) and
19692
+ * admin-ui (which mirrors it). So the set is mirrored here, and
19693
+ * `scripts/check-cluster-model-scope.ts` fails the build when the two disagree.
19694
+ * A hand-copied key that stops matching is exactly how a setting silently stops
19695
+ * arriving while both sides still look correct.
19696
+ *
19697
+ * ## The defaults ARE today's behaviour
19698
+ *
19699
+ * {@link DEFAULT_CLUSTER_STEP_MODELS} reproduces the catalog `defaultModelId`
19700
+ * of both steps. Declaring the scope therefore changes nothing on the day it
19701
+ * ships: the cluster row starts out saying what every node was already doing.
19702
+ * Changing it is legitimate — that is what the knob is for — but it invalidates
19703
+ * the stored vectors of that surface, and must be followed by a re-embed pass
19704
+ * (`face-reembed-pass.ts`, `embedding-rebuild.ts`).
19705
+ */
19706
+ /**
19707
+ * Why the orchestrator cannot say which model the operator chose for a
19708
+ * cluster-scoped step (D651).
19709
+ */
19710
+ var CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS = [
19711
+ "owner-not-ready",
19712
+ "store-read-failed",
19713
+ "three-way-read-unavailable",
19714
+ "invalid-stored",
19715
+ "not-cluster-scoped"
19716
+ ];
19717
+ Object.freeze(Object.fromEntries([{
19718
+ stepId: "face-embedding",
19719
+ label: "Face recognition model",
19720
+ defaultModelId: "auraface-r100",
19721
+ indexName: "the enrolled face gallery",
19722
+ options: [
19723
+ {
19724
+ id: "auraface-r100",
19725
+ label: "AuraFace R100"
19726
+ },
19727
+ {
19728
+ id: "arcface-r100",
19729
+ label: "ArcFace (ResNet34)"
19730
+ },
19731
+ {
19732
+ id: "inception-resnet-v1",
19733
+ label: "Inception ResNet V1"
19734
+ }
19735
+ ]
19736
+ }, {
19737
+ stepId: "clip-embedding",
19738
+ label: "Semantic search model",
19739
+ defaultModelId: "mobileclip-s1",
19740
+ indexName: "the object semantic-search index",
19741
+ options: [
19742
+ {
19743
+ id: "mobileclip-s1",
19744
+ label: "MobileCLIP S1"
19745
+ },
19746
+ {
19747
+ id: "mobileclip-s2",
19748
+ label: "MobileCLIP S2"
19749
+ },
19750
+ {
19751
+ id: "siglip2-b16-224",
19752
+ label: "SigLIP2 B/16 (Apache-2.0)"
19753
+ }
19754
+ ]
19755
+ }].map((s) => [s.stepId, s.defaultModelId])));
19756
+ var CLUSTER_STEP_SETTING_FIELDS = [{
19757
+ stepId: "face-embedding",
19758
+ key: "minLandmarkFaceSize",
19759
+ label: "Min face size for recognition (detection px)",
19760
+ 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.",
19761
+ type: "slider",
19762
+ min: 0,
19763
+ max: 64,
19764
+ step: 2,
19765
+ default: 24
19766
+ }];
19767
+ function clusterStepSettingKey(stepId, fieldKey) {
19768
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
19769
+ }
19770
+ var ClusterSettingNumberSchema = number$1().finite();
19771
+ function readClusterStepSettings(config) {
19772
+ const out = {};
19773
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
19774
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
19775
+ const value = parsed.success ? parsed.data : field.default;
19776
+ const existing = out[field.stepId] ?? {};
19777
+ out[field.stepId] = {
19778
+ ...existing,
19779
+ [field.key]: value
19780
+ };
19781
+ }
19782
+ return out;
19783
+ }
19784
+ readClusterStepSettings({});
19785
+ /**
19487
19786
  * pipeline-analytics — device-scoped wrapper cap. Refines raw
19488
19787
  * per-frame detections emitted by the pipeline runner into tracked
19489
19788
  * objects, per-kind event collections (motion / object / audio), and
@@ -20299,7 +20598,8 @@ var MediaFileKindEnum = _enum([
20299
20598
  "thumbnailSmall",
20300
20599
  "confirmationCrop",
20301
20600
  "debugCrop",
20302
- "sceneFrame"
20601
+ "sceneFrame",
20602
+ "lastSceneFrame"
20303
20603
  ]);
20304
20604
  /**
20305
20605
  * One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
@@ -20851,7 +21151,23 @@ var SearchObjectEventsInput = object({
20851
21151
  until: number$1().optional(),
20852
21152
  classFilter: string().optional(),
20853
21153
  limit: number$1().default(50),
20854
- minScore: number$1().min(0).max(1).default(.2)
21154
+ /**
21155
+ * An ABSOLUTE cosine floor. Optional since D649: a floor is a property of the
21156
+ * model (0.2 kept 96% of matched pairs on MobileCLIP S1 and 2.7% on SigLIP2),
21157
+ * so an absent one resolves to the searched model's own `searchMinScore`
21158
+ * scaled by `strictness`. A number sent here is honoured verbatim.
21159
+ */
21160
+ minScore: number$1().min(0).max(1).optional(),
21161
+ /** Model-relative floor — see `resolveClipSearchMinScore`. Default `loose`. */
21162
+ strictness: ClipSearchStrictnessSchema.optional(),
21163
+ /**
21164
+ * Search THIS CLIP model's index instead of the cluster row's. Every index a
21165
+ * model ever wrote stays searchable until it is wiped (the MobileCLIP index
21166
+ * through a SigLIP2 cutover and its rollback window). An id with no CLIP
21167
+ * metadata is refused; an id other than the cluster row's is ADMIN-only
21168
+ * (`model-override-requires-admin`).
21169
+ */
21170
+ modelId: string().min(1).optional()
20855
21171
  });
20856
21172
  var TrackCascadeCountsSchema = object({
20857
21173
  /** Persisted track roots deleted (authoritative). */
@@ -20986,7 +21302,41 @@ var RebuildObjectEmbeddingsInput = object({
20986
21302
  * comparable, so wiping and rebuilding is the only way to be sure every vector
20987
21303
  * means the same thing.
20988
21304
  */
20989
- var WipeObjectEmbeddingsResultSchema = object({ deleted: number$1() });
21305
+ var WipeObjectEmbeddingsResultSchema = object({
21306
+ deleted: number$1(),
21307
+ /**
21308
+ * CLIP indexes that could NOT be emptied (unreachable, or refused at their
21309
+ * dimension) — not a clean slate. Additive and optional (D649).
21310
+ */
21311
+ failedIndexes: array(string()).optional()
21312
+ });
21313
+ /**
21314
+ * Why a rebuild did not start, BY NAME — ONE vocabulary for both gates in front
21315
+ * of a pass (D649 over D651). A bare `started: false` read the same for "the
21316
+ * stores are booting" and "the cluster row names a model with no CLIP
21317
+ * metadata", which need different fixes.
21318
+ * - `stores-unavailable` — the analytics stores or the API are not up yet.
21319
+ * - the owner's confirmation of the cluster model (D651, `ClusterPinConfirmer`):
21320
+ * a pass that rewrites an index needs two agreeing reads of the OWNER's
21321
+ * answer (`pipelineOrchestrator.getClusterModelChoice`) — a pass that cannot
21322
+ * name its model does not run (D54):
21323
+ * - the owner's own `unreadable` reasons (`owner-not-ready`,
21324
+ * `store-read-failed`, `three-way-read-unavailable`, `invalid-stored`,
21325
+ * `not-cluster-scoped`);
21326
+ * - `method-unavailable` — the orchestrator predates the method;
21327
+ * - `read-failed` — the call failed or answered something unparseable;
21328
+ * - `reads-disagree` — the two reads named different choices.
21329
+ * - `not-a-clip-model` — the CONFIRMED id has no CLIP metadata, so there is no
21330
+ * index to fill and no dimension to check against (D649).
21331
+ */
21332
+ var RebuildObjectEmbeddingsRefusalSchema = _enum([
21333
+ "stores-unavailable",
21334
+ ...CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS,
21335
+ "method-unavailable",
21336
+ "read-failed",
21337
+ "reads-disagree",
21338
+ "not-a-clip-model"
21339
+ ]);
20990
21340
  /**
20991
21341
  * Acknowledgement that a rebuild STARTED.
20992
21342
  *
@@ -20999,7 +21349,12 @@ var WipeObjectEmbeddingsResultSchema = object({ deleted: number$1() });
20999
21349
  var RebuildObjectEmbeddingsResultSchema = object({
21000
21350
  started: boolean(),
21001
21351
  /** True when a pass was already running; the new request is ignored. */
21002
- alreadyRunning: boolean()
21352
+ alreadyRunning: boolean(),
21353
+ /** Present when the pass refused to start — see `RebuildObjectEmbeddingsRefusalSchema`. */
21354
+ refusal: RebuildObjectEmbeddingsRefusalSchema.optional(),
21355
+ /** The CLIP model the pass pinned, and the index it fills (when it started). */
21356
+ modelId: string().optional(),
21357
+ index: string().optional()
21003
21358
  });
21004
21359
  var RebuildStatusSchema = object({
21005
21360
  running: boolean(),
@@ -21033,7 +21388,11 @@ var RebuildStatusSchema = object({
21033
21388
  startedAtMs: number$1().nullable(),
21034
21389
  finishedAtMs: number$1().nullable(),
21035
21390
  /** Present when the pass ended by throwing. */
21036
- error: string().nullable()
21391
+ error: string().nullable(),
21392
+ /** The CLIP model the current / last pass pinned (D54), `null` before any. */
21393
+ modelId: string().nullable(),
21394
+ /** The index that pass fills — `ClipModelMeta.vectorIndex` of `modelId` (D649). */
21395
+ index: string().nullable()
21037
21396
  });
21038
21397
  /**
21039
21398
  * Acknowledgement that a debug-media reclaim STARTED.
@@ -21354,7 +21713,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
21354
21713
  deviceId: number$1(),
21355
21714
  ownerKind: MediaPresenceOwnerKindSchema,
21356
21715
  ownerIds: array(string()).max(5e3)
21357
- }), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
21716
+ }), array(string()).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly(), { caller: "required" }), method(object({}), WipeObjectEmbeddingsResultSchema, {
21358
21717
  kind: "mutation",
21359
21718
  auth: "admin"
21360
21719
  }), method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
@@ -22389,6 +22748,17 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
22389
22748
  hubHostnameOverride: string().optional()
22390
22749
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
22391
22750
  /**
22751
+ * What ONE step runs with on ONE roster device for THIS camera (D650): the
22752
+ * device's per-(node,device) base with the camera's override for that device
22753
+ * on top — the same `override ?? base` merge the orchestrator applies to the
22754
+ * elected device (`applyDeviceProvisioning`). Absent `modelId` ⇒ the executor
22755
+ * resolves the device format's default, exactly as on the elected device.
22756
+ */
22757
+ var RunnerJumpStepProvisioningSchema = object({
22758
+ modelId: string().optional(),
22759
+ settings: record(string(), unknown()).optional()
22760
+ });
22761
+ /**
22392
22762
  * One ENABLED inference device on the runner's node, as the step-tree
22393
22763
  * device-jump resolver sees it (phase 1). The orchestrator populates this
22394
22764
  * roster on the attach payload whenever the camera is elected onto a specific
@@ -22400,7 +22770,16 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
22400
22770
  var RunnerInferenceDeviceSchema = object({
22401
22771
  deviceKey: string(),
22402
22772
  weight: number$1().positive().default(1),
22403
- maxSessions: number$1().int().positive().nullable().default(null)
22773
+ maxSessions: number$1().int().positive().nullable().default(null),
22774
+ /**
22775
+ * Per-step provisioning for this camera on THIS device (D650), keyed by step
22776
+ * id. A step the runner jumps here runs with these fields, never with the
22777
+ * elected device's: `modelId` / `settings` are REPLACED on the jumped subtree
22778
+ * (a step absent from the map runs with neither — the target format default).
22779
+ * Absent field ⇒ an orchestrator that predates D650: the jumped step keeps
22780
+ * the elected device's provisioning, as before.
22781
+ */
22782
+ steps: record(string(), RunnerJumpStepProvisioningSchema).optional()
22404
22783
  });
22405
22784
  /**
22406
22785
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
@@ -23275,6 +23654,28 @@ var NodeInferenceDeviceSchema = object({
23275
23654
  */
23276
23655
  exclusion: InferenceDeviceExclusionReasonSchema.nullable()
23277
23656
  });
23657
+ /**
23658
+ * The operator's model choice for one cluster-scoped step, answered by the
23659
+ * addon that OWNS the `clusterModel:*` settings (D651). Three answers, never
23660
+ * folded: a written choice, a key nobody wrote (the cluster runs the default
23661
+ * BY ABSENCE), or no answer. A caller that rewrites an index acts only on the
23662
+ * first two, read twice and agreeing.
23663
+ */
23664
+ var ClusterModelChoiceSchema = discriminatedUnion("kind", [
23665
+ object({
23666
+ kind: literal("stored"),
23667
+ modelId: string()
23668
+ }),
23669
+ object({
23670
+ kind: literal("absent"),
23671
+ defaultModelId: string()
23672
+ }),
23673
+ object({
23674
+ kind: literal("unreadable"),
23675
+ reason: _enum(CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS),
23676
+ error: string().optional()
23677
+ })
23678
+ ]);
23278
23679
  var NodeInferenceDevicesSchema = object({
23279
23680
  nodeId: string(),
23280
23681
  /** False when the node's platform-probe was unreachable (no live device set). */
@@ -23302,10 +23703,17 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23302
23703
  }), object({ success: literal(true) }), {
23303
23704
  kind: "mutation",
23304
23705
  auth: "admin"
23305
- }), method(object({ deviceId: number$1() }), object({ deviceKey: string().nullable() })), method(_void(), object({ migrated: number$1() }), {
23706
+ }), method(object({ deviceId: number$1() }), object({ deviceKey: string().nullable() })), method(_void(), object({
23707
+ migrated: number$1(),
23708
+ skipped: array(object({
23709
+ deviceId: number$1(),
23710
+ targetNodeId: string(),
23711
+ reason: string()
23712
+ })).default([])
23713
+ }), {
23306
23714
  kind: "mutation",
23307
23715
  auth: "admin"
23308
- }), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number$1() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number$1() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
23716
+ }), method(_void(), array(PipelineAssignmentSchema).readonly()), method(object({ deviceId: number$1() }), PipelineAssignmentSchema.nullable()), method(_void(), array(AgentLoadSummarySchema).readonly()), method(object({ stepId: string() }), ClusterModelChoiceSchema), method(_void(), GlobalMetricsSchema), method(object({ deviceId: number$1() }), CameraMetricsSchema.nullable()), method(object({ nodeId: string() }), CapabilityBindingsSchema), method(object({
23309
23717
  nodeId: string(),
23310
23718
  capName: string(),
23311
23719
  addonId: string()
@@ -25605,6 +26013,167 @@ DeviceType.Camera, method(object({
25605
26013
  auth: "protected"
25606
26014
  });
25607
26015
  /**
26016
+ * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
26017
+ * valutatore puro del suo FRONTE.
26018
+ *
26019
+ * Viveva dentro il builtin virtual-doorbell
26020
+ * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
26021
+ * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
26022
+ * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
26023
+ * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
26024
+ * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
26025
+ * SPOSTA qui e il doorbell la ri-esporta.
26026
+ *
26027
+ * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
26028
+ * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
26029
+ * regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
26030
+ * booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
26031
+ */
26032
+ /**
26033
+ * Known binary / switch source caps → the boolean slice field whose
26034
+ * false→true rise counts as ACTIVE. Every entry is "fire on active".
26035
+ * Sensors whose "active" reading is not a plain boolean (presence's string
26036
+ * state, connectivity's connected flag) are deliberately excluded — a
26037
+ * reconnect is not a doorbell press, and it is not a recording either.
26038
+ */
26039
+ var SOURCE_CAP_ACTIVE_FIELD = {
26040
+ contact: "entryOpen",
26041
+ binary: "on",
26042
+ switch: "on",
26043
+ motion: "detected",
26044
+ flood: "flooded",
26045
+ gas: "detected",
26046
+ smoke: "detected",
26047
+ "carbon-monoxide": "detected",
26048
+ vibration: "detected",
26049
+ tamper: "tampered"
26050
+ };
26051
+ object({
26052
+ /** Ms epoch of the last press. null = never observed since this provider started. */
26053
+ lastPressedAt: number$1().nullable(),
26054
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
26055
+ pressCountSinceStart: number$1()
26056
+ });
26057
+ object({
26058
+ deviceId: number$1(),
26059
+ timestamp: number$1()
26060
+ });
26061
+ /**
26062
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
26063
+ * virtual-doorbell trigger devices, exactly what the wrapper's
26064
+ * `doorbellSources` persists (as `{ deviceId }` records).
26065
+ */
26066
+ var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number$1().int().positive()) });
26067
+ DeviceType.Camera;
26068
+ DeviceType.Button, DeviceType.Camera;
26069
+ var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
26070
+ DeviceType.Camera, DeviceType.Camera;
26071
+ /** A slot's editable value, discriminated on `slot`. */
26072
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
26073
+ DeviceType.Camera;
26074
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
26075
+ state: literal("unreachable"),
26076
+ reason: string()
26077
+ })]);
26078
+ /** One provider of slots — the D554 source-listing row. */
26079
+ var ExtensionSourceSchema = object({
26080
+ /** The routing prefix of every `slotRef` this provider serves. */
26081
+ source: string(),
26082
+ label: string(),
26083
+ /** Stamped by the dispatcher from the registry (D557). */
26084
+ addonId: string().optional(),
26085
+ availability: ExtensionSourceAvailabilitySchema
26086
+ });
26087
+ /**
26088
+ * How one picked source stands. `missing` — no such device (deleted, or an id
26089
+ * that never existed); `foreign` — a device the slot's owner cannot read from
26090
+ * (slice 2's cross-owner graft source); `unavailable` — it exists but is not a
26091
+ * valid source now (a container, which is never a pick). A source in any of
26092
+ * these states is SHOWN, never silently dropped or re-pointed.
26093
+ */
26094
+ var ExtensionSourceHealthSchema = _enum([
26095
+ "ok",
26096
+ "missing",
26097
+ "foreign",
26098
+ "unavailable"
26099
+ ]);
26100
+ var ExtensionSlotSourceSchema = object({
26101
+ deviceId: number$1().int(),
26102
+ /** The device's name, or null when it could not be resolved (`missing`). */
26103
+ name: string().nullable(),
26104
+ health: ExtensionSourceHealthSchema,
26105
+ detail: string().optional()
26106
+ });
26107
+ /**
26108
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
26109
+ * reported read-only, named, never written through this contract (D62). The
26110
+ * virtual doorbell's sources ring only while the wrapper is bound to the
26111
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
26112
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
26113
+ */
26114
+ var ExtensionSlotActivationSchema = object({
26115
+ state: _enum([
26116
+ "active",
26117
+ "inactive",
26118
+ "unknown"
26119
+ ]),
26120
+ authority: string(),
26121
+ detail: string().optional()
26122
+ });
26123
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
26124
+ state: literal("ok"),
26125
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
26126
+ slotRef: string(),
26127
+ slot: ExtensionSlotIdSchema,
26128
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
26129
+ authority: string(),
26130
+ /** graft: its switch. association: null — removing every source is "off". */
26131
+ enabled: boolean().nullable(),
26132
+ /** graft: the cap registered on the host. association: null. */
26133
+ projects: string().nullable(),
26134
+ activation: ExtensionSlotActivationSchema.nullable(),
26135
+ value: ExtensionSlotValueSchema,
26136
+ sources: array(ExtensionSlotSourceSchema)
26137
+ }), object({
26138
+ state: literal("unreachable"),
26139
+ addonId: string(),
26140
+ reason: string()
26141
+ })]);
26142
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
26143
+ deviceId: number$1().int(),
26144
+ name: string(),
26145
+ type: string(),
26146
+ location: string().nullable(),
26147
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
26148
+ parentName: string().nullable(),
26149
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
26150
+ suggested: boolean(),
26151
+ /** Why it is suggested ("same location"), null when it is not. */
26152
+ reason: string().nullable()
26153
+ })) });
26154
+ /**
26155
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
26156
+ * reloaded the host (or, for an accessory child, its parent) because the
26157
+ * write changed what the host REGISTERS (a graft switched on or off, slice 2).
26158
+ */
26159
+ var ExtensionSetResultSchema = object({
26160
+ applied: literal(true),
26161
+ reload: _enum([
26162
+ "none",
26163
+ "host",
26164
+ "parent"
26165
+ ])
26166
+ });
26167
+ var ExtensionSlotRefInputSchema = object({
26168
+ deviceId: number$1().int(),
26169
+ slotRef: string().min(1)
26170
+ });
26171
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
26172
+ method(object({ deviceId: number$1().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number$1().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
26173
+ kind: "mutation",
26174
+ auth: "admin"
26175
+ });
26176
+ /**
25608
26177
  * Optional client-side hints sent at session creation to help the provider
25609
26178
  * pick the best native source. All fields optional — a viewer that knows
25610
26179
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -27393,17 +27962,6 @@ object({
27393
27962
  deviceId: number$1(),
27394
27963
  status: DeviceStatusSchema
27395
27964
  });
27396
- object({
27397
- /** Ms epoch of the last press. null = never observed since this provider started. */
27398
- lastPressedAt: number$1().nullable(),
27399
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
27400
- pressCountSinceStart: number$1()
27401
- });
27402
- object({
27403
- deviceId: number$1(),
27404
- timestamp: number$1()
27405
- });
27406
- DeviceType.Button, DeviceType.Camera;
27407
27965
  /**
27408
27966
  * Enum-state sensor — a string value picked from a finite option set.
27409
27967
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -34170,42 +34728,6 @@ DeviceType.Camera, method(object({
34170
34728
  package: array(ZoneRuleSchema).readonly()
34171
34729
  });
34172
34730
  /**
34173
- * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
34174
- * valutatore puro del suo FRONTE.
34175
- *
34176
- * Viveva dentro il builtin virtual-doorbell
34177
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
34178
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
34179
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
34180
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
34181
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
34182
- * SPOSTA qui e il doorbell la ri-esporta.
34183
- *
34184
- * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
34185
- * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
34186
- * regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
34187
- * booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
34188
- */
34189
- /**
34190
- * Known binary / switch source caps → the boolean slice field whose
34191
- * false→true rise counts as ACTIVE. Every entry is "fire on active".
34192
- * Sensors whose "active" reading is not a plain boolean (presence's string
34193
- * state, connectivity's connected flag) are deliberately excluded — a
34194
- * reconnect is not a doorbell press, and it is not a recording either.
34195
- */
34196
- var SOURCE_CAP_ACTIVE_FIELD = {
34197
- contact: "entryOpen",
34198
- binary: "on",
34199
- switch: "on",
34200
- motion: "detected",
34201
- flood: "flooded",
34202
- gas: "detected",
34203
- smoke: "detected",
34204
- "carbon-monoxide": "detected",
34205
- vibration: "detected",
34206
- tamper: "tampered"
34207
- };
34208
- /**
34209
34731
  * Accessory device helpers — shared across drivers.
34210
34732
  *
34211
34733
  * Many vendor-specific drivers register accessory child devices on
@@ -37005,6 +37527,30 @@ Object.freeze({
37005
37527
  addonId: null,
37006
37528
  access: "create"
37007
37529
  },
37530
+ "deviceExtension.listCandidates": {
37531
+ capName: "device-extension",
37532
+ capScope: "device",
37533
+ addonId: null,
37534
+ access: "view"
37535
+ },
37536
+ "deviceExtension.listSlots": {
37537
+ capName: "device-extension",
37538
+ capScope: "device",
37539
+ addonId: null,
37540
+ access: "view"
37541
+ },
37542
+ "deviceExtension.listSources": {
37543
+ capName: "device-extension",
37544
+ capScope: "device",
37545
+ addonId: null,
37546
+ access: "view"
37547
+ },
37548
+ "deviceExtension.setSlot": {
37549
+ capName: "device-extension",
37550
+ capScope: "device",
37551
+ addonId: null,
37552
+ access: "create"
37553
+ },
37008
37554
  "deviceManager.addLocation": {
37009
37555
  capName: "device-manager",
37010
37556
  capScope: "system",
@@ -37755,6 +38301,12 @@ Object.freeze({
37755
38301
  addonId: null,
37756
38302
  access: "view"
37757
38303
  },
38304
+ "embeddingEncoder.resetFailedModels": {
38305
+ capName: "embedding-encoder",
38306
+ capScope: "system",
38307
+ addonId: null,
38308
+ access: "delete"
38309
+ },
37758
38310
  "enumSensor.getStatus": {
37759
38311
  capName: "enum-sensor",
37760
38312
  capScope: "device",
@@ -40089,6 +40641,12 @@ Object.freeze({
40089
40641
  addonId: null,
40090
40642
  access: "view"
40091
40643
  },
40644
+ "pipelineOrchestrator.getClusterModelChoice": {
40645
+ capName: "pipeline-orchestrator",
40646
+ capScope: "system",
40647
+ addonId: null,
40648
+ access: "view"
40649
+ },
40092
40650
  "pipelineOrchestrator.getDeviceLiveContribution": {
40093
40651
  capName: "pipeline-orchestrator",
40094
40652
  capScope: "system",
@@ -42914,6 +43472,26 @@ Object.freeze({
42914
43472
  form: "single",
42915
43473
  optional: false
42916
43474
  }],
43475
+ "deviceExtension.listCandidates": [{
43476
+ name: "deviceId",
43477
+ form: "single",
43478
+ optional: false
43479
+ }],
43480
+ "deviceExtension.listSlots": [{
43481
+ name: "deviceId",
43482
+ form: "single",
43483
+ optional: false
43484
+ }],
43485
+ "deviceExtension.listSources": [{
43486
+ name: "deviceId",
43487
+ form: "single",
43488
+ optional: false
43489
+ }],
43490
+ "deviceExtension.setSlot": [{
43491
+ name: "deviceId",
43492
+ form: "single",
43493
+ optional: false
43494
+ }],
42917
43495
  "deviceManager.adoptionRelease": [{
42918
43496
  name: "camDeviceId",
42919
43497
  form: "single",
@@ -45373,68 +45951,6 @@ TimelapseRuleInputSchema.extend({
45373
45951
  createdAt: number$1(),
45374
45952
  updatedAt: number$1()
45375
45953
  });
45376
- Object.freeze(Object.fromEntries([{
45377
- stepId: "face-embedding",
45378
- label: "Face recognition model",
45379
- defaultModelId: "arcface-r100",
45380
- indexName: "the enrolled face gallery",
45381
- options: [
45382
- {
45383
- id: "arcface-r100",
45384
- label: "ArcFace (ResNet34)"
45385
- },
45386
- {
45387
- id: "auraface-r100",
45388
- label: "AuraFace R100"
45389
- },
45390
- {
45391
- id: "inception-resnet-v1",
45392
- label: "Inception ResNet V1"
45393
- }
45394
- ]
45395
- }, {
45396
- stepId: "clip-embedding",
45397
- label: "Semantic search model",
45398
- defaultModelId: "mobileclip-s1",
45399
- indexName: "the object semantic-search index",
45400
- options: [{
45401
- id: "mobileclip-s1",
45402
- label: "MobileCLIP S1"
45403
- }, {
45404
- id: "mobileclip-s2",
45405
- label: "MobileCLIP S2"
45406
- }]
45407
- }].map((s) => [s.stepId, s.defaultModelId])));
45408
- string().min(1);
45409
- var CLUSTER_STEP_SETTING_FIELDS = [{
45410
- stepId: "face-embedding",
45411
- key: "minLandmarkFaceSize",
45412
- label: "Min face size for recognition (detection px)",
45413
- 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.",
45414
- type: "slider",
45415
- min: 0,
45416
- max: 64,
45417
- step: 2,
45418
- default: 24
45419
- }];
45420
- function clusterStepSettingKey(stepId, fieldKey) {
45421
- return `clusterStepSetting:${stepId}:${fieldKey}`;
45422
- }
45423
- var ClusterSettingNumberSchema = number$1().finite();
45424
- function readClusterStepSettings(config) {
45425
- const out = {};
45426
- for (const field of CLUSTER_STEP_SETTING_FIELDS) {
45427
- const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
45428
- const value = parsed.success ? parsed.data : field.default;
45429
- const existing = out[field.stepId] ?? {};
45430
- out[field.stepId] = {
45431
- ...existing,
45432
- [field.key]: value
45433
- };
45434
- }
45435
- return out;
45436
- }
45437
- readClusterStepSettings({});
45438
45954
  object({
45439
45955
  /**
45440
45956
  * Fraction of the box's own size added on EACH side before cutting.