@camstack/types 1.2.318 → 1.2.319
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.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/pipeline-executor.cap.d.ts +1 -1
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +51 -5
- package/dist/client.js +4 -2
- package/dist/client.mjs +4 -2
- package/dist/generated/addon-api.d.ts +20 -6
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +192 -38
- package/dist/index.mjs +175 -32
- package/dist/pipeline/{best-settings → auto-tune}/demand.d.ts +6 -6
- package/dist/pipeline/{best-settings → auto-tune}/hardware-class.d.ts +1 -1
- package/dist/pipeline/{best-settings → auto-tune}/index.d.ts +1 -1
- package/dist/pipeline/{best-settings → auto-tune}/plan-schemas.d.ts +15 -15
- package/dist/pipeline/{best-settings → auto-tune}/recommend.d.ts +6 -6
- package/dist/pipeline/load-balancing/effective-shares.d.ts +28 -0
- package/dist/pipeline/load-balancing/index.d.ts +4 -2
- package/dist/pipeline/load-balancing/schemas.d.ts +87 -1
- package/dist/pipeline/model-bound-settings.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/pipeline/{best-settings → auto-tune}/detector-performance.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -26870,7 +26870,7 @@ var pipelineExecutorCapability = {
|
|
|
26870
26870
|
auth: "admin"
|
|
26871
26871
|
}),
|
|
26872
26872
|
/**
|
|
26873
|
-
*
|
|
26873
|
+
* Auto tune (D745): the MODEL-BOUND thresholds (`bindsToModel` keys of
|
|
26874
26874
|
* the object-detection root, and their binding keys) stored in THIS node's
|
|
26875
26875
|
* per-camera detector settings — and, unless `dryRun`, remove them so the
|
|
26876
26876
|
* running model's own defaults apply. Every other key of a camera's store
|
|
@@ -27257,10 +27257,14 @@ var pipelineExecutorCapability = {
|
|
|
27257
27257
|
* full or drowning node yields to a free one (D748).
|
|
27258
27258
|
*/
|
|
27259
27259
|
var SessionPlacementPolicySchema = zod.z.enum(["least-loaded", "share"]);
|
|
27260
|
-
|
|
27260
|
+
/**
|
|
27261
|
+
* `share` since D750: the percentages are held by default. `least-loaded` stays
|
|
27262
|
+
* selectable.
|
|
27263
|
+
*/
|
|
27264
|
+
var DEFAULT_SESSION_PLACEMENT_POLICY = "share";
|
|
27261
27265
|
/** The global-settings key the policy is stored under (orchestrator `load` section). */
|
|
27262
27266
|
var SESSION_PLACEMENT_SETTING_KEY = "sessionPlacement";
|
|
27263
|
-
/** Parse a stored value; anything unknown is the default
|
|
27267
|
+
/** Parse a stored value; anything unknown is the default. */
|
|
27264
27268
|
function parseSessionPlacementPolicy(value) {
|
|
27265
27269
|
const parsed = SessionPlacementPolicySchema.safeParse(value);
|
|
27266
27270
|
return parsed.success ? parsed.data : DEFAULT_SESSION_PLACEMENT_POLICY;
|
|
@@ -27342,10 +27346,66 @@ var SuggestSharesResultSchema = zod.z.object({
|
|
|
27342
27346
|
iterations: zod.z.number(),
|
|
27343
27347
|
nodes: zod.z.array(SuggestedNodeShareSchema).readonly()
|
|
27344
27348
|
});
|
|
27349
|
+
/**
|
|
27350
|
+
* Where the node and device shares come from (D750).
|
|
27351
|
+
* - `auto` — computed by the system from the cluster's measured capacity at
|
|
27352
|
+
* the Auto tune models, and recomputed whenever a node or device joins,
|
|
27353
|
+
* leaves, is switched on or off, or changes model.
|
|
27354
|
+
* - `manual` — the operator's stored sliders. A node or device that cannot
|
|
27355
|
+
* take sessions gives its share to the others in proportion; the stored
|
|
27356
|
+
* values are never rewritten for that.
|
|
27357
|
+
*/
|
|
27358
|
+
var ShareSourceSchema = zod.z.enum(["auto", "manual"]);
|
|
27359
|
+
var DEFAULT_SHARE_SOURCE = "auto";
|
|
27360
|
+
/** Headroom the automatic shares are computed at (Auto tune's default). */
|
|
27361
|
+
var AUTO_SHARE_HEADROOM = .4;
|
|
27362
|
+
/** The global-settings key the share source is stored under (orchestrator `load` section). */
|
|
27363
|
+
var SHARE_SOURCE_SETTING_KEY = "shareSource";
|
|
27364
|
+
/** Parse a stored value; anything unknown is the default. */
|
|
27365
|
+
function parseShareSource(value) {
|
|
27366
|
+
const parsed = ShareSourceSchema.safeParse(value);
|
|
27367
|
+
return parsed.success ? parsed.data : DEFAULT_SHARE_SOURCE;
|
|
27368
|
+
}
|
|
27369
|
+
var SetShareSourceInputSchema = zod.z.object({ source: ShareSourceSchema });
|
|
27370
|
+
/** Raw relative weights (any scale) per node and per node's device. */
|
|
27371
|
+
var ShareWeightsSchema = zod.z.object({
|
|
27372
|
+
nodes: zod.z.record(zod.z.string(), zod.z.number()),
|
|
27373
|
+
devices: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number()))
|
|
27374
|
+
});
|
|
27375
|
+
var EffectiveDeviceShareSchema = zod.z.object({
|
|
27376
|
+
deviceKey: zod.z.string(),
|
|
27377
|
+
/** Can take sessions now (enabled, available, can run the root). */
|
|
27378
|
+
eligible: zod.z.boolean(),
|
|
27379
|
+
/** The share the source assigns, as a percentage of the node's devices. */
|
|
27380
|
+
configuredPct: zod.z.number(),
|
|
27381
|
+
/** The share actually used, after an ineligible device's share went to the others. */
|
|
27382
|
+
effectivePct: zod.z.number()
|
|
27383
|
+
});
|
|
27384
|
+
var EffectiveNodeShareSchema = zod.z.object({
|
|
27385
|
+
nodeId: zod.z.string(),
|
|
27386
|
+
eligible: zod.z.boolean(),
|
|
27387
|
+
configuredPct: zod.z.number(),
|
|
27388
|
+
effectivePct: zod.z.number(),
|
|
27389
|
+
devices: zod.z.array(EffectiveDeviceShareSchema).readonly()
|
|
27390
|
+
});
|
|
27391
|
+
var EffectiveSharesSchema = zod.z.object({
|
|
27392
|
+
source: ShareSourceSchema,
|
|
27393
|
+
policy: SessionPlacementPolicySchema,
|
|
27394
|
+
/** `auto` with no computed answer yet: the stored sliders are used meanwhile. */
|
|
27395
|
+
autoPending: zod.z.boolean(),
|
|
27396
|
+
/** When the automatic shares were last computed (ms epoch); null = never. */
|
|
27397
|
+
computedAt: zod.z.number().nullable(),
|
|
27398
|
+
/** What made the system recompute them last. */
|
|
27399
|
+
trigger: zod.z.string().nullable(),
|
|
27400
|
+
nodes: zod.z.array(EffectiveNodeShareSchema).readonly(),
|
|
27401
|
+
/** The relative weights the election reads (before eligibility). */
|
|
27402
|
+
nodeWeights: zod.z.record(zod.z.string(), zod.z.number()),
|
|
27403
|
+
deviceWeights: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number()))
|
|
27404
|
+
});
|
|
27345
27405
|
//#endregion
|
|
27346
|
-
//#region src/pipeline/
|
|
27406
|
+
//#region src/pipeline/auto-tune/plan-schemas.ts
|
|
27347
27407
|
/**
|
|
27348
|
-
* The wire shapes of the
|
|
27408
|
+
* The wire shapes of the Auto tune plan and apply (D745), used by the
|
|
27349
27409
|
* `pipeline-orchestrator` cap. The recommender's own types
|
|
27350
27410
|
* (`recommend.ts`, `demand.ts`) are the TS face of the same data; these
|
|
27351
27411
|
* schemas are what crosses the cap boundary.
|
|
@@ -27480,7 +27540,7 @@ var DetectorStoreClearSchema = zod.z.object({
|
|
|
27480
27540
|
deviceId: zod.z.number(),
|
|
27481
27541
|
keys: zod.z.array(zod.z.string()).readonly()
|
|
27482
27542
|
});
|
|
27483
|
-
var
|
|
27543
|
+
var AutoTuneWarningSchema = zod.z.discriminatedUnion("kind", [
|
|
27484
27544
|
zod.z.object({
|
|
27485
27545
|
kind: zod.z.literal("detector-store-cluster-wide"),
|
|
27486
27546
|
skippedNodes: zod.z.array(zod.z.string()).readonly()
|
|
@@ -27495,7 +27555,7 @@ var BestSettingsWarningSchema = zod.z.discriminatedUnion("kind", [
|
|
|
27495
27555
|
deviceKey: zod.z.string()
|
|
27496
27556
|
})
|
|
27497
27557
|
]);
|
|
27498
|
-
var
|
|
27558
|
+
var AutoTuneOptionsSchema = zod.z.object({
|
|
27499
27559
|
/** Share of each accelerator's throughput kept free (0.3–0.5). */
|
|
27500
27560
|
headroom: zod.z.number().min(.3).max(.5).default(.4),
|
|
27501
27561
|
/**
|
|
@@ -27506,7 +27566,7 @@ var BestSettingsOptionsSchema = zod.z.object({
|
|
|
27506
27566
|
*/
|
|
27507
27567
|
shares: LoadBalancingSharesInputSchema.optional()
|
|
27508
27568
|
});
|
|
27509
|
-
var
|
|
27569
|
+
var AutoTunePlanSchema = zod.z.object({
|
|
27510
27570
|
/** Hash of everything the apply will write — the apply refuses a different one. */
|
|
27511
27571
|
planHash: zod.z.string(),
|
|
27512
27572
|
family: zod.z.literal("yolov9"),
|
|
@@ -27518,13 +27578,13 @@ var BestSettingsPlanSchema = zod.z.object({
|
|
|
27518
27578
|
nodeChanges: zod.z.array(NodeDeviceChangeSchema).readonly(),
|
|
27519
27579
|
cameraClears: zod.z.array(CameraOverrideClearSchema).readonly(),
|
|
27520
27580
|
detectorStoreClears: zod.z.array(DetectorStoreClearSchema).readonly(),
|
|
27521
|
-
warnings: zod.z.array(
|
|
27581
|
+
warnings: zod.z.array(AutoTuneWarningSchema).readonly()
|
|
27522
27582
|
});
|
|
27523
|
-
var
|
|
27583
|
+
var AutoTuneApplyInputSchema = zod.z.object({
|
|
27524
27584
|
planHash: zod.z.string(),
|
|
27525
27585
|
headroom: zod.z.number().min(.3).max(.5).default(.4)
|
|
27526
27586
|
});
|
|
27527
|
-
var
|
|
27587
|
+
var AutoTunePhaseResultSchema = zod.z.object({
|
|
27528
27588
|
phase: zod.z.enum([
|
|
27529
27589
|
"download",
|
|
27530
27590
|
"camera-overrides",
|
|
@@ -27535,19 +27595,19 @@ var BestSettingsPhaseResultSchema = zod.z.object({
|
|
|
27535
27595
|
ok: zod.z.boolean(),
|
|
27536
27596
|
detail: zod.z.string()
|
|
27537
27597
|
});
|
|
27538
|
-
var
|
|
27598
|
+
var AutoTuneApplyResultSchema = zod.z.discriminatedUnion("kind", [
|
|
27539
27599
|
zod.z.object({
|
|
27540
27600
|
kind: zod.z.literal("applied"),
|
|
27541
27601
|
planHash: zod.z.string(),
|
|
27542
|
-
phases: zod.z.array(
|
|
27602
|
+
phases: zod.z.array(AutoTunePhaseResultSchema).readonly()
|
|
27543
27603
|
}),
|
|
27544
27604
|
zod.z.object({
|
|
27545
27605
|
kind: zod.z.literal("aborted"),
|
|
27546
|
-
phases: zod.z.array(
|
|
27606
|
+
phases: zod.z.array(AutoTunePhaseResultSchema).readonly()
|
|
27547
27607
|
}),
|
|
27548
27608
|
zod.z.object({
|
|
27549
27609
|
kind: zod.z.literal("stale"),
|
|
27550
|
-
plan:
|
|
27610
|
+
plan: AutoTunePlanSchema
|
|
27551
27611
|
}),
|
|
27552
27612
|
zod.z.object({
|
|
27553
27613
|
kind: zod.z.literal("refused"),
|
|
@@ -29980,7 +30040,7 @@ var pipelineOrchestratorCapability = {
|
|
|
29980
30040
|
auth: "admin"
|
|
29981
30041
|
}),
|
|
29982
30042
|
/**
|
|
29983
|
-
*
|
|
30043
|
+
* Auto tune (D745) — DRY RUN. Recommends ONE detector family (YOLOv9)
|
|
29984
30044
|
* for the whole cluster from each node's static hardware class, the
|
|
29985
30045
|
* measured latency table and the detection demand, and lists every write
|
|
29986
30046
|
* the apply would make: the node model pins set, the enrichment pins and
|
|
@@ -29989,14 +30049,14 @@ var pipelineOrchestratorCapability = {
|
|
|
29989
30049
|
* enablement, device enablement, pins, recording, notifications, zones and
|
|
29990
30050
|
* rules are never part of it. `planHash` names exactly this diff.
|
|
29991
30051
|
*/
|
|
29992
|
-
|
|
30052
|
+
planAutoTune: require_sleep.method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }),
|
|
29993
30053
|
/**
|
|
29994
|
-
*
|
|
30054
|
+
* Auto tune (D745) — APPLY the plan the operator confirmed. Recomputes
|
|
29995
30055
|
* the plan and refuses (`stale`, with the fresh plan) when its hash is not
|
|
29996
30056
|
* `planHash`, so what is written is exactly the confirmed diff. Offline
|
|
29997
30057
|
* nodes are skipped; there is no undo.
|
|
29998
30058
|
*/
|
|
29999
|
-
|
|
30059
|
+
applyAutoTune: require_sleep.method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
|
|
30000
30060
|
kind: "mutation",
|
|
30001
30061
|
auth: "admin"
|
|
30002
30062
|
}),
|
|
@@ -30022,11 +30082,27 @@ var pipelineOrchestratorCapability = {
|
|
|
30022
30082
|
getPlacementStats: require_sleep.method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }),
|
|
30023
30083
|
/**
|
|
30024
30084
|
* Load balancing (D748) — shares proportional to each node's measured
|
|
30025
|
-
* capacity at the models
|
|
30085
|
+
* capacity at the models Auto tune would pick, iterated (≤ 3 rounds)
|
|
30026
30086
|
* until the shares stop moving; per device, an ADVISORY session cap.
|
|
30027
30087
|
* Writes nothing.
|
|
30028
30088
|
*/
|
|
30029
30089
|
suggestShares: require_sleep.method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }),
|
|
30090
|
+
/**
|
|
30091
|
+
* Load balancing (D750) — the shares placement reads now: the source
|
|
30092
|
+
* (automatic capacity shares or the operator's sliders), each node's and
|
|
30093
|
+
* device's configured share, and the effective share after a node or
|
|
30094
|
+
* device that cannot take sessions gave its share to the others.
|
|
30095
|
+
*/
|
|
30096
|
+
getEffectiveShares: require_sleep.method(zod.z.void(), EffectiveSharesSchema, { auth: "admin" }),
|
|
30097
|
+
/**
|
|
30098
|
+
* Load balancing (D750) — switch between automatic and manual shares.
|
|
30099
|
+
* Going manual seeds the sliders with the current automatic shares (one
|
|
30100
|
+
* atomic write), so nothing jumps; going automatic recomputes at once.
|
|
30101
|
+
*/
|
|
30102
|
+
setShareSource: require_sleep.method(SetShareSourceInputSchema, zod.z.object({ success: zod.z.literal(true) }), {
|
|
30103
|
+
kind: "mutation",
|
|
30104
|
+
auth: "admin"
|
|
30105
|
+
}),
|
|
30030
30106
|
/** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
|
|
30031
30107
|
getCameraSettings: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), CameraPipelineSettingsSchema.nullable()),
|
|
30032
30108
|
/** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
|
|
@@ -56331,7 +56407,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
56331
56407
|
addonId: null,
|
|
56332
56408
|
access: "view"
|
|
56333
56409
|
},
|
|
56334
|
-
"pipelineOrchestrator.
|
|
56410
|
+
"pipelineOrchestrator.applyAutoTune": {
|
|
56335
56411
|
capName: "pipeline-orchestrator",
|
|
56336
56412
|
capScope: "system",
|
|
56337
56413
|
addonId: null,
|
|
@@ -56451,6 +56527,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
56451
56527
|
addonId: null,
|
|
56452
56528
|
access: "view"
|
|
56453
56529
|
},
|
|
56530
|
+
"pipelineOrchestrator.getEffectiveShares": {
|
|
56531
|
+
capName: "pipeline-orchestrator",
|
|
56532
|
+
capScope: "system",
|
|
56533
|
+
addonId: null,
|
|
56534
|
+
access: "view"
|
|
56535
|
+
},
|
|
56454
56536
|
"pipelineOrchestrator.getGlobalMetrics": {
|
|
56455
56537
|
capName: "pipeline-orchestrator",
|
|
56456
56538
|
capScope: "system",
|
|
@@ -56517,7 +56599,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
56517
56599
|
addonId: null,
|
|
56518
56600
|
access: "create"
|
|
56519
56601
|
},
|
|
56520
|
-
"pipelineOrchestrator.
|
|
56602
|
+
"pipelineOrchestrator.planAutoTune": {
|
|
56521
56603
|
capName: "pipeline-orchestrator",
|
|
56522
56604
|
capScope: "system",
|
|
56523
56605
|
addonId: null,
|
|
@@ -56649,6 +56731,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
56649
56731
|
addonId: null,
|
|
56650
56732
|
access: "create"
|
|
56651
56733
|
},
|
|
56734
|
+
"pipelineOrchestrator.setShareSource": {
|
|
56735
|
+
capName: "pipeline-orchestrator",
|
|
56736
|
+
capScope: "system",
|
|
56737
|
+
addonId: null,
|
|
56738
|
+
access: "create"
|
|
56739
|
+
},
|
|
56652
56740
|
"pipelineOrchestrator.suggestShares": {
|
|
56653
56741
|
capName: "pipeline-orchestrator",
|
|
56654
56742
|
capScope: "system",
|
|
@@ -67415,11 +67503,13 @@ function createSystemProxy(api) {
|
|
|
67415
67503
|
setAgentInferenceDevices: (input) => dispatch("pipelineOrchestrator", "setAgentInferenceDevices", "mutation", input),
|
|
67416
67504
|
getNodeInferenceDevices: (input) => dispatch("pipelineOrchestrator", "getNodeInferenceDevices", "query", input),
|
|
67417
67505
|
resetNodePipelineDefaults: (input) => dispatch("pipelineOrchestrator", "resetNodePipelineDefaults", "mutation", input),
|
|
67418
|
-
|
|
67419
|
-
|
|
67506
|
+
planAutoTune: (input) => dispatch("pipelineOrchestrator", "planAutoTune", "query", input),
|
|
67507
|
+
applyAutoTune: (input) => dispatch("pipelineOrchestrator", "applyAutoTune", "mutation", input),
|
|
67420
67508
|
setLoadBalancingShares: (input) => dispatch("pipelineOrchestrator", "setLoadBalancingShares", "mutation", input),
|
|
67421
67509
|
getPlacementStats: (input) => dispatch("pipelineOrchestrator", "getPlacementStats", "query", input),
|
|
67422
67510
|
suggestShares: (input) => dispatch("pipelineOrchestrator", "suggestShares", "query", input),
|
|
67511
|
+
getEffectiveShares: (input) => dispatch("pipelineOrchestrator", "getEffectiveShares", "query", input),
|
|
67512
|
+
setShareSource: (input) => dispatch("pipelineOrchestrator", "setShareSource", "mutation", input),
|
|
67423
67513
|
getCameraStatuses: (input) => dispatch("pipelineOrchestrator", "getCameraStatuses", "query", input),
|
|
67424
67514
|
setCameraSensors: (input) => dispatch("pipelineOrchestrator", "setCameraSensors", "mutation", input),
|
|
67425
67515
|
reconcileFromDisk: (input) => dispatch("pipelineOrchestrator", "reconcileFromDisk", "mutation", input),
|
|
@@ -72383,7 +72473,7 @@ function clearModelBoundOverrides(settings, boundKeys, modelId) {
|
|
|
72383
72473
|
/**
|
|
72384
72474
|
* The keys of every `bindsToModel` field of a step's config schema, groups
|
|
72385
72475
|
* flattened (D738). One definition for the runner (which applies the binding)
|
|
72386
|
-
* and the orchestrator's
|
|
72476
|
+
* and the orchestrator's Auto tune (which clears those overrides, D745).
|
|
72387
72477
|
*/
|
|
72388
72478
|
function collectModelBoundKeys(fields) {
|
|
72389
72479
|
return fields.flatMap((field) => {
|
|
@@ -72392,7 +72482,7 @@ function collectModelBoundKeys(fields) {
|
|
|
72392
72482
|
});
|
|
72393
72483
|
}
|
|
72394
72484
|
//#endregion
|
|
72395
|
-
//#region src/pipeline/
|
|
72485
|
+
//#region src/pipeline/auto-tune/hardware-class.ts
|
|
72396
72486
|
var APPLE_CHIP = /^Apple M(\d+)(?:\s+(Pro|Max|Ultra))?\b/i;
|
|
72397
72487
|
var INTEL_CORE_ULTRA = /Core\(TM\)\s+Ultra|Core Ultra/i;
|
|
72398
72488
|
var INTEL_N_SERIES = /Intel\(R\)\s+N\d{2,3}\b|\bIntel\s+N\d{2,3}\b/i;
|
|
@@ -72448,7 +72538,7 @@ function acceleratorKindOf(deviceKey, hw) {
|
|
|
72448
72538
|
return null;
|
|
72449
72539
|
}
|
|
72450
72540
|
//#endregion
|
|
72451
|
-
//#region src/pipeline/
|
|
72541
|
+
//#region src/pipeline/auto-tune/detector-performance.ts
|
|
72452
72542
|
var DETECTOR_PERF = {
|
|
72453
72543
|
"intel-core-ultra": {
|
|
72454
72544
|
"intel-npu": {
|
|
@@ -72880,7 +72970,7 @@ var DETECTOR_ACCURACY = {
|
|
|
72880
72970
|
}
|
|
72881
72971
|
};
|
|
72882
72972
|
//#endregion
|
|
72883
|
-
//#region src/pipeline/
|
|
72973
|
+
//#region src/pipeline/auto-tune/demand.ts
|
|
72884
72974
|
var DEFAULT_DEMAND_OPTIONS = {
|
|
72885
72975
|
onMotionConcurrency: .25,
|
|
72886
72976
|
onMotionMinConcurrent: 2
|
|
@@ -73003,9 +73093,9 @@ function estimateDeviceDemand(input) {
|
|
|
73003
73093
|
}).toSorted((a, b) => a.nodeId === b.nodeId ? a.deviceKey.localeCompare(b.deviceKey) : a.nodeId.localeCompare(b.nodeId));
|
|
73004
73094
|
}
|
|
73005
73095
|
//#endregion
|
|
73006
|
-
//#region src/pipeline/
|
|
73096
|
+
//#region src/pipeline/auto-tune/recommend.ts
|
|
73007
73097
|
/** The family the cluster runs. */
|
|
73008
|
-
var
|
|
73098
|
+
var AUTO_TUNE_FAMILY = "yolov9";
|
|
73009
73099
|
/** Recall within this of the best counts as a tie — the faster one wins. */
|
|
73010
73100
|
var RECALL_TIE = .02;
|
|
73011
73101
|
/** Default share of an accelerator's throughput kept free. */
|
|
@@ -73022,7 +73112,7 @@ function fitsOn(cell, demand, headroom) {
|
|
|
73022
73112
|
return budget >= (demand?.demandFps ?? 0) && budget >= (demand?.maxCameraFps ?? 0);
|
|
73023
73113
|
}
|
|
73024
73114
|
function candidatesFor(contexts, formatsByModel) {
|
|
73025
|
-
return Object.keys(DETECTOR_ACCURACY).filter((id) => id.startsWith(
|
|
73115
|
+
return Object.keys(DETECTOR_ACCURACY).filter((id) => id.startsWith(AUTO_TUNE_FAMILY)).filter((id) => contexts.every((c) => c.column[id] !== void 0 && (formatsByModel[id] ?? []).includes(c.device.format))).map((id) => ({
|
|
73026
73116
|
modelId: id,
|
|
73027
73117
|
personRecall: DETECTOR_ACCURACY[id]?.personRecall ?? 0
|
|
73028
73118
|
})).toSorted((a, b) => b.personRecall - a.personRecall || a.modelId.localeCompare(b.modelId));
|
|
@@ -73276,6 +73366,59 @@ function electByShare(candidates) {
|
|
|
73276
73366
|
};
|
|
73277
73367
|
}
|
|
73278
73368
|
//#endregion
|
|
73369
|
+
//#region src/pipeline/load-balancing/effective-shares.ts
|
|
73370
|
+
/** Weight a node or device has when its source names none (the balancer's own default). */
|
|
73371
|
+
var DEFAULT_WEIGHT = 1;
|
|
73372
|
+
function positive(value) {
|
|
73373
|
+
return value !== void 0 && value > 0 ? value : DEFAULT_WEIGHT;
|
|
73374
|
+
}
|
|
73375
|
+
function percentages(keys, weightOf, counts) {
|
|
73376
|
+
const total = keys.reduce((sum, k) => sum + (counts(k) ? weightOf(k) : 0), 0);
|
|
73377
|
+
return new Map(keys.map((k) => [k, total > 0 && counts(k) ? Math.round(weightOf(k) / total * 1e3) / 10 : 0]));
|
|
73378
|
+
}
|
|
73379
|
+
function resolveEffectiveShares(input) {
|
|
73380
|
+
const weights = input.source === "auto" && input.auto !== null && input.auto !== null ? input.auto : input.stored;
|
|
73381
|
+
const nodeWeights = {};
|
|
73382
|
+
for (const nodeId of input.nodeIds) nodeWeights[nodeId] = positive(weights.nodes[nodeId]);
|
|
73383
|
+
const eligibleNodes = new Set(input.eligibleNodes);
|
|
73384
|
+
const configured = percentages(input.nodeIds, (k) => nodeWeights[k] ?? DEFAULT_WEIGHT, () => true);
|
|
73385
|
+
const effective = percentages(input.nodeIds, (k) => nodeWeights[k] ?? DEFAULT_WEIGHT, (k) => eligibleNodes.has(k));
|
|
73386
|
+
const deviceWeights = {};
|
|
73387
|
+
const nodes = input.nodeIds.map((nodeId) => {
|
|
73388
|
+
const eligibleKeys = new Set(input.eligibleDevices[nodeId] ?? []);
|
|
73389
|
+
const named = weights.devices[nodeId] ?? {};
|
|
73390
|
+
const keys = [...new Set([...Object.keys(named), ...eligibleKeys])].toSorted();
|
|
73391
|
+
const perDevice = {};
|
|
73392
|
+
for (const key of keys) perDevice[key] = positive(named[key]);
|
|
73393
|
+
if (keys.length > 0) deviceWeights[nodeId] = perDevice;
|
|
73394
|
+
const devConfigured = percentages(keys, (k) => perDevice[k] ?? DEFAULT_WEIGHT, () => true);
|
|
73395
|
+
const devEffective = percentages(keys, (k) => perDevice[k] ?? DEFAULT_WEIGHT, (k) => eligibleNodes.has(nodeId) && eligibleKeys.has(k));
|
|
73396
|
+
const devices = keys.map((deviceKey) => ({
|
|
73397
|
+
deviceKey,
|
|
73398
|
+
eligible: eligibleKeys.has(deviceKey),
|
|
73399
|
+
configuredPct: devConfigured.get(deviceKey) ?? 0,
|
|
73400
|
+
effectivePct: devEffective.get(deviceKey) ?? 0
|
|
73401
|
+
}));
|
|
73402
|
+
return {
|
|
73403
|
+
nodeId,
|
|
73404
|
+
eligible: eligibleNodes.has(nodeId),
|
|
73405
|
+
configuredPct: configured.get(nodeId) ?? 0,
|
|
73406
|
+
effectivePct: effective.get(nodeId) ?? 0,
|
|
73407
|
+
devices
|
|
73408
|
+
};
|
|
73409
|
+
});
|
|
73410
|
+
return {
|
|
73411
|
+
source: input.source,
|
|
73412
|
+
policy: input.policy ?? "share",
|
|
73413
|
+
autoPending: input.source === "auto" && input.auto === null,
|
|
73414
|
+
computedAt: input.computedAt ?? null,
|
|
73415
|
+
trigger: input.trigger ?? null,
|
|
73416
|
+
nodes,
|
|
73417
|
+
nodeWeights,
|
|
73418
|
+
deviceWeights
|
|
73419
|
+
};
|
|
73420
|
+
}
|
|
73421
|
+
//#endregion
|
|
73279
73422
|
//#region src/pipeline/root-face-crop.ts
|
|
73280
73423
|
/** Side of the square, as a multiple of the face box's longer side. */
|
|
73281
73424
|
var ROOT_FACE_REFINE_SCALE = 1.6;
|
|
@@ -75420,6 +75563,8 @@ exports.AUDIO_PRESETS = require_composition.AUDIO_PRESETS;
|
|
|
75420
75563
|
exports.AUDIO_SCALE_EPOCH_ISO = AUDIO_SCALE_EPOCH_ISO;
|
|
75421
75564
|
exports.AUDIO_SCALE_EPOCH_MS = AUDIO_SCALE_EPOCH_MS;
|
|
75422
75565
|
exports.AUTOMATIC_HUB_ADDRESS_FLAGS = AUTOMATIC_HUB_ADDRESS_FLAGS;
|
|
75566
|
+
exports.AUTO_SHARE_HEADROOM = AUTO_SHARE_HEADROOM;
|
|
75567
|
+
exports.AUTO_TUNE_FAMILY = AUTO_TUNE_FAMILY;
|
|
75423
75568
|
exports.AcceleratorKindSchema = AcceleratorKindSchema;
|
|
75424
75569
|
exports.AccessoriesStatusSchema = AccessoriesStatusSchema;
|
|
75425
75570
|
exports.AccessoryKind = AccessoryKind;
|
|
@@ -75487,6 +75632,12 @@ exports.AudioMetricsSnapshotSchema = AudioMetricsSnapshotSchema;
|
|
|
75487
75632
|
exports.AudioPcmChunkSchema = AudioPcmChunkSchema;
|
|
75488
75633
|
exports.AudioStreamPickSchema = require_sleep.AudioStreamPickSchema;
|
|
75489
75634
|
exports.AuthResultSchema = AuthResultSchema;
|
|
75635
|
+
exports.AutoTuneApplyInputSchema = AutoTuneApplyInputSchema;
|
|
75636
|
+
exports.AutoTuneApplyResultSchema = AutoTuneApplyResultSchema;
|
|
75637
|
+
exports.AutoTuneOptionsSchema = AutoTuneOptionsSchema;
|
|
75638
|
+
exports.AutoTunePhaseResultSchema = AutoTunePhaseResultSchema;
|
|
75639
|
+
exports.AutoTunePlanSchema = AutoTunePlanSchema;
|
|
75640
|
+
exports.AutoTuneWarningSchema = AutoTuneWarningSchema;
|
|
75490
75641
|
exports.AutoUpdateSettingsSchema = AutoUpdateSettingsSchema;
|
|
75491
75642
|
exports.AutomationActionSchema = AutomationActionSchema;
|
|
75492
75643
|
exports.AutomationConditionOperatorSchema = AutomationConditionOperatorSchema;
|
|
@@ -75499,7 +75650,6 @@ exports.BASE_DEVICE_CAPS = BASE_DEVICE_CAPS;
|
|
|
75499
75650
|
exports.BASE_LIVE_EGRESS_PROFILE = BASE_LIVE_EGRESS_PROFILE;
|
|
75500
75651
|
exports.BATTERY_DEVICE_PROFILE = BATTERY_DEVICE_PROFILE;
|
|
75501
75652
|
exports.BATTERY_UNREACHABLE_AFTER_MS = BATTERY_UNREACHABLE_AFTER_MS;
|
|
75502
|
-
exports.BEST_SETTINGS_FAMILY = BEST_SETTINGS_FAMILY;
|
|
75503
75653
|
exports.BIRTH_DECISION_DEFAULT_LIMIT = BIRTH_DECISION_DEFAULT_LIMIT;
|
|
75504
75654
|
exports.BOOT_RECOVERY_BACKOFF_MS = require_sleep.BOOT_RECOVERY_BACKOFF_MS;
|
|
75505
75655
|
exports.BUILTIN_RESULT_KINDS = BUILTIN_RESULT_KINDS;
|
|
@@ -75515,12 +75665,6 @@ exports.BaseAddon = require_sleep.BaseAddon;
|
|
|
75515
75665
|
exports.BaseDevice = BaseDevice;
|
|
75516
75666
|
exports.BaseDeviceProvider = BaseDeviceProvider;
|
|
75517
75667
|
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;
|
|
75524
75668
|
exports.BinaryStatusSchema = BinaryStatusSchema;
|
|
75525
75669
|
exports.BirthDecisionQueryInputSchema = BirthDecisionQueryInputSchema;
|
|
75526
75670
|
exports.BirthDecisionRecordSchema = BirthDecisionRecordSchema;
|
|
@@ -75796,6 +75940,7 @@ exports.DEFAULT_RECORDING_PROFILES = DEFAULT_RECORDING_PROFILES;
|
|
|
75796
75940
|
exports.DEFAULT_RETENTION = DEFAULT_RETENTION;
|
|
75797
75941
|
exports.DEFAULT_RUNTIME_STATE_DURABILITY = require_sleep.DEFAULT_RUNTIME_STATE_DURABILITY;
|
|
75798
75942
|
exports.DEFAULT_SESSION_PLACEMENT_POLICY = DEFAULT_SESSION_PLACEMENT_POLICY;
|
|
75943
|
+
exports.DEFAULT_SHARE_SOURCE = DEFAULT_SHARE_SOURCE;
|
|
75799
75944
|
exports.DEFAULT_TIMELAPSE_PREVIEW_TEXT = DEFAULT_TIMELAPSE_PREVIEW_TEXT;
|
|
75800
75945
|
exports.DEFAULT_TOKEN_EXPIRY = DEFAULT_TOKEN_EXPIRY;
|
|
75801
75946
|
exports.DERIVED_CAMERA_SILENCED_CAP_NAMES = DERIVED_CAMERA_SILENCED_CAP_NAMES;
|
|
@@ -75897,6 +76042,9 @@ exports.EXTENSION_SLOTS = EXTENSION_SLOTS;
|
|
|
75897
76042
|
exports.EXTENSION_SLOT_IDS = EXTENSION_SLOT_IDS;
|
|
75898
76043
|
exports.EXTENSION_SLOT_LISTING_METHOD = EXTENSION_SLOT_LISTING_METHOD;
|
|
75899
76044
|
exports.EXTENSION_SLOT_REF_SEPARATOR = EXTENSION_SLOT_REF_SEPARATOR;
|
|
76045
|
+
exports.EffectiveDeviceShareSchema = EffectiveDeviceShareSchema;
|
|
76046
|
+
exports.EffectiveNodeShareSchema = EffectiveNodeShareSchema;
|
|
76047
|
+
exports.EffectiveSharesSchema = EffectiveSharesSchema;
|
|
75900
76048
|
exports.EffectiveTuningSchema = EffectiveTuningSchema;
|
|
75901
76049
|
exports.EgressEncodeSchema = EgressEncodeSchema;
|
|
75902
76050
|
exports.EgressRateControlSchema = EgressRateControlSchema;
|
|
@@ -76692,6 +76840,7 @@ exports.SCOPE_PRESETS = SCOPE_PRESETS;
|
|
|
76692
76840
|
exports.SENSOR_FEATURES = SENSOR_FEATURES;
|
|
76693
76841
|
exports.SENSOR_MAP = SENSOR_MAP;
|
|
76694
76842
|
exports.SESSION_PLACEMENT_SETTING_KEY = SESSION_PLACEMENT_SETTING_KEY;
|
|
76843
|
+
exports.SHARE_SOURCE_SETTING_KEY = SHARE_SOURCE_SETTING_KEY;
|
|
76695
76844
|
exports.SHARE_VIEW_KINDS = require_sleep.SHARE_VIEW_KINDS;
|
|
76696
76845
|
exports.SINGLE_HUB_ADDRESS_ROLES = SINGLE_HUB_ADDRESS_ROLES;
|
|
76697
76846
|
exports.SOURCE_CAPS = require_composition.SOURCE_CAPS;
|
|
@@ -76741,6 +76890,7 @@ exports.SessionPlacementPolicySchema = SessionPlacementPolicySchema;
|
|
|
76741
76890
|
exports.SessionTriggerSchema = SessionTriggerSchema;
|
|
76742
76891
|
exports.SetCameraSensorsInputSchema = SetCameraSensorsInputSchema;
|
|
76743
76892
|
exports.SetLoggingSettingsInputSchema = SetLoggingSettingsInputSchema;
|
|
76893
|
+
exports.SetShareSourceInputSchema = SetShareSourceInputSchema;
|
|
76744
76894
|
exports.SetSiteLocationInputSchema = SetSiteLocationInputSchema;
|
|
76745
76895
|
exports.SetTrackPurityInputSchema = SetTrackPurityInputSchema;
|
|
76746
76896
|
exports.SetTrackPurityResultSchema = SetTrackPurityResultSchema;
|
|
@@ -76749,6 +76899,8 @@ exports.SettingsPatchSchema = SettingsPatchSchema;
|
|
|
76749
76899
|
exports.SettingsRecordSchema = SettingsRecordSchema;
|
|
76750
76900
|
exports.SettingsSchemaWithValuesSchema = SettingsSchemaWithValuesSchema;
|
|
76751
76901
|
exports.SettingsUpdateResultSchema = SettingsUpdateResultSchema;
|
|
76902
|
+
exports.ShareSourceSchema = ShareSourceSchema;
|
|
76903
|
+
exports.ShareWeightsSchema = ShareWeightsSchema;
|
|
76752
76904
|
exports.ShmRingStatsSchema = ShmRingStatsSchema;
|
|
76753
76905
|
exports.SiteLocationSchema = SiteLocationSchema;
|
|
76754
76906
|
exports.SiteLocationSourceSchema = SiteLocationSourceSchema;
|
|
@@ -77435,6 +77587,7 @@ exports.parseProcStatus = parseProcStatus;
|
|
|
77435
77587
|
exports.parseProfileBrokerId = require_sleep.parseProfileBrokerId;
|
|
77436
77588
|
exports.parseRuleSection = parseRuleSection;
|
|
77437
77589
|
exports.parseSessionPlacementPolicy = parseSessionPlacementPolicy;
|
|
77590
|
+
exports.parseShareSource = parseShareSource;
|
|
77438
77591
|
exports.parseStreamParamsFormPatch = parseStreamParamsFormPatch;
|
|
77439
77592
|
exports.patchAudio = patchAudio;
|
|
77440
77593
|
exports.petFeederCapability = petFeederCapability;
|
|
@@ -77515,6 +77668,7 @@ exports.resolveCoreBlockFiles = resolveCoreBlockFiles;
|
|
|
77515
77668
|
exports.resolveCreateExportSubject = resolveCreateExportSubject;
|
|
77516
77669
|
exports.resolveDeviceControlKind = resolveDeviceControlKind;
|
|
77517
77670
|
exports.resolveDeviceProfile = resolveDeviceProfile;
|
|
77671
|
+
exports.resolveEffectiveShares = resolveEffectiveShares;
|
|
77518
77672
|
exports.resolveEgressDecodeHwAccel = resolveEgressDecodeHwAccel;
|
|
77519
77673
|
exports.resolveExportProfiles = resolveExportProfiles;
|
|
77520
77674
|
exports.resolveFormat = resolveFormat;
|