@camstack/types 1.2.316 → 1.2.318

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/index.js CHANGED
@@ -5731,6 +5731,40 @@ var ModelFormatEntrySchema = zod.z.object({
5731
5731
  revision: zod.z.string().min(1).optional()
5732
5732
  });
5733
5733
  /**
5734
+ * What a node holds for one (model, format) (D746). `current` is a complete
5735
+ * copy at its catalog revision — exactly what `downloaded: true` means.
5736
+ * `stale` is bytes on disk that are not (yet) proven current under D743/D744:
5737
+ * no or a different revision record, or a missing sibling. `missing` is no
5738
+ * copy. `downloaded` alone folds `stale` into "not downloaded", which hid
5739
+ * reclaimable bytes and a copy about to be replaced.
5740
+ */
5741
+ var ModelOnDiskStateSchema = zod.z.enum([
5742
+ "current",
5743
+ "stale",
5744
+ "missing"
5745
+ ]);
5746
+ /**
5747
+ * The numeric precision of one format's BUILD (D746) — reported only when the
5748
+ * build states it (file-name token, an INT8 variant, an EdgeTPU compile, a
5749
+ * CamStack Core ML export). Absent means "not stated", never "fp32".
5750
+ */
5751
+ var ModelFormatPrecisionSchema = zod.z.enum([
5752
+ "fp32",
5753
+ "fp16",
5754
+ "int8"
5755
+ ]);
5756
+ /**
5757
+ * One format of one model as a node's `pipelineExecutor.getSchema` reports it.
5758
+ * `onDisk` / `precision` are optional for version skew: a runner that predates
5759
+ * them omits them, and a reader falls back to `downloaded`.
5760
+ */
5761
+ var PipelineModelFormatStatusSchema = zod.z.object({
5762
+ downloaded: zod.z.boolean(),
5763
+ sizeMB: zod.z.number(),
5764
+ onDisk: ModelOnDiskStateSchema.optional(),
5765
+ precision: ModelFormatPrecisionSchema.optional()
5766
+ });
5767
+ /**
5734
5768
  * Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
5735
5769
  * The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
5736
5770
  */
@@ -26545,7 +26579,7 @@ var FrameRefSchema = zod.z.object({
26545
26579
  timestamp: zod.z.number(),
26546
26580
  capturedAt: zod.z.number().optional()
26547
26581
  });
26548
- var ModelFormatSchema$1 = zod.z.enum([
26582
+ var ModelFormatSchema$2 = zod.z.enum([
26549
26583
  "onnx",
26550
26584
  "coreml",
26551
26585
  "openvino",
@@ -26563,7 +26597,7 @@ var PipelineSlotSchema = zod.z.enum([
26563
26597
  var PipelineEngineChoiceSchema = zod.z.object({
26564
26598
  runtime: zod.z.literal("python"),
26565
26599
  backend: zod.z.string(),
26566
- format: ModelFormatSchema$1,
26600
+ format: ModelFormatSchema$2,
26567
26601
  device: zod.z.string().optional()
26568
26602
  });
26569
26603
  /**
@@ -26621,10 +26655,7 @@ var PipelineTemplateSchema$1 = zod.z.object({
26621
26655
  var PipelineModelOptionSchema = zod.z.object({
26622
26656
  id: zod.z.string(),
26623
26657
  name: zod.z.string(),
26624
- formats: zod.z.record(zod.z.string(), zod.z.object({
26625
- downloaded: zod.z.boolean(),
26626
- sizeMB: zod.z.number()
26627
- })),
26658
+ formats: zod.z.record(zod.z.string(), PipelineModelFormatStatusSchema),
26628
26659
  group: ModelVariantGroupSchema.optional(),
26629
26660
  legacy: zod.z.boolean().optional(),
26630
26661
  provider: ModelProviderIdSchema.optional(),
@@ -26839,6 +26870,32 @@ var pipelineExecutorCapability = {
26839
26870
  auth: "admin"
26840
26871
  }),
26841
26872
  /**
26873
+ * Best settings (D745): the MODEL-BOUND thresholds (`bindsToModel` keys of
26874
+ * the object-detection root, and their binding keys) stored in THIS node's
26875
+ * per-camera detector settings — and, unless `dryRun`, remove them so the
26876
+ * running model's own defaults apply. Every other key of a camera's store
26877
+ * is kept. `nodeId` is the ROUTING key. `deviceIds` absent ⇒ every camera
26878
+ * with a store. A camera whose store could not be read is `refused`, never
26879
+ * reported as clean.
26880
+ */
26881
+ clearModelBoundDeviceOverrides: require_sleep.method(zod.z.object({
26882
+ nodeId: zod.z.string(),
26883
+ deviceIds: zod.z.array(zod.z.number()).readonly().optional(),
26884
+ dryRun: zod.z.boolean()
26885
+ }), zod.z.object({
26886
+ entries: zod.z.array(zod.z.object({
26887
+ deviceId: zod.z.number(),
26888
+ keys: zod.z.array(zod.z.string()).readonly()
26889
+ })).readonly(),
26890
+ refused: zod.z.array(zod.z.object({
26891
+ deviceId: zod.z.number(),
26892
+ reason: zod.z.string()
26893
+ })).readonly()
26894
+ }), {
26895
+ kind: "mutation",
26896
+ auth: "admin"
26897
+ }),
26898
+ /**
26842
26899
  * Which of THIS node's inference devices the executor currently refuses,
26843
26900
  * and why. `nodeId` is the ROUTING key (stripped by the generated router).
26844
26901
  *
@@ -26933,12 +26990,12 @@ var pipelineExecutorCapability = {
26933
26990
  downloadModel: require_sleep.method(zod.z.object({
26934
26991
  addonId: zod.z.string(),
26935
26992
  modelId: zod.z.string(),
26936
- format: ModelFormatSchema$1
26993
+ format: ModelFormatSchema$2
26937
26994
  }), DownloadModelResultSchema, { kind: "mutation" }),
26938
26995
  deleteModel: require_sleep.method(zod.z.object({
26939
26996
  addonId: zod.z.string(),
26940
26997
  modelId: zod.z.string(),
26941
- format: ModelFormatSchema$1
26998
+ format: ModelFormatSchema$2
26942
26999
  }), zod.z.object({ success: zod.z.literal(true) }), { kind: "mutation" }),
26943
27000
  /**
26944
27001
  * Stateless single-frame execution. Callers (runner, benchmark) pass
@@ -27185,6 +27242,319 @@ var pipelineExecutorCapability = {
27185
27242
  }
27186
27243
  };
27187
27244
  //#endregion
27245
+ //#region src/pipeline/load-balancing/schemas.ts
27246
+ /**
27247
+ * Wire shapes of the Load balancing surface (D748): the session placement
27248
+ * policy, the atomic share write, the observed placement statistics, the
27249
+ * hardware share suggestion and the stale device pins.
27250
+ */
27251
+ /**
27252
+ * How a new detection session picks its node and device.
27253
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
27254
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
27255
+ * weight only bites once a node already holds a session.
27256
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
27257
+ * full or drowning node yields to a free one (D748).
27258
+ */
27259
+ var SessionPlacementPolicySchema = zod.z.enum(["least-loaded", "share"]);
27260
+ var DEFAULT_SESSION_PLACEMENT_POLICY = "least-loaded";
27261
+ /** The global-settings key the policy is stored under (orchestrator `load` section). */
27262
+ var SESSION_PLACEMENT_SETTING_KEY = "sessionPlacement";
27263
+ /** Parse a stored value; anything unknown is the default (nothing changes on deploy). */
27264
+ function parseSessionPlacementPolicy(value) {
27265
+ const parsed = SessionPlacementPolicySchema.safeParse(value);
27266
+ return parsed.success ? parsed.data : DEFAULT_SESSION_PLACEMENT_POLICY;
27267
+ }
27268
+ var LoadBalancingSharesInputSchema = zod.z.object({
27269
+ /** nodeId → share (> 0). A node left out keeps its weight. */
27270
+ nodes: zod.z.record(zod.z.string(), zod.z.number().positive()).default({}),
27271
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
27272
+ devices: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number().positive())).default({})
27273
+ });
27274
+ var PlacementStatsInputSchema = zod.z.object({
27275
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
27276
+ windowMs: zod.z.number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
27277
+ var PlacementDeviceStatsSchema = zod.z.object({
27278
+ deviceKey: zod.z.string(),
27279
+ /** Sessions running on this device now. */
27280
+ sessionsNow: zod.z.number(),
27281
+ /** Sessions started on this device inside the window. */
27282
+ sessionsStarted: zod.z.number(),
27283
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
27284
+ observedShare: zod.z.number().nullable()
27285
+ });
27286
+ var PlacementNodeStatsSchema = zod.z.object({
27287
+ nodeId: zod.z.string(),
27288
+ sessionsNow: zod.z.number(),
27289
+ sessionsStarted: zod.z.number(),
27290
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
27291
+ observedShare: zod.z.number().nullable(),
27292
+ /** Most sessions this node ran at once inside the window. */
27293
+ peakSessions: zod.z.number(),
27294
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
27295
+ yieldsAway: zod.z.number(),
27296
+ devices: zod.z.array(PlacementDeviceStatsSchema).readonly()
27297
+ });
27298
+ /** A camera's device pin that the session path cannot honour. */
27299
+ var StaleDevicePinSchema = zod.z.object({
27300
+ deviceId: zod.z.number(),
27301
+ deviceKey: zod.z.string(),
27302
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
27303
+ reason: zod.z.enum(["disabled", "absent"])
27304
+ });
27305
+ var PlacementStatsSchema = zod.z.object({
27306
+ policy: SessionPlacementPolicySchema,
27307
+ windowMs: zod.z.number(),
27308
+ /** How much of the window was actually observed (the hub keeps it in memory). */
27309
+ observedForMs: zod.z.number(),
27310
+ sessionsNow: zod.z.number(),
27311
+ /** Most parallel sessions across the cluster inside the window. */
27312
+ clusterPeakSessions: zod.z.number(),
27313
+ nodes: zod.z.array(PlacementNodeStatsSchema).readonly(),
27314
+ stalePins: zod.z.array(StaleDevicePinSchema).readonly()
27315
+ });
27316
+ var SuggestSharesInputSchema = zod.z.object({ headroom: zod.z.number().min(.3).max(.5).default(.4) });
27317
+ var SuggestedDeviceShareSchema = zod.z.object({
27318
+ deviceKey: zod.z.string(),
27319
+ /** Share of the node (0–100, rounded). */
27320
+ share: zod.z.number(),
27321
+ modelId: zod.z.string().nullable(),
27322
+ /** Inferences per second at that model, from the measured table. */
27323
+ fps: zod.z.number().nullable(),
27324
+ measured: zod.z.boolean(),
27325
+ /** Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋. Never enforced. */
27326
+ suggestedMaxSessions: zod.z.number().nullable()
27327
+ });
27328
+ var SuggestedNodeShareSchema = zod.z.object({
27329
+ nodeId: zod.z.string(),
27330
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
27331
+ share: zod.z.number().nullable(),
27332
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
27333
+ capacitySessions: zod.z.number(),
27334
+ devices: zod.z.array(SuggestedDeviceShareSchema).readonly(),
27335
+ skippedReason: zod.z.string().nullable()
27336
+ });
27337
+ var SuggestSharesResultSchema = zod.z.object({
27338
+ headroom: zod.z.number(),
27339
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
27340
+ cameraFps: zod.z.number(),
27341
+ /** How many share → model → capacity rounds ran before the shares stopped moving (≤ 3). */
27342
+ iterations: zod.z.number(),
27343
+ nodes: zod.z.array(SuggestedNodeShareSchema).readonly()
27344
+ });
27345
+ //#endregion
27346
+ //#region src/pipeline/best-settings/plan-schemas.ts
27347
+ /**
27348
+ * The wire shapes of the Best settings plan and apply (D745), used by the
27349
+ * `pipeline-orchestrator` cap. The recommender's own types
27350
+ * (`recommend.ts`, `demand.ts`) are the TS face of the same data; these
27351
+ * schemas are what crosses the cap boundary.
27352
+ */
27353
+ var ModelFormatSchema$1 = zod.z.enum(MODEL_FORMATS);
27354
+ var HardwareClassIdSchema = zod.z.enum([
27355
+ "intel-core-ultra",
27356
+ "intel-n-series",
27357
+ "apple-m-base",
27358
+ "apple-m-pro",
27359
+ "unknown"
27360
+ ]);
27361
+ var AcceleratorKindSchema = zod.z.enum([
27362
+ "intel-npu",
27363
+ "intel-igpu",
27364
+ "x86-cpu",
27365
+ "arm-cpu",
27366
+ "apple-ane",
27367
+ "coral"
27368
+ ]);
27369
+ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
27370
+ zod.z.object({
27371
+ kind: zod.z.literal("fits"),
27372
+ utilisation: zod.z.number()
27373
+ }),
27374
+ zod.z.object({
27375
+ kind: zod.z.literal("tie-faster"),
27376
+ over: zod.z.string(),
27377
+ recallDelta: zod.z.number()
27378
+ }),
27379
+ zod.z.object({
27380
+ kind: zod.z.literal("stepped-down"),
27381
+ from: zod.z.string(),
27382
+ to: zod.z.string(),
27383
+ limitedBy: zod.z.string()
27384
+ }),
27385
+ zod.z.object({
27386
+ kind: zod.z.literal("no-fit-lightest"),
27387
+ utilisation: zod.z.number()
27388
+ }),
27389
+ zod.z.object({
27390
+ kind: zod.z.literal("derived-latency"),
27391
+ modelId: zod.z.string()
27392
+ }),
27393
+ zod.z.object({
27394
+ kind: zod.z.literal("estimated-load"),
27395
+ observedForMs: zod.z.number().nullable()
27396
+ }),
27397
+ zod.z.object({ kind: zod.z.literal("cpu-device") }),
27398
+ zod.z.object({ kind: zod.z.literal("coral-untouched") }),
27399
+ zod.z.object({ kind: zod.z.literal("device-disabled") }),
27400
+ zod.z.object({ kind: zod.z.literal("device-unavailable") }),
27401
+ zod.z.object({ kind: zod.z.literal("node-offline") }),
27402
+ zod.z.object({ kind: zod.z.literal("no-hardware-facts") }),
27403
+ zod.z.object({
27404
+ kind: zod.z.literal("no-measured-data"),
27405
+ hardwareClass: HardwareClassIdSchema
27406
+ }),
27407
+ zod.z.object({
27408
+ kind: zod.z.literal("no-family-build"),
27409
+ format: ModelFormatSchema$1
27410
+ })
27411
+ ]);
27412
+ var DeviceDemandSchema = zod.z.object({
27413
+ nodeId: zod.z.string(),
27414
+ deviceKey: zod.z.string(),
27415
+ demandFps: zod.z.number(),
27416
+ maxCameraFps: zod.z.number(),
27417
+ alwaysOnCameras: zod.z.number(),
27418
+ onMotionSessions: zod.z.number(),
27419
+ onMotionSource: zod.z.enum([
27420
+ "observed-24h",
27421
+ "estimate",
27422
+ "none"
27423
+ ]),
27424
+ observedForMs: zod.z.number().nullable(),
27425
+ /** How on-motion sessions were charged: per-device observation, or split by share (D748). */
27426
+ placement: SessionPlacementPolicySchema
27427
+ });
27428
+ var DeviceModelChoiceSchema = zod.z.object({
27429
+ modelId: zod.z.string(),
27430
+ p50Ms: zod.z.number(),
27431
+ fps: zod.z.number(),
27432
+ measured: zod.z.boolean(),
27433
+ utilisation: zod.z.number(),
27434
+ personRecall: zod.z.number()
27435
+ });
27436
+ var DeviceRecommendationSchema = zod.z.object({
27437
+ deviceKey: zod.z.string(),
27438
+ accelerator: AcceleratorKindSchema.nullable(),
27439
+ enabled: zod.z.boolean(),
27440
+ available: zod.z.boolean(),
27441
+ demand: DeviceDemandSchema.nullable(),
27442
+ chosen: DeviceModelChoiceSchema.nullable(),
27443
+ reasons: zod.z.array(RecommendationReasonSchema).readonly()
27444
+ });
27445
+ var NodeRecommendationSchema = zod.z.object({
27446
+ nodeId: zod.z.string(),
27447
+ reachable: zod.z.boolean(),
27448
+ hardwareClass: HardwareClassIdSchema.nullable(),
27449
+ cpuModel: zod.z.string().nullable(),
27450
+ skipped: zod.z.boolean(),
27451
+ acceleratorModelId: zod.z.string().nullable(),
27452
+ devices: zod.z.array(DeviceRecommendationSchema).readonly(),
27453
+ reasons: zod.z.array(RecommendationReasonSchema).readonly()
27454
+ });
27455
+ var ModelPinChangeSchema = zod.z.object({
27456
+ stepId: zod.z.string(),
27457
+ before: zod.z.string().nullable(),
27458
+ after: zod.z.string().nullable()
27459
+ });
27460
+ var NodeDeviceChangeSchema = zod.z.object({
27461
+ nodeId: zod.z.string(),
27462
+ deviceKey: zod.z.string(),
27463
+ madeExplicit: zod.z.boolean(),
27464
+ modelPins: zod.z.array(ModelPinChangeSchema).readonly(),
27465
+ thresholds: zod.z.array(zod.z.object({
27466
+ stepId: zod.z.string(),
27467
+ keys: zod.z.array(zod.z.string()).readonly()
27468
+ })).readonly()
27469
+ });
27470
+ var CameraOverrideClearSchema = zod.z.object({
27471
+ deviceId: zod.z.number(),
27472
+ source: zod.z.enum(["step-override", "wholesale"]),
27473
+ nodeId: zod.z.string(),
27474
+ deviceKey: zod.z.string().nullable(),
27475
+ stepId: zod.z.string(),
27476
+ modelIdBefore: zod.z.string().nullable(),
27477
+ keys: zod.z.array(zod.z.string()).readonly()
27478
+ });
27479
+ var DetectorStoreClearSchema = zod.z.object({
27480
+ deviceId: zod.z.number(),
27481
+ keys: zod.z.array(zod.z.string()).readonly()
27482
+ });
27483
+ var BestSettingsWarningSchema = zod.z.discriminatedUnion("kind", [
27484
+ zod.z.object({
27485
+ kind: zod.z.literal("detector-store-cluster-wide"),
27486
+ skippedNodes: zod.z.array(zod.z.string()).readonly()
27487
+ }),
27488
+ zod.z.object({
27489
+ kind: zod.z.literal("detector-store-unreadable"),
27490
+ error: zod.z.string()
27491
+ }),
27492
+ zod.z.object({
27493
+ kind: zod.z.literal("coral-enabled"),
27494
+ nodeId: zod.z.string(),
27495
+ deviceKey: zod.z.string()
27496
+ })
27497
+ ]);
27498
+ var BestSettingsOptionsSchema = zod.z.object({
27499
+ /** Share of each accelerator's throughput kept free (0.3–0.5). */
27500
+ headroom: zod.z.number().min(.3).max(.5).default(.4),
27501
+ /**
27502
+ * What-if shares (D748): plan as if these node/device shares were stored
27503
+ * and the policy were `share`. Absent = the stored shares under the stored
27504
+ * policy. A what-if plan is for display; apply always re-plans from what
27505
+ * is stored.
27506
+ */
27507
+ shares: LoadBalancingSharesInputSchema.optional()
27508
+ });
27509
+ var BestSettingsPlanSchema = zod.z.object({
27510
+ /** Hash of everything the apply will write — the apply refuses a different one. */
27511
+ planHash: zod.z.string(),
27512
+ family: zod.z.literal("yolov9"),
27513
+ headroom: zod.z.number(),
27514
+ /** Planned under what-if shares (D748): for display — apply refuses it as stale. */
27515
+ whatIf: zod.z.boolean(),
27516
+ generatedAt: zod.z.number(),
27517
+ nodes: zod.z.array(NodeRecommendationSchema).readonly(),
27518
+ nodeChanges: zod.z.array(NodeDeviceChangeSchema).readonly(),
27519
+ cameraClears: zod.z.array(CameraOverrideClearSchema).readonly(),
27520
+ detectorStoreClears: zod.z.array(DetectorStoreClearSchema).readonly(),
27521
+ warnings: zod.z.array(BestSettingsWarningSchema).readonly()
27522
+ });
27523
+ var BestSettingsApplyInputSchema = zod.z.object({
27524
+ planHash: zod.z.string(),
27525
+ headroom: zod.z.number().min(.3).max(.5).default(.4)
27526
+ });
27527
+ var BestSettingsPhaseResultSchema = zod.z.object({
27528
+ phase: zod.z.enum([
27529
+ "download",
27530
+ "camera-overrides",
27531
+ "detector-thresholds",
27532
+ "node-models",
27533
+ "redispatch"
27534
+ ]),
27535
+ ok: zod.z.boolean(),
27536
+ detail: zod.z.string()
27537
+ });
27538
+ var BestSettingsApplyResultSchema = zod.z.discriminatedUnion("kind", [
27539
+ zod.z.object({
27540
+ kind: zod.z.literal("applied"),
27541
+ planHash: zod.z.string(),
27542
+ phases: zod.z.array(BestSettingsPhaseResultSchema).readonly()
27543
+ }),
27544
+ zod.z.object({
27545
+ kind: zod.z.literal("aborted"),
27546
+ phases: zod.z.array(BestSettingsPhaseResultSchema).readonly()
27547
+ }),
27548
+ zod.z.object({
27549
+ kind: zod.z.literal("stale"),
27550
+ plan: BestSettingsPlanSchema
27551
+ }),
27552
+ zod.z.object({
27553
+ kind: zod.z.literal("refused"),
27554
+ reason: zod.z.enum(["apply-in-progress"])
27555
+ })
27556
+ ]);
27557
+ //#endregion
27188
27558
  //#region src/capabilities/schemas/orchestrator-metrics.ts
27189
27559
  /** Shared Zod schemas for the runtime pipeline orchestrator metrics. */
27190
27560
  var OrchestratorMetricsSchema = zod.z.object({
@@ -28798,7 +29168,6 @@ var CameraStepOverridePatchSchema = zod.z.object({
28798
29168
  settings: zod.z.record(zod.z.string(), zod.z.unknown()).readonly().optional()
28799
29169
  });
28800
29170
  var CameraPipelineSettingsSchema = zod.z.object({
28801
- pinnedAgentNodeId: zod.z.string().optional(),
28802
29171
  stepToggles: zod.z.record(zod.z.string(), zod.z.boolean()).optional(),
28803
29172
  stepOverridesByDevice: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), CameraStepOverridePatchSchema))).optional(),
28804
29173
  pipelineByAgent: zod.z.record(zod.z.string(), CameraPipelineForAgentSchema).optional()
@@ -29492,18 +29861,6 @@ var pipelineOrchestratorCapability = {
29492
29861
  auth: "admin"
29493
29862
  }),
29494
29863
  /**
29495
- * Set a node's detection WEIGHT (relative share for the quota balancer).
29496
- * `null` clears it (back to the implicit weight 1). Unpinned cameras
29497
- * distribute proportionally to weight; `maxCameras` still clamps on top.
29498
- */
29499
- setAgentDetectWeight: require_sleep.method(zod.z.object({
29500
- agentNodeId: zod.z.string(),
29501
- detectWeight: zod.z.number().positive().nullable()
29502
- }), zod.z.object({ success: zod.z.literal(true) }), {
29503
- kind: "mutation",
29504
- auth: "admin"
29505
- }),
29506
- /**
29507
29864
  * Set one node's placement CAPABILITIES — the per-node record that
29508
29865
  * replaced the four flat orchestrator lists (`enabledNodes`,
29509
29866
  * `enabledDecoderNodes`, `enabledAudioNodes`, `remoteSourcingNodes`).
@@ -29622,6 +29979,54 @@ var pipelineOrchestratorCapability = {
29622
29979
  kind: "mutation",
29623
29980
  auth: "admin"
29624
29981
  }),
29982
+ /**
29983
+ * Best settings (D745) — DRY RUN. Recommends ONE detector family (YOLOv9)
29984
+ * for the whole cluster from each node's static hardware class, the
29985
+ * measured latency table and the detection demand, and lists every write
29986
+ * the apply would make: the node model pins set, the enrichment pins and
29987
+ * model-bound thresholds removed (node level and per camera), and the
29988
+ * per-camera detector thresholds cleared. Writes nothing. Step
29989
+ * enablement, device enablement, pins, recording, notifications, zones and
29990
+ * rules are never part of it. `planHash` names exactly this diff.
29991
+ */
29992
+ planBestSettings: require_sleep.method(BestSettingsOptionsSchema, BestSettingsPlanSchema, { auth: "admin" }),
29993
+ /**
29994
+ * Best settings (D745) — APPLY the plan the operator confirmed. Recomputes
29995
+ * the plan and refuses (`stale`, with the fresh plan) when its hash is not
29996
+ * `planHash`, so what is written is exactly the confirmed diff. Offline
29997
+ * nodes are skipped; there is no undo.
29998
+ */
29999
+ applyBestSettings: require_sleep.method(BestSettingsApplyInputSchema, BestSettingsApplyResultSchema, {
30000
+ kind: "mutation",
30001
+ auth: "admin"
30002
+ }),
30003
+ /**
30004
+ * Load balancing (D748) — write node shares (`detectWeight`) and per-node
30005
+ * device shares (inference-device `weight`) in ONE atomic read-modify-write
30006
+ * of the agent settings — the only writer of node shares (the per-node
30007
+ * `setAgentDetectWeight` it replaced raced its siblings, one RMW each).
30008
+ * A node or device left out keeps its weight. Never changes the
30009
+ * `sessionPlacement` policy.
30010
+ */
30011
+ setLoadBalancingShares: require_sleep.method(LoadBalancingSharesInputSchema, zod.z.object({ success: zod.z.literal(true) }), {
30012
+ kind: "mutation",
30013
+ auth: "admin"
30014
+ }),
30015
+ /**
30016
+ * Load balancing (D748) — what placement actually did: per node and
30017
+ * device, sessions now, sessions started and the time-weighted share of
30018
+ * PARALLEL sessions over `windowMs`; the cluster's parallel peak; yields
30019
+ * a share election made; and every device pin the session path cannot
30020
+ * honour. In memory on the hub — a restart starts a new window.
30021
+ */
30022
+ getPlacementStats: require_sleep.method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }),
30023
+ /**
30024
+ * Load balancing (D748) — shares proportional to each node's measured
30025
+ * capacity at the models Best settings would pick, iterated (≤ 3 rounds)
30026
+ * until the shares stop moving; per device, an ADVISORY session cap.
30027
+ * Writes nothing.
30028
+ */
30029
+ suggestShares: require_sleep.method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }),
29625
30030
  /** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
29626
30031
  getCameraSettings: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), CameraPipelineSettingsSchema.nullable()),
29627
30032
  /** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
@@ -55704,6 +56109,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
55704
56109
  addonId: null,
55705
56110
  access: "delete"
55706
56111
  },
56112
+ "pipelineExecutor.clearModelBoundDeviceOverrides": {
56113
+ capName: "pipeline-executor",
56114
+ capScope: "system",
56115
+ addonId: null,
56116
+ access: "delete"
56117
+ },
55707
56118
  "pipelineExecutor.deleteModel": {
55708
56119
  capName: "pipeline-executor",
55709
56120
  capScope: "system",
@@ -55920,6 +56331,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
55920
56331
  addonId: null,
55921
56332
  access: "view"
55922
56333
  },
56334
+ "pipelineOrchestrator.applyBestSettings": {
56335
+ capName: "pipeline-orchestrator",
56336
+ capScope: "system",
56337
+ addonId: null,
56338
+ access: "create"
56339
+ },
55923
56340
  "pipelineOrchestrator.applyDeviceSettingsPatch": {
55924
56341
  capName: "pipeline-orchestrator",
55925
56342
  capScope: "system",
@@ -56070,6 +56487,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
56070
56487
  addonId: null,
56071
56488
  access: "view"
56072
56489
  },
56490
+ "pipelineOrchestrator.getPlacementStats": {
56491
+ capName: "pipeline-orchestrator",
56492
+ capScope: "system",
56493
+ addonId: null,
56494
+ access: "view"
56495
+ },
56073
56496
  "pipelineOrchestrator.getReconcileFromDiskStatus": {
56074
56497
  capName: "pipeline-orchestrator",
56075
56498
  capScope: "system",
@@ -56094,6 +56517,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
56094
56517
  addonId: null,
56095
56518
  access: "create"
56096
56519
  },
56520
+ "pipelineOrchestrator.planBestSettings": {
56521
+ capName: "pipeline-orchestrator",
56522
+ capScope: "system",
56523
+ addonId: null,
56524
+ access: "view"
56525
+ },
56097
56526
  "pipelineOrchestrator.rebalance": {
56098
56527
  capName: "pipeline-orchestrator",
56099
56528
  capScope: "system",
@@ -56154,12 +56583,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
56154
56583
  addonId: null,
56155
56584
  access: "create"
56156
56585
  },
56157
- "pipelineOrchestrator.setAgentDetectWeight": {
56158
- capName: "pipeline-orchestrator",
56159
- capScope: "system",
56160
- addonId: null,
56161
- access: "create"
56162
- },
56163
56586
  "pipelineOrchestrator.setAgentInferenceDevices": {
56164
56587
  capName: "pipeline-orchestrator",
56165
56588
  capScope: "system",
@@ -56214,12 +56637,24 @@ var METHOD_ACCESS_MAP = Object.freeze({
56214
56637
  addonId: null,
56215
56638
  access: "create"
56216
56639
  },
56640
+ "pipelineOrchestrator.setLoadBalancingShares": {
56641
+ capName: "pipeline-orchestrator",
56642
+ capScope: "system",
56643
+ addonId: null,
56644
+ access: "create"
56645
+ },
56217
56646
  "pipelineOrchestrator.setPipelineDevicePin": {
56218
56647
  capName: "pipeline-orchestrator",
56219
56648
  capScope: "system",
56220
56649
  addonId: null,
56221
56650
  access: "create"
56222
56651
  },
56652
+ "pipelineOrchestrator.suggestShares": {
56653
+ capName: "pipeline-orchestrator",
56654
+ capScope: "system",
56655
+ addonId: null,
56656
+ access: "view"
56657
+ },
56223
56658
  "pipelineOrchestrator.unassignAudio": {
56224
56659
  capName: "pipeline-orchestrator",
56225
56660
  capScope: "system",
@@ -64868,6 +65303,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
64868
65303
  form: "single",
64869
65304
  optional: false
64870
65305
  }],
65306
+ "pipelineExecutor.clearModelBoundDeviceOverrides": [{
65307
+ name: "deviceIds",
65308
+ form: "array",
65309
+ optional: true
65310
+ }],
64871
65311
  "pipelineExecutor.runPipeline": [{
64872
65312
  name: "deviceId",
64873
65313
  form: "single",
@@ -65935,6 +66375,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
65935
66375
  "osdManager.previewSlot",
65936
66376
  "osdManager.renderDevice",
65937
66377
  "osdManager.setSlotBinding",
66378
+ "pipelineExecutor.clearModelBoundDeviceOverrides",
65938
66379
  "pipelineExecutor.runPipeline",
65939
66380
  "pipelineExecutor.runPipelineBatch",
65940
66381
  "pipelineOrchestrator.applyDeviceSettingsPatch",
@@ -66919,6 +67360,7 @@ function createSystemProxy(api) {
66919
67360
  getVideoPipelineSteps: (input) => dispatch("pipelineExecutor", "getVideoPipelineSteps", "query", input),
66920
67361
  setVideoPipelineSteps: (input) => dispatch("pipelineExecutor", "setVideoPipelineSteps", "mutation", input),
66921
67362
  clearDeviceOverrides: (input) => dispatch("pipelineExecutor", "clearDeviceOverrides", "mutation", input),
67363
+ clearModelBoundDeviceOverrides: (input) => dispatch("pipelineExecutor", "clearModelBoundDeviceOverrides", "mutation", input),
66922
67364
  getInferenceDeviceHealth: (input) => dispatch("pipelineExecutor", "getInferenceDeviceHealth", "query", input),
66923
67365
  rearmInferenceDevice: (input) => dispatch("pipelineExecutor", "rearmInferenceDevice", "mutation", input),
66924
67366
  getSchema: (input) => dispatch("pipelineExecutor", "getSchema", "query", input),
@@ -66967,13 +67409,17 @@ function createSystemProxy(api) {
66967
67409
  listAgentSettings: (input) => dispatch("pipelineOrchestrator", "listAgentSettings", "query", input),
66968
67410
  removeAgentSettings: (input) => dispatch("pipelineOrchestrator", "removeAgentSettings", "mutation", input),
66969
67411
  setAgentMaxCameras: (input) => dispatch("pipelineOrchestrator", "setAgentMaxCameras", "mutation", input),
66970
- setAgentDetectWeight: (input) => dispatch("pipelineOrchestrator", "setAgentDetectWeight", "mutation", input),
66971
67412
  setAgentCapabilities: (input) => dispatch("pipelineOrchestrator", "setAgentCapabilities", "mutation", input),
66972
67413
  setAgentDecodeLimits: (input) => dispatch("pipelineOrchestrator", "setAgentDecodeLimits", "mutation", input),
66973
67414
  setAgentReachableHost: (input) => dispatch("pipelineOrchestrator", "setAgentReachableHost", "mutation", input),
66974
67415
  setAgentInferenceDevices: (input) => dispatch("pipelineOrchestrator", "setAgentInferenceDevices", "mutation", input),
66975
67416
  getNodeInferenceDevices: (input) => dispatch("pipelineOrchestrator", "getNodeInferenceDevices", "query", input),
66976
67417
  resetNodePipelineDefaults: (input) => dispatch("pipelineOrchestrator", "resetNodePipelineDefaults", "mutation", input),
67418
+ planBestSettings: (input) => dispatch("pipelineOrchestrator", "planBestSettings", "query", input),
67419
+ applyBestSettings: (input) => dispatch("pipelineOrchestrator", "applyBestSettings", "mutation", input),
67420
+ setLoadBalancingShares: (input) => dispatch("pipelineOrchestrator", "setLoadBalancingShares", "mutation", input),
67421
+ getPlacementStats: (input) => dispatch("pipelineOrchestrator", "getPlacementStats", "query", input),
67422
+ suggestShares: (input) => dispatch("pipelineOrchestrator", "suggestShares", "query", input),
66977
67423
  getCameraStatuses: (input) => dispatch("pipelineOrchestrator", "getCameraStatuses", "query", input),
66978
67424
  setCameraSensors: (input) => dispatch("pipelineOrchestrator", "setCameraSensors", "mutation", input),
66979
67425
  reconcileFromDisk: (input) => dispatch("pipelineOrchestrator", "reconcileFromDisk", "mutation", input),
@@ -71846,41 +72292,6 @@ function isRemovedModelId(stepId, modelId) {
71846
72292
  }
71847
72293
  //#endregion
71848
72294
  //#region src/pipeline/model-bound-settings.ts
71849
- /**
71850
- * Model-bound step settings (D738): an operator value that is only meaningful
71851
- * for ONE model, stored together with that model's id.
71852
- *
71853
- * The per-class confidence floors are the case it exists for. A score is a
71854
- * property of one detector's output scale — on this hub the median score of a
71855
- * correct person was 0.78 on `yolov9m-320-int8`, 0.68 on `yolo26s-320-int8`,
71856
- * 0.40 on `yolo26n-320-int8` and 0.89 on `yolo26s` (640) — so a floor tuned on
71857
- * one model is wrong on the next. The DEFAULT of such a field belongs to the
71858
- * model (the catalog entry); an operator OVERRIDE belongs to the model it was
71859
- * made for.
71860
- *
71861
- * The binding is checked at READ time against the model that RUNS, never
71862
- * enforced by a write on the model-change path: a model can change without any
71863
- * operator write at all (an unpinned root follows the elected device's
71864
- * hardware-aware default, D736), and an event-driven reset could be dropped
71865
- * (events are telemetry, D8/D11). So:
71866
- *
71867
- * effective = override when the stored binding names the running model
71868
- * | override when no binding is stored (a legacy / programmatic
71869
- * value — it applies to whatever runs, as before D738)
71870
- * | the running model's default, when it declares one
71871
- * | the field's global default.
71872
- *
71873
- * Storage shape: the value stays a plain number under its own key (every
71874
- * reader of the raw settings bag keeps working), and the binding is a SIBLING
71875
- * key, {@link modelBindingKey}. Both are flat so the shallow per-key merges of
71876
- * the settings layers (node fold, camera override) carry a value and its
71877
- * binding together whenever one layer writes both — which every writer here
71878
- * does.
71879
- *
71880
- * Lives in the bare `@camstack/types` entry, which every addon bundles, so the
71881
- * runner (`addon-pipeline`) and the editors (`ui-library`, `addon-admin-ui`)
71882
- * apply the same rule.
71883
- */
71884
72295
  /** Suffix of the sibling key that names the model a stored value was made for. */
71885
72296
  var MODEL_BINDING_SUFFIX = "ModelId";
71886
72297
  /** `minConfidencePerson` → `minConfidencePersonModelId`. */
@@ -71969,6 +72380,901 @@ function hasModelBoundOverrides(settings, boundKeys, modelId) {
71969
72380
  function clearModelBoundOverrides(settings, boundKeys, modelId) {
71970
72381
  return boundKeys.reduce((acc, key) => resolveModelBoundSetting(acc, key, modelId, void 0, void 0).source === "override" ? clearModelBoundSetting(acc, key) : acc, { ...settings });
71971
72382
  }
72383
+ /**
72384
+ * The keys of every `bindsToModel` field of a step's config schema, groups
72385
+ * flattened (D738). One definition for the runner (which applies the binding)
72386
+ * and the orchestrator's Best settings (which clears those overrides, D745).
72387
+ */
72388
+ function collectModelBoundKeys(fields) {
72389
+ return fields.flatMap((field) => {
72390
+ if (field.type === "group") return collectModelBoundKeys(field.fields);
72391
+ return "key" in field && "bindsToModel" in field && field.bindsToModel === true ? [field.key] : [];
72392
+ });
72393
+ }
72394
+ //#endregion
72395
+ //#region src/pipeline/best-settings/hardware-class.ts
72396
+ var APPLE_CHIP = /^Apple M(\d+)(?:\s+(Pro|Max|Ultra))?\b/i;
72397
+ var INTEL_CORE_ULTRA = /Core\(TM\)\s+Ultra|Core Ultra/i;
72398
+ var INTEL_N_SERIES = /Intel\(R\)\s+N\d{2,3}\b|\bIntel\s+N\d{2,3}\b/i;
72399
+ function parseAppleChip(cpuModel) {
72400
+ const match = APPLE_CHIP.exec(cpuModel.trim());
72401
+ if (match === null) return null;
72402
+ const generation = Number(match[1]);
72403
+ const variantRaw = (match[2] ?? "base").toLowerCase();
72404
+ return {
72405
+ generation,
72406
+ variant: variantRaw === "pro" || variantRaw === "max" || variantRaw === "ultra" ? variantRaw : "base"
72407
+ };
72408
+ }
72409
+ /**
72410
+ * Classify a node. Apple base chips (M1–M4) map to the measured M2 column, the
72411
+ * Pro/Max/Ultra chips to the measured M3 Pro column — the M2 was measured at
72412
+ * 1.0–1.2× the M3 Pro on the Neural Engine, so the generation inside a variant
72413
+ * matters less than the column's own error.
72414
+ */
72415
+ function classifyInferenceHardware(hw) {
72416
+ const cpuModel = hw.cpuModel;
72417
+ const apple = parseAppleChip(cpuModel);
72418
+ if (apple !== null) return {
72419
+ hardwareClass: apple.variant === "base" ? "apple-m-base" : "apple-m-pro",
72420
+ cpuModel,
72421
+ apple
72422
+ };
72423
+ if (INTEL_CORE_ULTRA.test(cpuModel)) return {
72424
+ hardwareClass: "intel-core-ultra",
72425
+ cpuModel
72426
+ };
72427
+ if (INTEL_N_SERIES.test(cpuModel)) return {
72428
+ hardwareClass: "intel-n-series",
72429
+ cpuModel
72430
+ };
72431
+ return {
72432
+ hardwareClass: "unknown",
72433
+ cpuModel
72434
+ };
72435
+ }
72436
+ /**
72437
+ * The accelerator kind of one of a node's device keys (`openvino:npu`,
72438
+ * `openvino:gpu`, `coreml:all`, `edgetpu:usb`, `cpu`, `onnx:cpu`, …). `null`
72439
+ * for a key this table has no column for.
72440
+ */
72441
+ function acceleratorKindOf(deviceKey, hw) {
72442
+ const [backend = "", device = ""] = deviceKey.split(":");
72443
+ if (backend === "edgetpu") return "coral";
72444
+ if (backend === "coreml") return device === "cpu" ? "arm-cpu" : "apple-ane";
72445
+ if (backend === "openvino" && device === "npu") return "intel-npu";
72446
+ if (backend === "openvino" && device === "gpu") return "intel-igpu";
72447
+ if (backend === "cpu" || device === "cpu") return hw.arch === "arm64" ? "arm-cpu" : "x86-cpu";
72448
+ return null;
72449
+ }
72450
+ //#endregion
72451
+ //#region src/pipeline/best-settings/detector-performance.ts
72452
+ var DETECTOR_PERF = {
72453
+ "intel-core-ultra": {
72454
+ "intel-npu": {
72455
+ "yolov9t-320": {
72456
+ p50Ms: 2.9,
72457
+ fps: 383,
72458
+ measured: true
72459
+ },
72460
+ "yolov9t-320-int8": {
72461
+ p50Ms: 3.8,
72462
+ fps: 333,
72463
+ measured: true
72464
+ },
72465
+ "yolov9t-640": {
72466
+ p50Ms: 7.4,
72467
+ fps: 139,
72468
+ measured: true
72469
+ },
72470
+ "yolov9t-640-int8": {
72471
+ p50Ms: 7.5,
72472
+ fps: 144,
72473
+ measured: true
72474
+ },
72475
+ "yolov9s-320": {
72476
+ p50Ms: 4.4,
72477
+ fps: 241,
72478
+ measured: true
72479
+ },
72480
+ "yolov9s-320-int8": {
72481
+ p50Ms: 4.1,
72482
+ fps: 264,
72483
+ measured: true
72484
+ },
72485
+ "yolov9s-640": {
72486
+ p50Ms: 12.7,
72487
+ fps: 82,
72488
+ measured: true
72489
+ },
72490
+ "yolov9s-640-int8": {
72491
+ p50Ms: 10.7,
72492
+ fps: 99,
72493
+ measured: true
72494
+ },
72495
+ "yolov9m-320": {
72496
+ p50Ms: 8.4,
72497
+ fps: 123,
72498
+ measured: true
72499
+ },
72500
+ "yolov9m-320-int8": {
72501
+ p50Ms: 6.5,
72502
+ fps: 165,
72503
+ measured: true
72504
+ },
72505
+ "yolov9m-640": {
72506
+ p50Ms: 29.5,
72507
+ fps: 32,
72508
+ measured: true
72509
+ },
72510
+ "yolov9m-640-int8": {
72511
+ p50Ms: 19.5,
72512
+ fps: 52,
72513
+ measured: true
72514
+ }
72515
+ },
72516
+ "intel-igpu": {
72517
+ "yolov9t-320": {
72518
+ p50Ms: 2.6,
72519
+ fps: 405,
72520
+ measured: true
72521
+ },
72522
+ "yolov9t-320-int8": {
72523
+ p50Ms: 2.8,
72524
+ fps: 324,
72525
+ measured: true
72526
+ },
72527
+ "yolov9t-640": {
72528
+ p50Ms: 6.5,
72529
+ fps: 157,
72530
+ measured: true
72531
+ },
72532
+ "yolov9t-640-int8": {
72533
+ p50Ms: 5.6,
72534
+ fps: 185,
72535
+ measured: true
72536
+ },
72537
+ "yolov9s-320": {
72538
+ p50Ms: 4.6,
72539
+ fps: 200,
72540
+ measured: true
72541
+ },
72542
+ "yolov9s-320-int8": {
72543
+ p50Ms: 4.1,
72544
+ fps: 239,
72545
+ measured: true
72546
+ },
72547
+ "yolov9s-640": {
72548
+ p50Ms: 15.2,
72549
+ fps: 69,
72550
+ measured: true
72551
+ },
72552
+ "yolov9s-640-int8": {
72553
+ p50Ms: 10.5,
72554
+ fps: 99,
72555
+ measured: true
72556
+ },
72557
+ "yolov9m-320": {
72558
+ p50Ms: 11.4,
72559
+ fps: 88,
72560
+ measured: true
72561
+ },
72562
+ "yolov9m-320-int8": {
72563
+ p50Ms: 7,
72564
+ fps: 127,
72565
+ measured: true
72566
+ },
72567
+ "yolov9m-640": {
72568
+ p50Ms: 40,
72569
+ fps: 25,
72570
+ measured: true
72571
+ },
72572
+ "yolov9m-640-int8": {
72573
+ p50Ms: 23.5,
72574
+ fps: 44,
72575
+ measured: true
72576
+ }
72577
+ },
72578
+ "x86-cpu": {
72579
+ "yolov9t-320": {
72580
+ p50Ms: 6.9,
72581
+ fps: 145,
72582
+ measured: true
72583
+ },
72584
+ "yolov9t-320-int8": {
72585
+ p50Ms: 2.7,
72586
+ fps: 405,
72587
+ measured: true
72588
+ },
72589
+ "yolov9t-640": {
72590
+ p50Ms: 23,
72591
+ fps: 44,
72592
+ measured: true
72593
+ },
72594
+ "yolov9t-640-int8": {
72595
+ p50Ms: 8.8,
72596
+ fps: 124,
72597
+ measured: true
72598
+ },
72599
+ "yolov9s-320": {
72600
+ p50Ms: 15.8,
72601
+ fps: 63,
72602
+ measured: true
72603
+ },
72604
+ "yolov9s-320-int8": {
72605
+ p50Ms: 6.5,
72606
+ fps: 180,
72607
+ measured: true
72608
+ },
72609
+ "yolov9s-640": {
72610
+ p50Ms: 58.2,
72611
+ fps: 17,
72612
+ measured: true
72613
+ },
72614
+ "yolov9s-640-int8": {
72615
+ p50Ms: 20.1,
72616
+ fps: 52,
72617
+ measured: true
72618
+ },
72619
+ "yolov9m-320": {
72620
+ p50Ms: 40,
72621
+ fps: 25,
72622
+ measured: true
72623
+ },
72624
+ "yolov9m-320-int8": {
72625
+ p50Ms: 14.2,
72626
+ fps: 74,
72627
+ measured: true
72628
+ },
72629
+ "yolov9m-640": {
72630
+ p50Ms: 155.8,
72631
+ fps: 6,
72632
+ measured: true
72633
+ },
72634
+ "yolov9m-640-int8": {
72635
+ p50Ms: 52.4,
72636
+ fps: 19,
72637
+ measured: true
72638
+ }
72639
+ }
72640
+ },
72641
+ "intel-n-series": {
72642
+ "intel-igpu": {
72643
+ "yolov9t-320": {
72644
+ p50Ms: 15,
72645
+ fps: 48,
72646
+ measured: true
72647
+ },
72648
+ "yolov9t-320-int8": {
72649
+ p50Ms: 14.1,
72650
+ fps: 67,
72651
+ measured: true
72652
+ },
72653
+ "yolov9t-640": {
72654
+ p50Ms: 38.5,
72655
+ fps: 26,
72656
+ measured: true
72657
+ },
72658
+ "yolov9t-640-int8": {
72659
+ p50Ms: 33.1,
72660
+ fps: 33,
72661
+ measured: true
72662
+ },
72663
+ "yolov9s-320": {
72664
+ p50Ms: 41.4,
72665
+ fps: 24,
72666
+ measured: true
72667
+ },
72668
+ "yolov9s-320-int8": {
72669
+ p50Ms: 23.3,
72670
+ fps: 34,
72671
+ measured: true
72672
+ },
72673
+ "yolov9s-640": {
72674
+ p50Ms: 127.4,
72675
+ fps: 8,
72676
+ measured: true
72677
+ },
72678
+ "yolov9s-640-int8": {
72679
+ p50Ms: 92.9,
72680
+ fps: 11,
72681
+ measured: true
72682
+ },
72683
+ "yolov9m-320": {
72684
+ p50Ms: 63.5,
72685
+ fps: 16,
72686
+ measured: true
72687
+ },
72688
+ "yolov9m-320-int8": {
72689
+ p50Ms: 39.4,
72690
+ fps: 26,
72691
+ measured: true
72692
+ },
72693
+ "yolov9m-640": {
72694
+ p50Ms: 215.5,
72695
+ fps: 5,
72696
+ measured: true
72697
+ },
72698
+ "yolov9m-640-int8": {
72699
+ p50Ms: 139.1,
72700
+ fps: 7,
72701
+ measured: true
72702
+ }
72703
+ },
72704
+ "x86-cpu": {
72705
+ "yolov9t-320": {
72706
+ p50Ms: 86.2,
72707
+ fps: 12,
72708
+ measured: true
72709
+ },
72710
+ "yolov9t-320-int8": {
72711
+ p50Ms: 52.7,
72712
+ fps: 20,
72713
+ measured: true
72714
+ },
72715
+ "yolov9t-640": {
72716
+ p50Ms: 322.1,
72717
+ fps: 3,
72718
+ measured: true
72719
+ },
72720
+ "yolov9t-640-int8": {
72721
+ p50Ms: 205.6,
72722
+ fps: 5,
72723
+ measured: true
72724
+ },
72725
+ "yolov9s-320": {
72726
+ p50Ms: 164.4,
72727
+ fps: 6,
72728
+ measured: true
72729
+ },
72730
+ "yolov9s-320-int8": {
72731
+ p50Ms: 86.9,
72732
+ fps: 12,
72733
+ measured: true
72734
+ },
72735
+ "yolov9s-640": {
72736
+ p50Ms: 341.3,
72737
+ fps: 3,
72738
+ measured: true
72739
+ },
72740
+ "yolov9s-640-int8": {
72741
+ p50Ms: 185.3,
72742
+ fps: 5,
72743
+ measured: true
72744
+ },
72745
+ "yolov9m-320": {
72746
+ p50Ms: 166.8,
72747
+ fps: 6,
72748
+ measured: true
72749
+ },
72750
+ "yolov9m-320-int8": {
72751
+ p50Ms: 226.3,
72752
+ fps: 4,
72753
+ measured: true
72754
+ },
72755
+ "yolov9m-640": {
72756
+ p50Ms: 663.5,
72757
+ fps: 2,
72758
+ measured: true
72759
+ },
72760
+ "yolov9m-640-int8": {
72761
+ p50Ms: 324.4,
72762
+ fps: 3,
72763
+ measured: true
72764
+ }
72765
+ }
72766
+ },
72767
+ "apple-m-pro": { "apple-ane": {
72768
+ "yolov9t-320": {
72769
+ p50Ms: 1.1,
72770
+ fps: 952,
72771
+ measured: true
72772
+ },
72773
+ "yolov9t-640": {
72774
+ p50Ms: 3,
72775
+ fps: 333,
72776
+ measured: true
72777
+ },
72778
+ "yolov9s-320": {
72779
+ p50Ms: 1.5,
72780
+ fps: 667,
72781
+ measured: true
72782
+ },
72783
+ "yolov9s-640": {
72784
+ p50Ms: 5.1,
72785
+ fps: 196,
72786
+ measured: true
72787
+ },
72788
+ "yolov9m-320": {
72789
+ p50Ms: 3.2,
72790
+ fps: 312,
72791
+ measured: true
72792
+ },
72793
+ "yolov9m-640": {
72794
+ p50Ms: 10.2,
72795
+ fps: 98,
72796
+ measured: true
72797
+ }
72798
+ } },
72799
+ "apple-m-base": { "apple-ane": {
72800
+ "yolov9t-320": {
72801
+ p50Ms: 1.32,
72802
+ fps: 758,
72803
+ measured: false
72804
+ },
72805
+ "yolov9t-640": {
72806
+ p50Ms: 3.45,
72807
+ fps: 290,
72808
+ measured: true
72809
+ },
72810
+ "yolov9s-320": {
72811
+ p50Ms: 1.8,
72812
+ fps: 556,
72813
+ measured: false
72814
+ },
72815
+ "yolov9s-640": {
72816
+ p50Ms: 5.46,
72817
+ fps: 183,
72818
+ measured: true
72819
+ },
72820
+ "yolov9m-320": {
72821
+ p50Ms: 3.79,
72822
+ fps: 264,
72823
+ measured: true
72824
+ },
72825
+ "yolov9m-640": {
72826
+ p50Ms: 10.34,
72827
+ fps: 97,
72828
+ measured: true
72829
+ }
72830
+ } }
72831
+ };
72832
+ var DETECTOR_ACCURACY = {
72833
+ "yolov9m-320": {
72834
+ personPrecision: .979,
72835
+ personRecall: .649
72836
+ },
72837
+ "yolov9m-320-int8": {
72838
+ personPrecision: .974,
72839
+ personRecall: .684
72840
+ },
72841
+ "yolov9m-640": {
72842
+ personPrecision: .976,
72843
+ personRecall: .854
72844
+ },
72845
+ "yolov9m-640-int8": {
72846
+ personPrecision: .976,
72847
+ personRecall: .847
72848
+ },
72849
+ "yolov9s-320": {
72850
+ personPrecision: .958,
72851
+ personRecall: .479
72852
+ },
72853
+ "yolov9s-320-int8": {
72854
+ personPrecision: .969,
72855
+ personRecall: .438
72856
+ },
72857
+ "yolov9s-640": {
72858
+ personPrecision: .986,
72859
+ personRecall: .753
72860
+ },
72861
+ "yolov9s-640-int8": {
72862
+ personPrecision: .963,
72863
+ personRecall: .823
72864
+ },
72865
+ "yolov9t-320": {
72866
+ personPrecision: .946,
72867
+ personRecall: .368
72868
+ },
72869
+ "yolov9t-320-int8": {
72870
+ personPrecision: .943,
72871
+ personRecall: .347
72872
+ },
72873
+ "yolov9t-640": {
72874
+ personPrecision: .979,
72875
+ personRecall: .646
72876
+ },
72877
+ "yolov9t-640-int8": {
72878
+ personPrecision: .979,
72879
+ personRecall: .646
72880
+ }
72881
+ };
72882
+ //#endregion
72883
+ //#region src/pipeline/best-settings/demand.ts
72884
+ var DEFAULT_DEMAND_OPTIONS = {
72885
+ onMotionConcurrency: .25,
72886
+ onMotionMinConcurrent: 2
72887
+ };
72888
+ /** A full observation window. */
72889
+ var OBSERVATION_WINDOW_MS = 1440 * 60 * 1e3;
72890
+ function deviceId(nodeId, deviceKey) {
72891
+ return `${nodeId}\u0000${deviceKey}`;
72892
+ }
72893
+ function charges(load) {
72894
+ return load.mode !== "disabled" && load.runsPipelineRoot && load.fps > 0;
72895
+ }
72896
+ /** The highest `count` rates, summed. */
72897
+ function topRatesSum(rates, count) {
72898
+ return rates.toSorted((a, b) => b - a).slice(0, Math.max(0, count)).reduce((sum, r) => sum + r, 0);
72899
+ }
72900
+ /** Concurrent on-motion sessions assumed cluster-wide without an observation. */
72901
+ function estimatedConcurrentSessions(cameraCount, options) {
72902
+ if (cameraCount <= 0) return 0;
72903
+ const share = Math.ceil(options.onMotionConcurrency * cameraCount);
72904
+ return Math.min(cameraCount, Math.max(share, Math.min(cameraCount, options.onMotionMinConcurrent)));
72905
+ }
72906
+ /**
72907
+ * Demand on every eligible device of the cluster.
72908
+ */
72909
+ function estimateDeviceDemand(input) {
72910
+ const options = input.options ?? DEFAULT_DEMAND_OPTIONS;
72911
+ const placement = input.shares ? "share" : "least-loaded";
72912
+ const eligibleById = new Map(input.eligible.map((d) => [deviceId(d.nodeId, d.deviceKey), d]));
72913
+ const peakById = new Map(input.peaks.map((p) => [deviceId(p.nodeId, p.deviceKey), p]));
72914
+ const weightByNode = /* @__PURE__ */ new Map();
72915
+ const eligibleCountByNode = /* @__PURE__ */ new Map();
72916
+ for (const d of input.eligible) {
72917
+ weightByNode.set(d.nodeId, (weightByNode.get(d.nodeId) ?? 0) + Math.max(d.weight, 0));
72918
+ eligibleCountByNode.set(d.nodeId, (eligibleCountByNode.get(d.nodeId) ?? 0) + 1);
72919
+ }
72920
+ const pinnedFps = /* @__PURE__ */ new Map();
72921
+ const alwaysOnFps = /* @__PURE__ */ new Map();
72922
+ const alwaysOnCount = /* @__PURE__ */ new Map();
72923
+ const maxFps = /* @__PURE__ */ new Map();
72924
+ const onMotionRates = [];
72925
+ const bump = (map, key, by) => {
72926
+ map.set(key, (map.get(key) ?? 0) + by);
72927
+ };
72928
+ const noteMax = (key, fps) => {
72929
+ maxFps.set(key, Math.max(maxFps.get(key) ?? 0, fps));
72930
+ };
72931
+ const pinNodeOf = (pin) => {
72932
+ if (pin.nodeId !== null) return pin.nodeId;
72933
+ const holders = input.eligible.filter((d) => d.deviceKey === pin.deviceKey);
72934
+ return holders.length === 1 ? holders[0].nodeId : null;
72935
+ };
72936
+ let alwaysOnTotal = 0;
72937
+ for (const cam of input.cameras) {
72938
+ if (!charges(cam)) continue;
72939
+ const pinNode = cam.devicePin !== null ? pinNodeOf(cam.devicePin) : null;
72940
+ if (cam.devicePin !== null && pinNode !== null) {
72941
+ const key = deviceId(pinNode, cam.devicePin.deviceKey);
72942
+ if (!eligibleById.has(key)) continue;
72943
+ bump(pinnedFps, key, cam.fps);
72944
+ noteMax(key, cam.fps);
72945
+ continue;
72946
+ }
72947
+ const standing = cam.mode === "always-on" && cam.standingNodeId !== null ? cam.standingNodeId : cam.nodePinId;
72948
+ if (standing !== null) {
72949
+ if (cam.mode === "always-on") alwaysOnTotal += 1;
72950
+ const nodeWeight = weightByNode.get(standing) ?? 0;
72951
+ for (const d of input.eligible) {
72952
+ if (d.nodeId !== standing || nodeWeight <= 0) continue;
72953
+ const key = deviceId(d.nodeId, d.deviceKey);
72954
+ const share = Math.max(d.weight, 0) / nodeWeight;
72955
+ bump(alwaysOnFps, key, cam.fps * share);
72956
+ bump(alwaysOnCount, key, share);
72957
+ noteMax(key, cam.fps);
72958
+ }
72959
+ continue;
72960
+ }
72961
+ onMotionRates.push(cam.fps);
72962
+ }
72963
+ const fastestOnMotion = onMotionRates.reduce((m, r) => Math.max(m, r), 0);
72964
+ const nodeCount = weightByNode.size;
72965
+ const estimatedTotal = estimatedConcurrentSessions(onMotionRates.length, options);
72966
+ const clusterPeak = input.shares?.clusterPeak ?? null;
72967
+ const clusterObserved = clusterPeak !== null && clusterPeak.observedForMs >= 864e5;
72968
+ const clusterSessions = clusterObserved ? Math.max(0, clusterPeak.peakSessions - alwaysOnTotal) : estimatedTotal;
72969
+ const shareSum = [...weightByNode.keys()].reduce((sum, nodeId) => sum + Math.max(input.shares?.nodes[nodeId] ?? 0, 0), 0);
72970
+ return input.eligible.map((d) => {
72971
+ const key = deviceId(d.nodeId, d.deviceKey);
72972
+ const peak = peakById.get(key) ?? (eligibleCountByNode.get(d.nodeId) === 1 ? peakById.get(deviceId(d.nodeId, "")) : void 0);
72973
+ const alwaysOn = alwaysOnCount.get(key) ?? 0;
72974
+ let onMotionSessions = 0;
72975
+ let onMotionSource = "none";
72976
+ if (onMotionRates.length > 0 && input.shares !== void 0) {
72977
+ const nodeWeight = weightByNode.get(d.nodeId) ?? 0;
72978
+ const nodeShare = shareSum > 0 ? Math.max(input.shares.nodes[d.nodeId] ?? 0, 0) / shareSum : 0;
72979
+ const deviceShare = nodeWeight > 0 ? Math.max(d.weight, 0) / nodeWeight : 0;
72980
+ onMotionSessions = Math.max(0, Math.ceil(clusterSessions * nodeShare * deviceShare - 1e-9));
72981
+ onMotionSource = clusterObserved ? "observed-24h" : "estimate";
72982
+ } else if (onMotionRates.length > 0) if (peak !== void 0 && peak.observedForMs >= 864e5) {
72983
+ onMotionSessions = Math.max(0, Math.round(peak.peakSessions - alwaysOn));
72984
+ onMotionSource = "observed-24h";
72985
+ } else {
72986
+ const nodeWeight = weightByNode.get(d.nodeId) ?? 0;
72987
+ const share = nodeCount > 0 && nodeWeight > 0 ? Math.max(d.weight, 0) / nodeWeight / nodeCount : 0;
72988
+ onMotionSessions = Math.ceil(estimatedTotal * share);
72989
+ onMotionSource = "estimate";
72990
+ }
72991
+ const demandFps = (pinnedFps.get(key) ?? 0) + (alwaysOnFps.get(key) ?? 0) + topRatesSum(onMotionRates, onMotionSessions);
72992
+ return {
72993
+ nodeId: d.nodeId,
72994
+ deviceKey: d.deviceKey,
72995
+ demandFps: Math.round(demandFps * 100) / 100,
72996
+ maxCameraFps: Math.max(maxFps.get(key) ?? 0, fastestOnMotion),
72997
+ alwaysOnCameras: Math.round(alwaysOn * 100) / 100,
72998
+ onMotionSessions,
72999
+ onMotionSource,
73000
+ observedForMs: input.shares !== void 0 ? clusterPeak?.observedForMs ?? null : peak?.observedForMs ?? null,
73001
+ placement
73002
+ };
73003
+ }).toSorted((a, b) => a.nodeId === b.nodeId ? a.deviceKey.localeCompare(b.deviceKey) : a.nodeId.localeCompare(b.nodeId));
73004
+ }
73005
+ //#endregion
73006
+ //#region src/pipeline/best-settings/recommend.ts
73007
+ /** The family the cluster runs. */
73008
+ var BEST_SETTINGS_FAMILY = "yolov9";
73009
+ /** Recall within this of the best counts as a tie — the faster one wins. */
73010
+ var RECALL_TIE = .02;
73011
+ /** Default share of an accelerator's throughput kept free. */
73012
+ var DEFAULT_HEADROOM = .4;
73013
+ function round(value, digits = 3) {
73014
+ const f = 10 ** digits;
73015
+ return Math.round(value * f) / f;
73016
+ }
73017
+ function utilisationOf(cell, demand) {
73018
+ return cell.fps > 0 ? round((demand?.demandFps ?? 0) / cell.fps) : Number.POSITIVE_INFINITY;
73019
+ }
73020
+ function fitsOn(cell, demand, headroom) {
73021
+ const budget = cell.fps * (1 - headroom);
73022
+ return budget >= (demand?.demandFps ?? 0) && budget >= (demand?.maxCameraFps ?? 0);
73023
+ }
73024
+ function candidatesFor(contexts, formatsByModel) {
73025
+ return Object.keys(DETECTOR_ACCURACY).filter((id) => id.startsWith(BEST_SETTINGS_FAMILY)).filter((id) => contexts.every((c) => c.column[id] !== void 0 && (formatsByModel[id] ?? []).includes(c.device.format))).map((id) => ({
73026
+ modelId: id,
73027
+ personRecall: DETECTOR_ACCURACY[id]?.personRecall ?? 0
73028
+ })).toSorted((a, b) => b.personRecall - a.personRecall || a.modelId.localeCompare(b.modelId));
73029
+ }
73030
+ function totalLatency(contexts, modelId) {
73031
+ return contexts.reduce((sum, c) => sum + (c.column[modelId]?.p50Ms ?? Number.POSITIVE_INFINITY), 0);
73032
+ }
73033
+ function worstUtilisation(contexts, modelId) {
73034
+ return contexts.reduce((worst, c) => {
73035
+ const cell = c.column[modelId];
73036
+ return Math.max(worst, cell ? utilisationOf(cell, c.demand) : Number.POSITIVE_INFINITY);
73037
+ }, 0);
73038
+ }
73039
+ /** One model for a group of devices that must agree (step 2–4 of the header). */
73040
+ function pickForGroup(contexts, formatsByModel, headroom) {
73041
+ const candidates = candidatesFor(contexts, formatsByModel);
73042
+ if (candidates.length === 0) return null;
73043
+ const fitting = candidates.filter((c) => contexts.every((ctx) => {
73044
+ const cell = ctx.column[c.modelId];
73045
+ return cell !== void 0 && fitsOn(cell, ctx.demand, headroom);
73046
+ }));
73047
+ if (fitting.length === 0) {
73048
+ const lightest = candidates.toSorted((a, b) => worstUtilisation(contexts, a.modelId) - worstUtilisation(contexts, b.modelId))[0];
73049
+ if (lightest === void 0) return null;
73050
+ return {
73051
+ modelId: lightest.modelId,
73052
+ reasons: [{
73053
+ kind: "no-fit-lightest",
73054
+ utilisation: worstUtilisation(contexts, lightest.modelId)
73055
+ }]
73056
+ };
73057
+ }
73058
+ const best = fitting[0];
73059
+ if (best === void 0) return null;
73060
+ const chosen = fitting.filter((c) => best.personRecall - c.personRecall <= .02).toSorted((a, b) => totalLatency(contexts, a.modelId) - totalLatency(contexts, b.modelId) || b.personRecall - a.personRecall)[0] ?? best;
73061
+ const reasons = [];
73062
+ const mostAccurate = candidates[0];
73063
+ if (mostAccurate !== void 0 && mostAccurate.modelId !== best.modelId) {
73064
+ const limitedBy = contexts.find((ctx) => {
73065
+ const cell = ctx.column[mostAccurate.modelId];
73066
+ return cell === void 0 || !fitsOn(cell, ctx.demand, headroom);
73067
+ })?.device.key ?? "";
73068
+ reasons.push({
73069
+ kind: "stepped-down",
73070
+ from: mostAccurate.modelId,
73071
+ to: best.modelId,
73072
+ limitedBy
73073
+ });
73074
+ }
73075
+ if (chosen.modelId !== best.modelId) reasons.push({
73076
+ kind: "tie-faster",
73077
+ over: best.modelId,
73078
+ recallDelta: round(best.personRecall - chosen.personRecall)
73079
+ });
73080
+ return {
73081
+ modelId: chosen.modelId,
73082
+ reasons
73083
+ };
73084
+ }
73085
+ function choiceOn(ctx, modelId) {
73086
+ const cell = ctx.column[modelId];
73087
+ if (cell === void 0) return null;
73088
+ return {
73089
+ modelId,
73090
+ p50Ms: cell.p50Ms,
73091
+ fps: cell.fps,
73092
+ measured: cell.measured,
73093
+ utilisation: utilisationOf(cell, ctx.demand),
73094
+ personRecall: DETECTOR_ACCURACY[modelId]?.personRecall ?? 0
73095
+ };
73096
+ }
73097
+ function deviceReasonsFor(ctx, choice) {
73098
+ const out = [{
73099
+ kind: "fits",
73100
+ utilisation: choice.utilisation
73101
+ }];
73102
+ if (!choice.measured) out.push({
73103
+ kind: "derived-latency",
73104
+ modelId: choice.modelId
73105
+ });
73106
+ if (ctx.demand?.onMotionSource === "estimate") out.push({
73107
+ kind: "estimated-load",
73108
+ observedForMs: ctx.demand.observedForMs
73109
+ });
73110
+ return out;
73111
+ }
73112
+ function skippedNode(node, reason, hardwareClass) {
73113
+ return {
73114
+ nodeId: node.nodeId,
73115
+ reachable: node.reachable,
73116
+ hardwareClass,
73117
+ cpuModel: node.hardware?.cpuModel ?? null,
73118
+ skipped: true,
73119
+ acceleratorModelId: null,
73120
+ devices: node.devices.map((d) => ({
73121
+ deviceKey: d.key,
73122
+ accelerator: node.hardware ? acceleratorKindOf(d.key, node.hardware) : null,
73123
+ enabled: d.enabled,
73124
+ available: d.available,
73125
+ demand: null,
73126
+ chosen: null,
73127
+ reasons: []
73128
+ })),
73129
+ reasons: [reason]
73130
+ };
73131
+ }
73132
+ /** Recommend one node. See the module header. */
73133
+ function recommendNode(input) {
73134
+ const { node } = input;
73135
+ const headroom = input.headroom ?? .4;
73136
+ const perf = input.perf ?? DETECTOR_PERF;
73137
+ if (!node.reachable) return skippedNode(node, { kind: "node-offline" }, null);
73138
+ if (node.hardware === null) return skippedNode(node, { kind: "no-hardware-facts" }, null);
73139
+ const hardware = node.hardware;
73140
+ const { hardwareClass, cpuModel } = classifyInferenceHardware(hardware);
73141
+ const classTable = perf[hardwareClass];
73142
+ if (hardwareClass === "unknown" || classTable === void 0) return skippedNode(node, {
73143
+ kind: "no-measured-data",
73144
+ hardwareClass
73145
+ }, hardwareClass);
73146
+ const demandByKey = new Map(input.demand.filter((d) => d.nodeId === node.nodeId).map((d) => [d.deviceKey, d]));
73147
+ const devices = node.devices.toSorted((a, b) => a.key.localeCompare(b.key));
73148
+ const contexts = /* @__PURE__ */ new Map();
73149
+ const early = /* @__PURE__ */ new Map();
73150
+ for (const device of devices) {
73151
+ const accelerator = acceleratorKindOf(device.key, hardware);
73152
+ if (accelerator === "coral") {
73153
+ early.set(device.key, device.enabled ? [{ kind: "coral-untouched" }] : []);
73154
+ continue;
73155
+ }
73156
+ if (!device.enabled) {
73157
+ early.set(device.key, [{ kind: "device-disabled" }]);
73158
+ continue;
73159
+ }
73160
+ if (!device.available) {
73161
+ early.set(device.key, [{ kind: "device-unavailable" }]);
73162
+ continue;
73163
+ }
73164
+ const column = accelerator === null ? void 0 : classTable[accelerator];
73165
+ if (accelerator === null || column === void 0) {
73166
+ early.set(device.key, [{
73167
+ kind: "no-family-build",
73168
+ format: device.format
73169
+ }]);
73170
+ continue;
73171
+ }
73172
+ contexts.set(device.key, {
73173
+ device,
73174
+ accelerator,
73175
+ column,
73176
+ demand: demandByKey.get(device.key) ?? null
73177
+ });
73178
+ }
73179
+ const isCpu = (a) => a === "x86-cpu" || a === "arm-cpu";
73180
+ const accelerators = [...contexts.values()].filter((c) => !isCpu(c.accelerator));
73181
+ const cpus = [...contexts.values()].filter((c) => isCpu(c.accelerator));
73182
+ const chosenByKey = /* @__PURE__ */ new Map();
73183
+ const reasonsByKey = /* @__PURE__ */ new Map();
73184
+ const nodeReasons = [];
73185
+ let acceleratorModelId = null;
73186
+ const groupPick = accelerators.length > 0 ? pickForGroup(accelerators, node.formatsByModel, headroom) : null;
73187
+ if (groupPick !== null) {
73188
+ acceleratorModelId = groupPick.modelId;
73189
+ nodeReasons.push(...groupPick.reasons);
73190
+ for (const ctx of accelerators) {
73191
+ const choice = choiceOn(ctx, groupPick.modelId);
73192
+ if (choice === null) continue;
73193
+ chosenByKey.set(ctx.device.key, choice);
73194
+ reasonsByKey.set(ctx.device.key, deviceReasonsFor(ctx, choice));
73195
+ }
73196
+ } else for (const ctx of accelerators) reasonsByKey.set(ctx.device.key, [{
73197
+ kind: "no-family-build",
73198
+ format: ctx.device.format
73199
+ }]);
73200
+ for (const ctx of cpus) {
73201
+ const pick = pickForGroup([ctx], node.formatsByModel, headroom);
73202
+ const choice = pick === null ? null : choiceOn(ctx, pick.modelId);
73203
+ if (pick === null || choice === null) {
73204
+ reasonsByKey.set(ctx.device.key, [{
73205
+ kind: "no-family-build",
73206
+ format: ctx.device.format
73207
+ }]);
73208
+ continue;
73209
+ }
73210
+ chosenByKey.set(ctx.device.key, choice);
73211
+ reasonsByKey.set(ctx.device.key, [
73212
+ { kind: "cpu-device" },
73213
+ ...pick.reasons,
73214
+ ...deviceReasonsFor(ctx, choice)
73215
+ ]);
73216
+ }
73217
+ return {
73218
+ nodeId: node.nodeId,
73219
+ reachable: true,
73220
+ hardwareClass,
73221
+ cpuModel,
73222
+ skipped: chosenByKey.size === 0,
73223
+ acceleratorModelId,
73224
+ devices: devices.map((device) => ({
73225
+ deviceKey: device.key,
73226
+ accelerator: acceleratorKindOf(device.key, hardware),
73227
+ enabled: device.enabled,
73228
+ available: device.available,
73229
+ demand: demandByKey.get(device.key) ?? null,
73230
+ chosen: chosenByKey.get(device.key) ?? null,
73231
+ reasons: early.get(device.key) ?? reasonsByKey.get(device.key) ?? []
73232
+ })),
73233
+ reasons: nodeReasons
73234
+ };
73235
+ }
73236
+ //#endregion
73237
+ //#region src/pipeline/load-balancing/share-election.ts
73238
+ /** Deficits equal up to float noise (0.7 × 2 − 1 is 0.3999…, not 0.4). */
73239
+ var DEFICIT_EPSILON = 1e-9;
73240
+ function byDeficit(a, b) {
73241
+ const diff = b.deficit - a.deficit;
73242
+ return (Math.abs(diff) < DEFICIT_EPSILON ? 0 : diff) || b.candidate.share - a.candidate.share || a.candidate.key.localeCompare(b.candidate.key);
73243
+ }
73244
+ function spareOf(c) {
73245
+ return c.spare ?? Number.POSITIVE_INFINITY;
73246
+ }
73247
+ function electByShare(candidates) {
73248
+ if (candidates.length === 0) return { kind: "none" };
73249
+ const shareSum = candidates.reduce((s, c) => s + Math.max(c.share, 0), 0);
73250
+ const running = candidates.reduce((s, c) => s + Math.max(c.running, 0), 0);
73251
+ const scored = candidates.map((candidate) => ({
73252
+ candidate,
73253
+ deficit: (shareSum > 0 ? Math.max(candidate.share, 0) / shareSum : 1 / candidates.length) * (running + 1) - candidate.running
73254
+ })).toSorted(byDeficit);
73255
+ const turn = scored[0].candidate;
73256
+ if (!turn.capped && !turn.saturated) return {
73257
+ kind: "elected",
73258
+ key: turn.key,
73259
+ reason: "share"
73260
+ };
73261
+ const free = scored.filter((s) => !s.candidate.capped && !s.candidate.saturated).toSorted((a, b) => spareOf(b.candidate) - spareOf(a.candidate) || byDeficit(a, b));
73262
+ const yieldReason = turn.capped ? "at-cap" : "saturated";
73263
+ if (free.length > 0) return {
73264
+ kind: "elected",
73265
+ key: free[0].candidate.key,
73266
+ reason: "yield",
73267
+ turnKey: turn.key,
73268
+ yieldReason
73269
+ };
73270
+ const uncapped = scored.find((s) => !s.candidate.capped);
73271
+ if (uncapped === void 0) return { kind: "none" };
73272
+ return {
73273
+ kind: "elected",
73274
+ key: uncapped.candidate.key,
73275
+ reason: "share"
73276
+ };
73277
+ }
71972
73278
  //#endregion
71973
73279
  //#region src/pipeline/root-face-crop.ts
71974
73280
  /** Side of the square, as a multiple of the face box's longer side. */
@@ -74114,6 +75420,7 @@ exports.AUDIO_PRESETS = require_composition.AUDIO_PRESETS;
74114
75420
  exports.AUDIO_SCALE_EPOCH_ISO = AUDIO_SCALE_EPOCH_ISO;
74115
75421
  exports.AUDIO_SCALE_EPOCH_MS = AUDIO_SCALE_EPOCH_MS;
74116
75422
  exports.AUTOMATIC_HUB_ADDRESS_FLAGS = AUTOMATIC_HUB_ADDRESS_FLAGS;
75423
+ exports.AcceleratorKindSchema = AcceleratorKindSchema;
74117
75424
  exports.AccessoriesStatusSchema = AccessoriesStatusSchema;
74118
75425
  exports.AccessoryKind = AccessoryKind;
74119
75426
  exports.AddBrokerInputSchema = AddBrokerInputSchema;
@@ -74192,6 +75499,7 @@ exports.BASE_DEVICE_CAPS = BASE_DEVICE_CAPS;
74192
75499
  exports.BASE_LIVE_EGRESS_PROFILE = BASE_LIVE_EGRESS_PROFILE;
74193
75500
  exports.BATTERY_DEVICE_PROFILE = BATTERY_DEVICE_PROFILE;
74194
75501
  exports.BATTERY_UNREACHABLE_AFTER_MS = BATTERY_UNREACHABLE_AFTER_MS;
75502
+ exports.BEST_SETTINGS_FAMILY = BEST_SETTINGS_FAMILY;
74195
75503
  exports.BIRTH_DECISION_DEFAULT_LIMIT = BIRTH_DECISION_DEFAULT_LIMIT;
74196
75504
  exports.BOOT_RECOVERY_BACKOFF_MS = require_sleep.BOOT_RECOVERY_BACKOFF_MS;
74197
75505
  exports.BUILTIN_RESULT_KINDS = BUILTIN_RESULT_KINDS;
@@ -74207,6 +75515,12 @@ exports.BaseAddon = require_sleep.BaseAddon;
74207
75515
  exports.BaseDevice = BaseDevice;
74208
75516
  exports.BaseDeviceProvider = BaseDeviceProvider;
74209
75517
  exports.BatteryStatusSchema = BatteryStatusSchema;
75518
+ exports.BestSettingsApplyInputSchema = BestSettingsApplyInputSchema;
75519
+ exports.BestSettingsApplyResultSchema = BestSettingsApplyResultSchema;
75520
+ exports.BestSettingsOptionsSchema = BestSettingsOptionsSchema;
75521
+ exports.BestSettingsPhaseResultSchema = BestSettingsPhaseResultSchema;
75522
+ exports.BestSettingsPlanSchema = BestSettingsPlanSchema;
75523
+ exports.BestSettingsWarningSchema = BestSettingsWarningSchema;
74210
75524
  exports.BinaryStatusSchema = BinaryStatusSchema;
74211
75525
  exports.BirthDecisionQueryInputSchema = BirthDecisionQueryInputSchema;
74212
75526
  exports.BirthDecisionRecordSchema = BirthDecisionRecordSchema;
@@ -74309,6 +75623,7 @@ exports.CameraMetricsSchema = CameraMetricsSchema;
74309
75623
  exports.CameraMetricsWithDeviceIdSchema = CameraMetricsWithDeviceIdSchema;
74310
75624
  exports.CameraMotionStatusSchema = CameraMotionStatusSchema;
74311
75625
  exports.CameraOccupancySnapshotForDeviceSchema = CameraOccupancySnapshotForDeviceSchema;
75626
+ exports.CameraOverrideClearSchema = CameraOverrideClearSchema;
74312
75627
  exports.CameraOwnMotionSchema = CameraOwnMotionSchema;
74313
75628
  exports.CameraRawLevelSchema = CameraRawLevelSchema;
74314
75629
  exports.CameraRecordingModeSchema = CameraRecordingModeSchema;
@@ -74466,11 +75781,13 @@ exports.DEFAULT_CLUSTER_STEP_MODELS = DEFAULT_CLUSTER_STEP_MODELS;
74466
75781
  exports.DEFAULT_CLUSTER_STEP_SETTINGS = DEFAULT_CLUSTER_STEP_SETTINGS;
74467
75782
  exports.DEFAULT_CORE_BLOCK_ENTRY = DEFAULT_CORE_BLOCK_ENTRY;
74468
75783
  exports.DEFAULT_DECODER_HWACCEL_CONFIG = DEFAULT_DECODER_HWACCEL_CONFIG;
75784
+ exports.DEFAULT_DEMAND_OPTIONS = DEFAULT_DEMAND_OPTIONS;
74469
75785
  exports.DEFAULT_DETAIL_CROP_CONVENTION = DEFAULT_DETAIL_CROP_CONVENTION;
74470
75786
  exports.DEFAULT_EVENTS_BAND_BUFFER_SEC = DEFAULT_EVENTS_BAND_BUFFER_SEC;
74471
75787
  exports.DEFAULT_EVENT_COLOR = DEFAULT_EVENT_COLOR;
74472
75788
  exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
74473
75789
  exports.DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = require_composition.DEFAULT_FIRST_SIGHTING_FRESHNESS_MS;
75790
+ exports.DEFAULT_HEADROOM = DEFAULT_HEADROOM;
74474
75791
  exports.DEFAULT_MIN_LANDMARK_FACE_SIZE_PX = DEFAULT_MIN_LANDMARK_FACE_SIZE_PX;
74475
75792
  exports.DEFAULT_NATIVE_LEASE_SETTINGS = DEFAULT_NATIVE_LEASE_SETTINGS;
74476
75793
  exports.DEFAULT_OVERLAY_LAYERS = DEFAULT_OVERLAY_LAYERS;
@@ -74478,6 +75795,7 @@ exports.DEFAULT_POOL_MEMORY_POLICY = DEFAULT_POOL_MEMORY_POLICY;
74478
75795
  exports.DEFAULT_RECORDING_PROFILES = DEFAULT_RECORDING_PROFILES;
74479
75796
  exports.DEFAULT_RETENTION = DEFAULT_RETENTION;
74480
75797
  exports.DEFAULT_RUNTIME_STATE_DURABILITY = require_sleep.DEFAULT_RUNTIME_STATE_DURABILITY;
75798
+ exports.DEFAULT_SESSION_PLACEMENT_POLICY = DEFAULT_SESSION_PLACEMENT_POLICY;
74481
75799
  exports.DEFAULT_TIMELAPSE_PREVIEW_TEXT = DEFAULT_TIMELAPSE_PREVIEW_TEXT;
74482
75800
  exports.DEFAULT_TOKEN_EXPIRY = DEFAULT_TOKEN_EXPIRY;
74483
75801
  exports.DERIVED_CAMERA_SILENCED_CAP_NAMES = DERIVED_CAMERA_SILENCED_CAP_NAMES;
@@ -74487,6 +75805,8 @@ exports.DETAIL_CROP_SECTION_ID = DETAIL_CROP_SECTION_ID;
74487
75805
  exports.DETAIL_CROP_SQUARE_KEY = DETAIL_CROP_SQUARE_KEY;
74488
75806
  exports.DETECTION_MACRO_CLASSES = DETECTION_MACRO_CLASSES;
74489
75807
  exports.DETECTION_PIPELINE_CAP_NAME = DETECTION_PIPELINE_CAP_NAME;
75808
+ exports.DETECTOR_ACCURACY = DETECTOR_ACCURACY;
75809
+ exports.DETECTOR_PERF = DETECTOR_PERF;
74490
75810
  exports.DEVICE_BACKEND_TO_FORMAT = DEVICE_BACKEND_TO_FORMAT;
74491
75811
  exports.DEVICE_CAP_NAMES = DEVICE_CAP_NAMES;
74492
75812
  exports.DEVICE_CHILDREN_BATCH_MAX = require_sleep.DEVICE_CHILDREN_BATCH_MAX;
@@ -74524,16 +75844,20 @@ exports.DetailCropConventionSchema = DetailCropConventionSchema;
74524
75844
  exports.DetectionCatalogClassMapSchema = DetectionCatalogClassMapSchema;
74525
75845
  exports.DetectionSourceSchema = DetectionSourceSchema;
74526
75846
  exports.DetectionSourcesSchema = DetectionSourcesSchema;
75847
+ exports.DetectorStoreClearSchema = DetectorStoreClearSchema;
74527
75848
  exports.DeviceAdminLinkSchema = DeviceAdminLinkSchema;
74528
75849
  exports.DeviceCodeSeveritySchema = DeviceCodeSeveritySchema;
74529
75850
  exports.DeviceConfig = DeviceConfig;
75851
+ exports.DeviceDemandSchema = DeviceDemandSchema;
74530
75852
  exports.DeviceDiscoveryStatusSchema = DeviceDiscoveryStatusSchema;
74531
75853
  exports.DeviceExportExposeInputSchema = ExposeInputSchema;
74532
75854
  exports.DeviceExportStatusSchema = DeviceExportStatusSchema;
74533
75855
  exports.DeviceExportUnexposeInputSchema = UnexposeInputSchema;
74534
75856
  exports.DeviceFeature = require_err_msg.DeviceFeature;
74535
75857
  exports.DeviceInfoSchema = DeviceInfoSchema;
75858
+ exports.DeviceModelChoiceSchema = DeviceModelChoiceSchema;
74536
75859
  exports.DeviceNetworkStatsSchema = DeviceNetworkStatsSchema;
75860
+ exports.DeviceRecommendationSchema = DeviceRecommendationSchema;
74537
75861
  exports.DeviceRestoreRetryScheduler = DeviceRestoreRetryScheduler;
74538
75862
  exports.DeviceRole = require_err_msg.DeviceRole;
74539
75863
  exports.DeviceRuntimeState = DeviceRuntimeState;
@@ -74686,6 +76010,7 @@ exports.HOURS_PER_DAY = HOURS_PER_DAY;
74686
76010
  exports.HUB_ADDRESS_ROLES = HUB_ADDRESS_ROLES;
74687
76011
  exports.HUB_VIEWER_MOUNT = HUB_VIEWER_MOUNT;
74688
76012
  exports.HWACCEL_OPTIONS = HWACCEL_OPTIONS;
76013
+ exports.HardwareClassIdSchema = HardwareClassIdSchema;
74689
76014
  exports.HealthStatusSchema = HealthStatusSchema;
74690
76015
  exports.HfModelResolutionSchema = HfModelResolutionSchema;
74691
76016
  exports.HistoryPointSchema = HistoryPointSchema;
@@ -74767,6 +76092,7 @@ exports.LlmRuntimeStatusSchema = LlmRuntimeStatusSchema;
74767
76092
  exports.LlmTimeoutDefaults = LlmTimeoutDefaults;
74768
76093
  exports.LlmUsageRollupSchema = LlmUsageRollupSchema;
74769
76094
  exports.LlmUsageSchema = LlmUsageSchema;
76095
+ exports.LoadBalancingSharesInputSchema = LoadBalancingSharesInputSchema;
74770
76096
  exports.LoadContributionSchema = LoadContributionSchema;
74771
76097
  exports.LocateSegmentResultSchema = LocateSegmentResultSchema;
74772
76098
  exports.LocationDescriptionAssignmentSchema = LocationDescriptionAssignmentSchema;
@@ -74868,8 +76194,11 @@ exports.ModelDistributeInputSchema = ModelDistributeInputSchema;
74868
76194
  exports.ModelDistributeResultSchema = ModelDistributeResultSchema;
74869
76195
  exports.ModelExtraFileSchema = ModelExtraFileSchema;
74870
76196
  exports.ModelFormatEntrySchema = ModelFormatEntrySchema;
76197
+ exports.ModelFormatPrecisionSchema = ModelFormatPrecisionSchema;
74871
76198
  exports.ModelFormatsSchema = ModelFormatsSchema;
74872
76199
  exports.ModelLicenseSchema = ModelLicenseSchema;
76200
+ exports.ModelOnDiskStateSchema = ModelOnDiskStateSchema;
76201
+ exports.ModelPinChangeSchema = ModelPinChangeSchema;
74873
76202
  exports.ModelProviderIdSchema = ModelProviderIdSchema;
74874
76203
  exports.ModelSubstitutionSchema = ModelSubstitutionSchema;
74875
76204
  exports.ModelVariantGroupSchema = ModelVariantGroupSchema;
@@ -75106,14 +76435,17 @@ exports.NetworkAccessStatusSchema = NetworkAccessStatusSchema;
75106
76435
  exports.NetworkAddressSchema = NetworkAddressSchema;
75107
76436
  exports.NetworkEndpointSchema = NetworkEndpointSchema;
75108
76437
  exports.NetworkLinkStatusSchema = NetworkLinkStatusSchema;
76438
+ exports.NodeDeviceChangeSchema = NodeDeviceChangeSchema;
75109
76439
  exports.NodeDirectoryEntrySchema = NodeDirectoryEntrySchema;
75110
76440
  exports.NodeDirectorySchema = NodeDirectorySchema;
76441
+ exports.NodeRecommendationSchema = NodeRecommendationSchema;
75111
76442
  exports.NotificationActionIconSchema = NotificationActionIconSchema;
75112
76443
  exports.NotificationActionSchema = NotificationActionSchema;
75113
76444
  exports.NotificationFormatSchema = NotificationFormatSchema;
75114
76445
  exports.NotificationSchema = NotificationSchema;
75115
76446
  exports.NotifierStatusSchema = NotifierStatusSchema;
75116
76447
  exports.NumericSensorStatusSchema = NumericSensorStatusSchema;
76448
+ exports.OBSERVATION_WINDOW_MS = OBSERVATION_WINDOW_MS;
75117
76449
  exports.OPERATOR_WRITTEN_STALE_MS = OPERATOR_WRITTEN_STALE_MS;
75118
76450
  exports.OPS_LOG_DEFAULT_LIMIT = OPS_LOG_DEFAULT_LIMIT;
75119
76451
  exports.OPS_LOG_RING_DEFAULT_MAX = OPS_LOG_RING_DEFAULT_MAX;
@@ -75187,11 +76519,16 @@ exports.PickedCamStreamSchema = PickedCamStreamSchema;
75187
76519
  exports.PipelineAssignmentSchema = PipelineAssignmentSchema;
75188
76520
  exports.PipelineDefaultStepSchema = PipelineDefaultStepSchema;
75189
76521
  exports.PipelineEngineChoiceSchema = PipelineEngineChoiceSchema;
76522
+ exports.PipelineModelFormatStatusSchema = PipelineModelFormatStatusSchema;
75190
76523
  exports.PipelineRunResultBridge = PipelineRunResultBridge;
75191
76524
  exports.PipelineStepInputSchema = PipelineStepInputSchema;
75192
76525
  exports.PipelineValidationIssueSchema = PipelineValidationIssueSchema;
75193
76526
  exports.PipelineValidationResultSchema = PipelineValidationResultSchema;
75194
76527
  exports.PlaceholderReasonSchema = PlaceholderReasonSchema;
76528
+ exports.PlacementDeviceStatsSchema = PlacementDeviceStatsSchema;
76529
+ exports.PlacementNodeStatsSchema = PlacementNodeStatsSchema;
76530
+ exports.PlacementStatsInputSchema = PlacementStatsInputSchema;
76531
+ exports.PlacementStatsSchema = PlacementStatsSchema;
75195
76532
  exports.PolygonPointSchema = PolygonPointSchema;
75196
76533
  exports.PoolMemoryWatchdog = PoolMemoryWatchdog;
75197
76534
  exports.PowerMeterStatusSchema = PowerMeterStatusSchema;
@@ -75226,6 +76563,7 @@ exports.RATE_CONTROL_TIGHT = RATE_CONTROL_TIGHT;
75226
76563
  exports.REACHABILITY_FAILURES_TO_OFFLINE = REACHABILITY_FAILURES_TO_OFFLINE;
75227
76564
  exports.REACHABILITY_POLL_INTERVAL_MS = REACHABILITY_POLL_INTERVAL_MS;
75228
76565
  exports.REACHABILITY_PROBE_TIMEOUT_MS = REACHABILITY_PROBE_TIMEOUT_MS;
76566
+ exports.RECALL_TIE = RECALL_TIE;
75229
76567
  exports.RECOGNITION_TYPES = RECOGNITION_TYPES;
75230
76568
  exports.RECORDING_AUDIO_TRIGGER_OFFERED_DBFS = RECORDING_AUDIO_TRIGGER_OFFERED_DBFS;
75231
76569
  exports.RECORDING_EXPORT_MAX_READ_BYTES = RECORDING_EXPORT_MAX_READ_BYTES;
@@ -75258,6 +76596,7 @@ exports.ReadinessTimeoutError = require_sleep.ReadinessTimeoutError;
75258
76596
  exports.RebuildObjectEmbeddingsRefusalSchema = RebuildObjectEmbeddingsRefusalSchema;
75259
76597
  exports.RecentTracksPageSchema = RecentTracksPageSchema;
75260
76598
  exports.RecentTracksQueryInput = RecentTracksQueryInput;
76599
+ exports.RecommendationReasonSchema = RecommendationReasonSchema;
75261
76600
  exports.RecordTriggerSchema = RecordTriggerSchema;
75262
76601
  exports.RecordWindowSchema = RecordWindowSchema;
75263
76602
  exports.RecordingAvailabilityForDeviceSchema = RecordingAvailabilityForDeviceSchema;
@@ -75352,6 +76691,7 @@ exports.SCENE_RESET_RECAPTURES = SCENE_RESET_RECAPTURES;
75352
76691
  exports.SCOPE_PRESETS = SCOPE_PRESETS;
75353
76692
  exports.SENSOR_FEATURES = SENSOR_FEATURES;
75354
76693
  exports.SENSOR_MAP = SENSOR_MAP;
76694
+ exports.SESSION_PLACEMENT_SETTING_KEY = SESSION_PLACEMENT_SETTING_KEY;
75355
76695
  exports.SHARE_VIEW_KINDS = require_sleep.SHARE_VIEW_KINDS;
75356
76696
  exports.SINGLE_HUB_ADDRESS_ROLES = SINGLE_HUB_ADDRESS_ROLES;
75357
76697
  exports.SOURCE_CAPS = require_composition.SOURCE_CAPS;
@@ -75397,6 +76737,7 @@ exports.ServerUpdateActionResultSchema = ServerUpdateActionResultSchema;
75397
76737
  exports.ServerUpdateCheckResultSchema = ServerUpdateCheckResultSchema;
75398
76738
  exports.ServerUpdateOutcomeSchema = ServerUpdateOutcomeSchema;
75399
76739
  exports.ServerUpdateStateSchema = ServerUpdateStateSchema;
76740
+ exports.SessionPlacementPolicySchema = SessionPlacementPolicySchema;
75400
76741
  exports.SessionTriggerSchema = SessionTriggerSchema;
75401
76742
  exports.SetCameraSensorsInputSchema = SetCameraSensorsInputSchema;
75402
76743
  exports.SetLoggingSettingsInputSchema = SetLoggingSettingsInputSchema;
@@ -75419,6 +76760,7 @@ exports.SnapshotImageSchema = SnapshotImageSchema;
75419
76760
  exports.SourceInfoSchema = SourceInfoSchema;
75420
76761
  exports.SpatialDetectionSchema = SpatialDetectionSchema;
75421
76762
  exports.SsoBridgeClaimsSchema = SsoBridgeClaimsSchema;
76763
+ exports.StaleDevicePinSchema = StaleDevicePinSchema;
75422
76764
  exports.StartEmbeddedInputSchema = StartEmbeddedInputSchema;
75423
76765
  exports.StationaryObjectSchema = StationaryObjectSchema;
75424
76766
  exports.StorageAbortUploadInputSchema = AbortUploadInputSchema;
@@ -75482,6 +76824,10 @@ exports.SubscribeAudioChunksInputSchema = require_sleep.SubscribeAudioChunksInpu
75482
76824
  exports.SubscribeAudioChunksResultSchema = require_sleep.SubscribeAudioChunksResultSchema;
75483
76825
  exports.SubscribeFramesInputSchema = require_sleep.SubscribeFramesInputSchema;
75484
76826
  exports.SubscribeFramesResultSchema = require_sleep.SubscribeFramesResultSchema;
76827
+ exports.SuggestSharesInputSchema = SuggestSharesInputSchema;
76828
+ exports.SuggestSharesResultSchema = SuggestSharesResultSchema;
76829
+ exports.SuggestedDeviceShareSchema = SuggestedDeviceShareSchema;
76830
+ exports.SuggestedNodeShareSchema = SuggestedNodeShareSchema;
75485
76831
  exports.SuppliedRootOutputSchema = SuppliedRootOutputSchema;
75486
76832
  exports.SwitchStatusSchema = SwitchStatusSchema;
75487
76833
  exports.SystemMetricsSchema = SystemMetricsSchema;
@@ -75613,6 +76959,7 @@ exports.ZoneRulesArraySchema = ZoneRulesArraySchema;
75613
76959
  exports.ZoneSchema = ZoneSchema;
75614
76960
  exports.ZoneScopeBreakdownSchema = ZoneScopeBreakdownSchema;
75615
76961
  exports.__resetLogChannelRegistryForTests = __resetLogChannelRegistryForTests;
76962
+ exports.acceleratorKindOf = acceleratorKindOf;
75616
76963
  exports.accessoriesCapability = accessoriesCapability;
75617
76964
  exports.accessoryStableId = accessoryStableId;
75618
76965
  exports.actionsForBoundCaps = actionsForBoundCaps;
@@ -75704,6 +77051,7 @@ exports.carbonMonoxideCapability = carbonMonoxideCapability;
75704
77051
  exports.cellsToRects = cellsToRects;
75705
77052
  exports.checkRoleAddress = checkRoleAddress;
75706
77053
  exports.classifyBearerPrincipal = classifyBearerPrincipal;
77054
+ exports.classifyInferenceHardware = classifyInferenceHardware;
75707
77055
  exports.classifyStream = classifyStream;
75708
77056
  exports.classifyStreams = classifyStreams;
75709
77057
  exports.clearModelBoundOverrides = clearModelBoundOverrides;
@@ -75720,6 +77068,7 @@ exports.clusterStepSettingKey = clusterStepSettingKey;
75720
77068
  exports.codecIsAccepted = codecIsAccepted;
75721
77069
  exports.collectHydratedFieldEntries = require_sleep.collectHydratedFieldEntries;
75722
77070
  exports.collectHydratedFieldValues = require_sleep.collectHydratedFieldValues;
77071
+ exports.collectModelBoundKeys = collectModelBoundKeys;
75723
77072
  exports.collectSecretConfigKeys = collectSecretConfigKeys;
75724
77073
  exports.colorCapability = colorCapability;
75725
77074
  exports.colorForKind = colorForKind;
@@ -75834,6 +77183,7 @@ exports.doorbellFeatureSources = doorbellFeatureSources;
75834
77183
  exports.droppedConditionsForKind = droppedConditionsForKind;
75835
77184
  exports.egressTranscodeSharingKey = egressTranscodeSharingKey;
75836
77185
  exports.egressTransportFromRequest = egressTransportFromRequest;
77186
+ exports.electByShare = electByShare;
75837
77187
  exports.embeddingEncoderCapability = embeddingEncoderCapability;
75838
77188
  exports.embeddingModelFailedError = embeddingModelFailedError;
75839
77189
  exports.embeddingModelFailedOf = embeddingModelFailedOf;
@@ -75851,6 +77201,8 @@ exports.enumerateInferenceDevices = enumerateInferenceDevices;
75851
77201
  exports.enumerateItemArrayFields = enumerateItemArrayFields;
75852
77202
  exports.enumerateSchemaFields = enumerateSchemaFields;
75853
77203
  exports.errMsg = require_err_msg.errMsg;
77204
+ exports.estimateDeviceDemand = estimateDeviceDemand;
77205
+ exports.estimatedConcurrentSessions = estimatedConcurrentSessions;
75854
77206
  exports.evaluateAst = require_composition.evaluateAst;
75855
77207
  exports.evaluateCompositionField = evaluateCompositionField;
75856
77208
  exports.evaluateCount = require_composition.evaluateCount;
@@ -76082,6 +77434,7 @@ exports.parseOccupancyScope = parseOccupancyScope;
76082
77434
  exports.parseProcStatus = parseProcStatus;
76083
77435
  exports.parseProfileBrokerId = require_sleep.parseProfileBrokerId;
76084
77436
  exports.parseRuleSection = parseRuleSection;
77437
+ exports.parseSessionPlacementPolicy = parseSessionPlacementPolicy;
76085
77438
  exports.parseStreamParamsFormPatch = parseStreamParamsFormPatch;
76086
77439
  exports.patchAudio = patchAudio;
76087
77440
  exports.petFeederCapability = petFeederCapability;
@@ -76133,6 +77486,7 @@ exports.readTimelapseGeneratedAt = readTimelapseGeneratedAt;
76133
77486
  exports.readUseRootModel = readUseRootModel;
76134
77487
  exports.readinessKey = require_sleep.readinessKey;
76135
77488
  exports.rebootCapability = rebootCapability;
77489
+ exports.recommendNode = recommendNode;
76136
77490
  exports.reconcileBlockDevices = reconcileBlockDevices;
76137
77491
  exports.recordingArchiveCapability = recordingArchiveCapability;
76138
77492
  exports.recordingCapability = recordingCapability;